Commit graph

746 commits

Author SHA1 Message Date
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
Adrian Danis
43dea0680c x86: Correct multiboot info definition
The fields in the multiboot_info structure have precise sizes and should not use pointers
types as these sizes change between ia32 and x86_64 builds. This commit changes such
fields to be the correct fixed size uint32_t
2017-04-20 16:22:52 +10:00
Anna Lyons
8c02bc1301 x64: implement seL4_BenchmarkFlushCaches
by moving the ia32 implementation up a level to x86
and implementing the syscall stub.
2017-04-11 14:14:10 +10:00
Anna Lyons
37fef55a27 trivial: remove unused 'bound' field from ntfn 2017-04-11 13:59:54 +10:00
Adrian Danis
4e3839e315 Move standalone autoconf.h files out of include directories
When performing non standalone builds a separate autoconf.h file is generated and defines
the configuration of the kernel. Currently the directory with that file as well as the
kernels include/plat/${PLAT} directory are both listed as include directories to the
compiler. Due to the directory with the generated autoconf.h being earlier in the -I
list the generated autoconf.h will be used in preference to the standalone autoconf.h.

Relying on the order of -I directives is too unstable and so this commit moves the
autoconf.h files to a dedicated configs directory, which is only added as a -I
directive if a standalone build is being performed.
2017-04-10 11:16:57 +10:00
Rafal Kolanski
73db41687e arm hyp: make invokeVCPUInjectIRQ index arg unsigned long
Argument passed to it comes directly from a word_t so it shouldn't be
signed. Also, verification.
2017-04-06 13:45:43 +10:00
Adrian Danis
0abc720277 s/DEBUG/CONFIG_DEBUG_BUILD/
DEBUG definition is not supposed to be used in the kernel, rather CONFIG_DEBUG_BUILD,
which can be toggled separately to user notion of DEBUG
2017-04-06 10:43:24 +10:00
Stephen Sherratt
b70374eb48 Add debug_printUserState 2017-04-05 16:54:50 +10:00
Rafal Kolanski
7680bab494 tk1: disable SMMU in autoconf.h
This is overwritten by KConfig but used on verified platform where the
SMMU is likely to come much later.
2017-04-05 09:50:52 +10:00
Rafal Kolanski
9b17e8afca tk1: maxIRQ off-by-one w.r.t. N_INTERRUPTS 2017-04-04 15:59:40 +10:00