Commit graph

192 commits

Author SHA1 Message Date
Adrian Danis
bbdf7a89a7 Mark tlbLockCount as visible so it is not discarded
This variable is referenced in assembler and needs to not get discarded
by the optimizer prior to linking.
2016-05-24 08:46:54 +10:00
Felix Kam
39a2c4f108 Merge pull request #181 in SEL4/sel4 from ~FKAM/sel4:lockTLBEntryPatch to master
* commit 'b9a7f3c9a13ff7e997e28b63676a1dd2a1b7f381':
  Make lockTLBEntry comply with the decompiler
2016-05-23 06:30:42 +00:00
Adrian Danis
0c1d959b0e x86: Define Additional MSRs
Define these MSRs in preparation for their use on the x86_64 port
2016-05-23 14:17:36 +10:00
Adrian Danis
086b5192c5 Merge pull request #180 in SEL4/sel4 from ~ADANIS/sel4:printing to master
* commit '1287590e9736f48e30b42fe678f2bf081a8c1874':
  Correct separation of printing and debug builds
2016-05-19 00:17:03 +00:00
Felix Kam
b9a7f3c9a1 Make lockTLBEntry comply with the decompiler
lockTLBEntry, an assembly function, had tlb_lock_count as a symbol that
needed to be placed sufficiently close to be loaded and stored with
offset-from-pc addressing. When assembled, the symbol would turn up
between functions, as opposed to within a literal pool (it's a variable,
not a constant) or the .bss / data sections. The decompiler doesn't
handle that use case, and likely won't.  This change turns
tlb_lock_count into a C global variable (so that it will be placed in
the .bss / data sections), and splits lockTLBEntry into two parts so the
critical section will still fit in a 64-byte aligned region, and
therefore be guaranteed to live within a single page.
2016-05-18 16:53:13 +10:00
Adrian Danis
1c1e976de2 x86: Improve translation invalidation
x86_64 (with PCIDs enabled) supports a more fine grained invalidation
approach for the TLB and Page Structure Cache. This change expands
the number and kinds of information passed for certain invalidations,
and provides an implementation of this for ia32.
2016-05-18 13:49:28 +10:00
Adrian Danis
1287590e97 Correct separation of printing and debug builds
Fixes some build issues with 541289a326
as well as further allowing debugging (via the capdl interface) to
happen when printing is turned off.
2016-05-17 15:10:08 +10:00
Adrian Danis
541289a326 Further separate 'release' and 'verification' builds
Originally building the kernel was largely considered to be done in
one of two ways
1. Release build with no assertions, no debug symbols and no printing.
   This was generally considered to be a 'verified' build
2. Debug build with assertions, debug symbols and printing

Since then various options were added, such as the 'code injection'
option, which we wanted on builds that did not have assertions or
other options that affected performance. As such it did not depend
upon a debug build and had large warning signs saying that enabling
this in a release build would not give you a verified or trusted
kernel.

Most recently the ability to print from the kernel in release mode
was added. For the same reason that tying the ability to print with
the performance reduction of various debugging was not always desireable.

This change attempts to unify the current state and have a single top
level option to enable a 'verification friendly' build. All other
options (assertions, printing, code injection) then depend upon
this configuration not being set.
2016-05-17 10:51:55 +10:00
Yanyan Shen
cc729fab45 Merge pull request #145 in SEL4/sel4 from ~YSHEN/sel4k:feature/tk1 to master
* commit 'b9410822c17886309021671ac547589f4f76db05':
  arm/tk1: add support for Nvidia Tegra K1 board
2016-03-22 05:31:49 +00:00
Yanyan Shen
b9410822c1 arm/tk1: add support for Nvidia Tegra K1 board 2016-03-22 16:23:37 +11:00
Anna Lyons
9ae867cbf2 SELFOUR-435: change kernel timer from GPT11 to 9
GPT1-9 are configured by uboot to run at 13Mhz,
while GPT10-11 are not and run with a much slower clock.
2016-03-17 09:54:40 +11:00
Joel Beeren
702930246a Merge pull request #53 in SEL4/sel4 from ~ALYONS/sel4:reduce-dup-bi to master
* commit '289bf92bf0713f9060f3a43c0ee91f2a06d9e4d7':
  SELFOUR-114: remove bootinfo.h duplication
