Commit graph

772 commits

Author SHA1 Message Date
Adrian Danis
383a6d959f Merge branch zcu102-7.0.0 into master 2017-10-03 12:16:08 +11:00
Adrian Danis
368d5ae65e x86: Use word_t for vm_rights_t instead of uint32_t
This prevents implicit casting and simplifies verification
2017-09-29 10:46:31 +10:00
Robbie VanVossen
4ba89d4aa0 Added 64-bit support for the zynqmp.
Split up the bit specific code into new folders and added 64-bit
support. Also, changed the device register sizes to be based off of
PAGE_BITS instead of a hardcoded number.

TIMER_CLOCK_HZ is set to the default clock rate from the ATF,
which is the same for both AARCH32 and AARCH64.It may require changes
to the FSBL to work correctly.
2017-09-27 12:59:07 -04:00
Robbie VanVossen
02ca6a80a4 Added 32-bit support for the zynqmp.
The Zynq UltraScale+ MPSoC (PLAT zynqmp) is a Multi-Processor SOC
made by Xilinx that has a quad-core Cortex-A53, a dual-core Cortex-R5
and an FPGA.

This adds 32-bit, single-core support on the the Cortex-A53 cluster.
2017-09-27 12:58:49 -04:00
Adrian Danis
95b505bee2 pc99: Make irq_t a uint8_t type instead of an enum type
This renames the previous irq_t enum into a platform_irq_t enum and provides irq_t
as a 'well defined' uint8_t typedef. Having irq_t be an integer type, and not an enum,
is necessary for consistency with verification. As part of explicitly defining irq_t
as an unsigned integer type the definition of irqInvalid is changed to prevent sign
extension leading to unexpected invalid comparisons.
2017-09-26 16:57:10 +10:00
Adrian Danis
128829a919 x86: Rationalize names of paging structures
Changes the name of paging structure entries to more clearly indicate the kind of object
they map to. Generally this is changing a `pde_small` to `pde_pt` to indicate that this
mapping refers to a page table, removing an inconsistency where `pde_large` indicated that
the mapping was for a large page. For the same reason the `ept_pde_4k` type is changed to
`ept_pde_pt` type to reflect what is present in the actual entry.

`pde_large` is left as 'large' and not explicitly given a size as code common between
ia32 and x86-64 manipulates these entities and 'large' is already a used abstraction
over the two potential page sizes so there is need to introduce a formal abstraction layer
and make the names in the structures more specific.
2017-09-12 15:44:17 +10:00
Adrian Danis
2bf586fe3d x86: Correct return type of servicePendingIRQ
This function returns an interrupt_t, and its call sites expect an interrupt_t,
despite the types being written as irq_t.

Closes #66
2017-08-29 10:56:43 +10:00
Anna Lyons
5627c275ce SMP: add top level migrateTCB
On the MCS kernel, Arch_migrateTCB is called in multiple places.
This commit moves the common code that is required when migrating a TCB
to a top level function to reduce boiler plate.
2017-08-23 11:19:27 +10:00
Adrian Danis
0b73072016 Add a CMake based build system
This commit adds an alternate build system using CMake that operates indepenently of
the existing Kconfig+Kbuild+make based build system
2017-08-22 13:56:26 +10:00
Adrian Danis
f85fb62fe5 SELFOUR-1062: Hide all VT-x related code behind #ifdef guards
The VT-x implementation is not going to be verified at the moment, and so the code for
it needs to be hidden from verification, which we do by #ifdef'ing it out if the VT-x
is not enabled. As a result the VT-x configuration depends on a non verification target
2017-08-21 16:44:58 +10:00
Adrian Danis
a9e1f51713 SELFOUR-1062: Hide all IOMMU related code behind #ifdef guards
The IOMMU implementation is not going to be verified at the moment, and so the code for
it needs to be hidden from verification, which we do by #ifdef'ing it out if the IOMMU
is not enabled. As a result the IOMMU configuration depends on a non verification target
2017-08-21 16:44:58 +10:00
Adrian Danis
8c8b53a5f7 pc99: Define PCI helpers in a pci header instead of iospace header
These helpers are generic PCI and are used outside of the iospace code
2017-08-21 16:44:58 +10:00
Hesham Almatary
57fa0e0f85 Share linker.h between architectures 2017-08-10 08:38:36 +10:00
Adrian Danis
ae9fe9b5d1 aarch64: Use tpidrro_el0 for IPC buffer instead of tpidr_el0
Changing the register used for the IPC buffer is useful as the standard TLS model for
aarch64 is to use tpidr_el0 for the thread pointer, which we are presently using
for the IPC buffer. This therefore paves the way for implementing proper TLS support
on aarch64.

Since we are not using tpidr_el0 for the IPC buffer we need to save/restore (or at
least clear) this register on thread switch to prevent it being a user channel. Saving
and restoring of it is achieved by ensuring CONFIG_IPC_BUF_TPIDRURW is not set, which
as we are no longer using this strategy this will be the case. To that end as aarch64
only has one IPC buffer strategy this commit makes the choice of IPC buffer strategy
dependeont on aarch32.
2017-08-07 22:52:46 +10:00
Adrian Danis
3b8c4cf5e1 aarch64: Implement writeTPIDRURO 2017-08-07 22:52:32 +10:00
Hesham Almatary
1d4cdde1a4 ARM/SMP: Guard FPU operations 2017-07-20 11:21:20 +10:00
Hesham Almatary
ee28936d48 SMP: Introduce ENABLE_SMP_SUPPORT
- Make it more readable and less confusing compared to the 'CONFIG_MAX_NUM_NODES > 1' check
2017-06-29 16:23:39 +10:00
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