Commit graph

755 commits

Author SHA1 Message Date
Hesham Almatary
586bb8ef49 SELFOUR-806: ARM/SMP/FPU - Support remote FPU switch 2017-06-29 13:42:11 +10:00
Hesham Almatary
64d576fb47 SELFOUR-806: aarch32 - Implement lazy FP save/restore
This commit implements lazy FP save/restore mechanism, required for user threads
when they use the FPU. The following caveats take place:

* Only support synchronous exceptions. No support for asynchronous ones.
* VFP opcodes are used instead of normal instructions to discard compiler warnings/errors.
* Support is limited to specific ARM subarchitectures we support and tested this commit on.
* Disable the FPU by default if users are not using it to avoid channels.
* FPU support is not verified yet.
* Will not work properly if using a VM that's running besides other VMs/threads that are using the FPU.
2017-06-29 13:42:10 +10:00
Hesham Almatary
3aa244cc14 Verification: popcount- Avoid conflict variable names/types 2017-06-29 13:35:30 +10:00
Hesham Almatary
13e32a295d trivial: fixes to popcountl implementation 2017-06-29 10:43:48 +10:00
Hesham Almatary
2e14cd3400 Verification: Hide cpuIndexToID 2017-06-29 10:26:40 +10:00
Hesham Almatary
0645a9ddb3 util.h: implement popcount for architectures that don't have HW inst for it 2017-06-29 10:15:00 +10:00
Hesham Almatary
b7f10a3415 ARM/SMP: define IPI_MEM_BARRIER for ARM, that's used in generic smp/ipi.c 2017-06-29 10:15:00 +10:00
Hesham Almatary
0b526dce5d ARM/SMP: Implement cpuIndexToID
Currently we assume CPU IDs to be linear and use HW CPU IDs as indices
to SMP-related arrays/state. This may change in the future (when
cluster-based SoC are supported).