2016-03-02 23:47:20 +00:00
Adrian Danis
602f536940 x86: Change some PHYS_CODE to BOOT_CODE
The functions pit_init and pit_wait_wraparound were previously marked as
PHYS_CODE, despite being called from BOOT_CODE elsewhere. This bug has
been present for some time but can be masked by the compiler inlining
all the involved functions, which is what typically happens.
2016-03-02 11:11:48 +11:00
Anna Lyons
289bf92bf0 SELFOUR-114: remove bootinfo.h duplication 2016-03-01 17:25:22 +11:00
Yanyan Shen
81fe0a7fa6 arm/imx7: add support for iMX7-based Sabre board 2016-02-25 15:07:53 +11:00
Adrian Danis
e61a1056cc SELFOUR-56: Remove diminish rights from IPC
Diminish rights were to prevent a user from sending a writeable
cap over a read only endpoint. It turns out this 'security' can
be worked around without difficulty (by putting caps in a cnode
and sending the cnode) making the current diminish rights
implementation functionally useless.

Removing diminish rights has the benefit of simplifying all the
IPC paths.
2016-02-23 13:58:48 +11:00
Adrian Danis
9e35b398cc x86: Refactor vspace code to have verification friendly invocations 2016-02-17 09:43:54 +11:00
Adrian Danis
dd59353944 x86: More portable user mode IO port restriction
For x86-64, to disable IO instructions in user mode requires a
IO permission map being set up properly in TSS. Setting the
IO map base field of TSS larger than the TSS works for 32-bit, but
not 64-bit. This commit sets up a IO permission map usable for both
32-bit and 64-bit kernel and changes the TSS to use the mapping.
The IO permission bitmap is appened to the bitfield generated tss_t,
resulting the tss_io_t structure.
2016-02-15 16:08:51 +11:00
Adrian Danis
775ca8c929 x86: Fix clflush invocation in flushCacheLine
This fixes flushCacheLine to flush the line pointer to be vaddr,
not the cache line of the stack location holding the vaddr pointer
2016-02-15 15:57:45 +11:00
Adrian Danis
1ca0fa1fc2 imx6: Update autconf.h for standalone kernel compile 2016-02-12 14:08:08 +11:00
Robert Kaiser
c0bc7d8fc1 Added changes for Wandboard 2016-02-12 11:54:36 +11:00
Adrian Danis
d20ca20a13 x86: Rename ia32->x86
This is a stylistic commit to make names of variables/constants and
functions in the kernel more consistent. That is, things that are
not IA32 specific, but are generic x86, get renamed to having an
x86 name
2016-02-10 17:02:06 +11:00
Adrian Danis
eb5b792bca trivial: style 2016-02-10 11:48:31 +11:00
Adrian Danis
cfcaf49c2d SELFOUR-399: object sizes and globals frame addr should come from the same source 2016-02-10 09:13:16 +11:00
Adrian Danis
3c9f304a40 x86: Update autoconf.h for standalone kernel builds 2016-02-04 15:00:49 +11:00
Adrian Danis
be6b6be119 x86: FS/GS base MSRs
when FS/GS_BASE_MSR are used to set the base addreses,
user applications should not touch FS/GS regiters; so
the kernel should load proper selectors once, establishing
limits and other attributes for the segments.
2016-02-04 13:39:16 +11:00
Adrian Danis
fa3989eff6 trivial: style 2016-02-04 12:12:36 +11:00
Adrian Danis
91b38f371e x86: Rename mistake usage of x86->ia32 to fix build errors 2016-02-04 11:32:05 +11:00
Adrian Danis
d53aa04fd8 x86: Abstractions for setting up benchmarking log 2016-02-04 10:30:55 +11:00
Adrian Danis
9b7a8405c2 Change bootinfo to have generic slot region for paging structures
Current bootinfo defines two slot regions for paging structures,
one for page directories and one for page tables. This does not
easily generalise for N levels of paging structures. This change
uses a single region that has a known order of objects for however
many levels exist
2016-02-03 16:16:00 +11:00
Robert Kaiser
a2f414dc18 Run idle thread in system mode (rather than supervisor)
Add platform dependent code (using macros from autoconf.h)
to make idle thread run in low power mode on all ARMv7
and ARMv6 except for the KZM board: That board does not
seem to support low power mode although the chip should,
according to he manual

Part of SELFOUR-419
2016-02-03 16:07:55 +11:00
Adrian Danis
417e3e1ccf Merge pull request #103 in SEL4/sel4 from ~AZARRABI/sel4:aarch32 to master
* commit '3959ced3418c08d174e3c7533fc7459d2286fe15':
  Remove mode dependant codes for initial thread from architecture dependant boot codes
2016-02-03 04:14:34 +00:00
Adrian Danis
bddd804a6e x86: IOAPIC/MSI syscalls
Restructure the x86 interrupt handling to allow for a more flexible
method of using IOAPIC and MSI interrupts. The essence of this change
is to allow for the user to pick, for both IOAPIC and MSIs, which
CPU vector to use. Additionally there is future support, in the API,
for seL4 to eventually protect MSI interrupts with the vt-d interrupt
routing tables.

API behaviour for legacy systems using the PIC is preserved

Part of SELFOUR-281
2016-02-02 15:58:18 +11:00
amrzar
3959ced341 Remove mode dependant codes for initial thread from architecture dependant boot codes 2016-02-02 15:48:42 +11:00
Adrian Danis
0107e60169 ia32: Reduce total number of ASIDs from 16bits to 12bits
This change brings the ia32 api in line with the planned x64 api,
which will have 12bits of ASID. Aside from providing a consistent
API, this change also frees up bits in the frame cap that will
allow further x64 changes to be unified.
2016-01-29 15:46:51 +11:00
Adrian Danis
4f7ac5e196 Merge pull request #95 in SEL4/sel4 from ~ADANIS/sel4:used to master
* commit '21d9f7aeabce0c47033b402c07ec78a36c69c2f4':
  Add 'used' attribute to memcpy to prevent optimizing out
2016-01-27 23:39:01 +00:00
Adrian Danis
21d9f7aeab Add 'used' attribute to memcpy to prevent optimizing out
Some versions of GCC replace a struct copy with a call to 'memcpy',
which it is fully in its rights to do. Unfortunately on ARM platforms,
that have no direct calls to memcpy, the optimizer (in the presence
of -fwhole-program) drops the implementation of memcpy, even as it
is outputting calls to it.

Add the USED attribute prevents the optimizer from dropping the
function eagerly.
2016-01-28 10:36:24 +11:00
amrzar
3fc76c25f6 Rearranging headers for aarch32 to 32/mode/* 2016-01-27 16:32:48 +11:00
Adrian Danis
915a404d5c libsel4: Provide a layer of indirection around types.bf and shared_types.bf to allow for 64-bit variants 2016-01-21 13:31:54 +11:00
Adrian Danis
a701481095 Merge pull request #85 in SEL4/sel4 from ~AZARRABI/sel4:aarch32 to master
* commit '1a1110a0949c76a2d372e2bba6b2526898c51a68':
  Modify Kconfig and Makefile for aach32 as sel4_arch libsel4: updates to include aarch32 as sel4_arch
2016-01-19 05:17:46 +00:00
amrzar
1a1110a094 Modify Kconfig and Makefile for aach32 as sel4_arch
libsel4: updates to include aarch32 as sel4_arch
2016-01-19 15:37:52 +11:00
Joel Beeren
e11bb32f78 archirq: fix x86 invLabel 2016-01-18 11:47:21 +11:00
Joel Beeren
1ff5a552c9 archirq: rename missed label to invLabel 2016-01-18 11:37:52 +11:00
Adrian Danis
a6aa7472f3 Remove redundant IRQInterruptControl invocation, and replace with a mechanism to actually decode arch specific IRQ invocations
Part of SELFOUR-281
2016-01-18 11:37:52 +11:00
Adrian Danis
0b88c56246 x86: Add missing checks when mapping and unmapping paging objects 2016-01-14 17:04:22 +11:00
Adrian Danis
8b280a07b7 x86: Introduce mode specific unmap and remap operations 2016-01-13 12:07:45 +11:00
Adrian Danis
210fc1f3fc x86: Factor out 32-bit specific parts of the fastpath 2016-01-13 09:52:31 +11:00
Adrian Danis
c58098c97a x86: Factor out IA32 specific objecttype code 2016-01-12 16:57:55 +11:00
Adrian Danis
cf6e5c8e12 x86: Use typedef for vspace roots instead of void* 2016-01-12 12:19:29 +11:00
Adrian Danis
68887cd836 x86: Populate the freemem list from the multiboot mem list
If the multiboot memory list exists, then it may contain more
than just the single contiguous memory region listed in 'mem_upper'
Therefore we use it to populate a more complete free memory list,
if it exists
2016-01-12 10:59:08 +11:00