cpuIndexToID converts a CPU index to a bit position in the case of ARM/GIC,
in order to send IPIs.
2017-06-29 10:14:59 +10:00
Hesham Almatary
2499f87216 ARM/SMP: rename/add IRQ macros to match with x86 2017-06-29 10:14:59 +10:00
Hesham Almatary
40970c300e SMP: allow an architecture to provide its own optimised IPI send function 2017-06-23 10:36:36 +10:00
Hesham Almatary
cac1348f20 SMP/ARM: include generic smp/ipi.h and move ipi.c to smp/ 2017-06-23 10:36:36 +10:00
Hesham Almatary
8f713ab44f SELFOUR-747: SMP/x86: generalize arch-independent IPI code 2017-06-23 10:36:36 +10:00
Anna Lyons
197b0805a2 seL4_DebugDumpScheduler: reformat output
- don't print header every time
- drop address, it's not very useful and clutters the output
- add pretty header
- use new leading spaces feature in kprintf
2017-06-23 10:28:54 +10:00
Bamboo
00bcd5cab0 [STYLE_FIX] 2017-06-22 05:29:51 +00:00
Anna Lyons
40c61e5c18 Fix licenses (the rest) 2017-06-22 15:29:12 +10:00
Hesham Almatary
6f52cd3db2 SMP/x86: convention - put all ipi.* files under smp/ directory
This follows the convention of other higher-level ipi.* smp.* files
put under smp/. Also upcoming ARM files.
2017-06-22 12:07:35 +10:00
Hesham Almatary
0a6f9a5ddb SELFOUR-748: ARM - Support local/remote TLB invalidation operations 2017-06-22 10:55:38 +10:00
Matthew Brecknell
b0c744b248 SELFOUR-881: add ghost state updates for x86-64 2017-06-21 17:47:04 +10:00
Adrian Danis
2038316358 x86: Split large structs into portions
The C parser does not enjoy parsing structs with many fields
2017-06-21 17:14:48 +10:00
Adrian Danis
5552c6c6d9 mark memset and memcpy as VISIBLE
When compiling the kernel as a whole program it is possible that these functions may
be inlined and not emitted in the resulting binary. However at the same time the
compiler may itself emit calls to these functions. Marking these functions as
externally visible tells the compiler that there may be more usages of them than
it sees immediately in the source code, in this cases usages that the compiler
itself is going to generate
2017-06-16 14:25:50 +10:00
Jonas Claeson
d8c31a8583 Removed unnecessary comparison in updateIRQState
./kernel/include/plat/pc99/plat/machine/interrupt.h:115:14:
error: comparison of unsigned expression >= 0
      is always true [-Werror,-Wtautological-compare]
    if(!(irq >= 0 && irq <= maxIRQ)) _assert_fail(...
         ~~~ ^  ~
2017-06-13 16:50:43 +02:00
Jonas Claeson
06dac66038 Fixed missing debug log in debug_printKernelEntryReason
In file included from ./kernel/src/api/faults.c:16:
In file included from ./kernel/include/api/syscall.h:19:
./kernel/include/api/debug.h:51:38: error: comparison of constant 'SysSend' (-3) with expression of type
      'seL4_Word' (aka 'unsigned long') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
        if (ksKernelEntry.syscall_no == SysSend ||
            ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~
./kernel/include/api/debug.h:52:42: error: comparison of constant 'SysNBSend' (-4) with expression of type
      'seL4_Word' (aka 'unsigned long') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
                ksKernelEntry.syscall_no == SysNBSend ||
                ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~
./kernel/include/api/debug.h:53:42: error: comparison of constant 'SysCall' (-1) with expression of type
      'seL4_Word' (aka 'unsigned long') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
                ksKernelEntry.syscall_no == SysCall) {
                ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~
2017-06-13 16:50:02 +02:00
Yanyan Shen
c6900c98e7 arm/imx7: add/correct dev mem/int; generic timer
Add more device memory regions and interrupts.
Merged Anna's generic timer impl.
2017-06-09 10:48:57 +10:00
Anna Lyons
fdc96a183f Warn in arm generic timer if reload value is too high 2017-06-07 16:12:42 +10:00
Anna Lyons
8c7081c9aa trivial: use BIT in compile asserts in structures.h 2017-06-02 14:47:26 +10:00
Hesham Almatary
f1ef8b3a55 ARM: Fix assembler error with BIT definition 2017-06-02 10:56:15 +10:00
Anna Lyons
59415dc99c Add compile assert to ensure tcbName size > 0
Otherwise in debug mode, printing tcbName
can crash the system.
2017-06-01 15:11:51 +10:00
Anna Lyons
bb5ecb1b3e SELFOUR-880: add seL4_DebugDumpScheduler
- when CONFIG_DEBUG is enabled, track all threads
- when CONFIG_PRINTING is enabled, provide seL4_DebugDumpScheduler which
allows the user to dump the state of the kernel scheduler.
2017-05-30 15:22:23 +10:00
Adrian Danis
1f2f6b98bb Use CONFIG_ variables instead of configuration definitions 2017-05-29 17:04:47 +10:00
Hesham Almatary
1930cf2e44 Fix: Allow util.h to be included in assembly files 2017-05-29 15:45:22 +10:00
Hesham Almatary
7ec01d0992 ARM32: typedef vspace_root_t
Similar to x86, and avoid #ifdefs in fastpath.c arch-independent code
2017-05-18 13:35:33 +10:00
Anna Lyons
9ca253a3d0 SELFOUR-879: expose index and entry constants 2017-05-09 11:35:52 +10:00
Anna Lyons
fc0f1eec76 kernel entry tracking: track VMExit and VCPUfault 2017-05-08 10:10:37 +10:00
Stephen Sherratt
2c398b7bf6 Abstract setting ipc buffer register into arch fn 2017-05-05 16:01:51 +10:00
Anna Lyons
50d72007c6 SELFOUR-862: CONFIG_PRINTING --> seL4_DebugPutChar
seL4_DebugPutChar is only available when CONFIG_PRINTING is enabled
2017-05-04 16:07:16 +10:00
Bamboo
8ce9513d7a [STYLE_FIX] 2017-05-04 01:48:32 +00:00
Adrian Danis
a5fa9570fc Change hasVCPU to generic archInfo boolean in public interfaces
The Arch_hasVCPU function instead of cheaking for whether a thread has a VCPU was
specifically checking for whether a thread on aarch32 had a VCPU, as that was the
condition needed to be passed into sanitiseRegister. This made the implementation
on x86 extremely confusing as Arch_hasVCPU was implemented to return false due to
there being no need for sanitiseRegister on x86 to know whether there was a vcpu.

This commit changes hasVCPU variables to be an abstract archInfo boolean that can
be used arbitrarily by an architecture. Arch_hasVCPU function was also changed to
become Arch_getSanitiseRegisterInfo whose result only passed to sanitiseRegister.
2017-05-04 11:18:03 +10:00
Adrian Danis
8523406990 Use unverified_compile_assert in cases where OFFSETOF is used
OFFSETOF is not supported by the C parser, and so regular compile_assert may not be used
2017-05-04 11:13:31 +10:00
Adrian Danis
038018be65 Use OFFSETOF instead of directly using __builtin_offsetof 2017-05-04 11:13:31 +10:00
Adrian Danis
019f965e7d arm: Use unverified_compile_assert instead of manual #ifdef wrapping 2017-05-04 11:13:31 +10:00
Adrian Danis
ae0937a053 Add unverified_compile_assert
This version of compile_assert is not expanded during verification builds and
can be used in cases where you would like an assertion that contains syntax
that is not supported by the C parser
2017-05-04 11:13:31 +10:00
Adrian Danis
52834951dc Add missing include in assert.h 2017-05-04 11:13:31 +10:00
Adrian Danis
0a0c27227e x86: Remove trailing semicolons in asm statements
These semicolons are not actually necessary, and cause problems for the C parser
2017-05-04 11:13:31 +10:00
Kent McLeod
d13544c737 SELFOUR-865: Pass memory map information to user 2017-05-03 16:17:03 +10:00
Adrian Danis
551e73f22f Check for configuration variables being 'defined' instead of 'true'
This is to conform with existing style of checking configuration options
2017-05-03 10:35:44 +10:00
Anna Lyons
beddca16cd libsel4: Add seL4_FastMessageRegisters
This allows benchmarks and utility code to only set registers in the ipc
buffer as required.
2017-05-02 11:08:11 +10:00
Rafal Kolanski
0f0680835c arm fastpath: reorder vcpu_switch / armv_contextSwitch_HWASID
In the original slow path, armv_contextSwitch_HWASID shoots first.

Verification can't reorder machine operations on hardware state we don't
model. This puts the fastpath into the same order as the slow path.
2017-04-29 19:53:32 +10:00
Joel Beeren
d7cf973002 Refactor sanitiseRegister to take a bool rather than a (tcb_t *).
This involves adding a function to determine if a tcb has a vcpu, and
makes verification a lot easier for arm-hyp.
2017-04-27 15:50:22 +10:00
Adrian Danis
b861f28498 Move isRunnable from thread.c to thread.h
This helper function is useful beyond just thread.c
2017-04-26 09:36:43 +10:00
Adrian Danis
353f05747f arm: Pass 'call' down to invokeVCPUReadReg
invokeVCPUReadReg should not be setting message registers for the return message unless
the user performed a call. In doing so we must refactor the call to readVCPUReg to
outside the introduced `if` condition since, as it performs machine operations, it
should always happen
2017-04-24 15:54:32 +10:00