Commit graph

3313 commits

Author SHA1 Message Date
Siwei Zhuang
dadfb1b6f3 trivial: Bugfix, use the correct config macro
Use the correct config macro to enable code injection.
2020-02-12 12:36:57 +11:00
Luca(Wei) Chen
c06df578f2 ARM: Add support to flush L1 caches
Extend the existing seL4_BenchmarkFlushCaches without modifing the usage
of it. Will be used in sel4bench to measure the cold cache performance.
2020-02-11 11:23:04 +11:00
Curtis Millar
2d40b0d5df riscv32 does not support huge pages
For some reason the kernel documented and maintained constants for a
512MiB 'huge page' in riscv32 which is not part of the specification.

The references and constants are removed
2020-02-10 15:01:43 +11:00
Kent McLeod
2d362cb7c8 arm,SMP: Refactor irq_t structure for smp
Explicitly create a struct definition for irq_t on SMP Arm
configurations. This makes it a lot harder to mistakenly use the wrong
irq encoding when moving an irq between a cnode index and hardware irq
number / core. A couple areas where this was being handled incorrectly
was fixed as part of the refactor. When performing an ipi for masking
PPI interrupts, the idx encoding is used as it fits into a single word.
2020-02-05 13:56:48 +11:00
Kent McLeod
2cd80a8c7e Document internal machine/interrupt.h interface
Every platform has to implement a standard set of interrupt interfaces
that the kernel uses to interract with a machine's interrupt controller.
Providing a single header file for each of these functions provides a
single location to document their behavior.
2020-02-05 13:56:48 +11:00
Kent McLeod
94dcfce5c7 trivial: Remove duplicate function prototypes 2020-02-05 13:54:33 +11:00
Kent McLeod
4fb42436f7 trivial: Remove unused ipiBroadcast function 2020-02-05 13:54:33 +11:00
Curtis Millar
b2086f54e1 update non-mcs sabre clock
Both the private and global arm timers are clocked from the same source
and neither of the drivers apply a pre-scaler so the frequency should be
the same in both configurations.

The frequency of this clock is based on PLL1 which could potentially lie
anywhere in the range of 650MHz to 1.3GHz. The value determined for MCS
appears to correctly agree with the user-level timer which appears to be
correctly implemented.
2020-01-30 14:04:56 +11:00
Damon Lee
c1fbb27165 imx31: Add missing DTS entry for the EPIT2 timer
The DTS in the 'tools' directory is missing information about the EPIT2
timer. We add the entry into the corresponding overlay DTS file so that
the EPIT2 node will be included into the resulting DTB.
2020-01-29 12:09:32 +11:00
Curtis Millar
cc90574fc4 Fix MCS timer for KZM
The corrected user timer showed that the estimated value for the kernel
timer used in MCS was incorrect. It has been re-calculated on the fixed
user-level timer.
2020-01-29 09:56:02 +11:00
Curtis Millar
0ff7405eab Fix TX1 clock timer
According to the implementation of the user-level timer the primary
clock source (`m_clock`) can only be configured to 12MHz on TX1 and TK1
(see the comment in `libplatsupport` at
util_libs/libplatsupport/src/mach/nvidia/timer.c:213).

This should allow the TX1 to pass all MCS tests.
2020-01-22 15:08:12 +11:00
Victor Phan
0e62bc3a81 Move vcpu_switch into Arch_switchToThread
Currently the vcpu_switch function is called in the setVMRoot function
after possible early returns. In order to make sure the vcpu is
always switched, the call is moved into Arch_switchToThread before the
call to setVMRoot.
2020-01-20 14:10:28 +11:00
Nick Spinale
b45ca5cd71 aarch64: fix FAR_EL1 width in writeFAR
Fixes a bug where writeFAR was only writing to the low 32 bits of the
64-bit FAR_EL1 register.
2020-01-14 17:47:55 +11:00
Nick Spinale
a047e8d865 aarch64: fix MRS/MSR in writeELR_EL1
Fixes a bug where writeELR_EL1 was reading from ELR_EL1 instead of
writing to it.
2020-01-14 17:26:07 +11:00
G. Branden Robinson
49295a7b02 manual: improve discussion of Recv and Wait
...and other tweaks.

* Clarify the synonymy of Receive and Wait on non-MCS systems.

* Note that Receive takes a reply object on MCS systems, and not on
non-MCS systems.  Also note redundancy of Wait on non-MCS systems.

* Use the full English word "Receive" when the discussion is at the
conceptual level.  It still gets abbreviated in C context, where it also
receives the "seL4_" prefix.

* Try a little harder to explain what's the same and what's different
about a non-MCS "reply capability" and an MCS capability to a reply
object.

* Explain what MCS stands for at the beginning of the chapter.  In the
manual's current organisation, this precedes by a few paragraphs the
term's first occurrence.

* Recast language about things being "on the MCS kernel" in favour of
describing "MCS" and "non-MCS" _configurations_ of the kernel.  (We do
not refer to the "master" kernel in the manual--thankfully.)

* Correct doubled word "to to".

* Italicise "reply capability" to better distinguish it from the
(already italicised) "reply object".

* Add a TODO comment about hyphenation grief.
2020-01-10 16:52:05 +11:00
G. Branden Robinson
e36657f1c6 manual: rework introduction of system calls
* Recast language of introduction to system calls.
* Rearrange system calls to present them in a more pedagogically useful
  order.
* Add TODO comment for future manual organisation efforts.
2020-01-10 16:52:00 +11:00
Jimmy Brush
b4e529ab2c trivial: arm: Improve object method docs 2020-01-06 16:14:02 +11:00
Jimmy Brush
7b44ef9277 aarch64: Fix seL4_ARM_PageDirectory interface doc
It is passed a vspace cap not an upper page directory cap
2020-01-06 16:14:01 +11:00
Jesse Millwood
01cea266d9 RISCV: Added stdout-path to hifive dts
This sets the first UART as the stdout-path dts setting in the
"chosen" node in the HiFive device tree.

Change-Id: Icb6b9abf999bdd8a278df5a2ba73ad492af06a24
2019-12-23 12:18:34 -05:00
Kent McLeod
0de7fc11bf Revert "Cache FPU enable state on all platforms"
This reverts commit 186180cf30.
2019-12-19 17:18:35 +11:00
Kent McLeod
113a53b2c5 Revert "trivial: use global machine/fpu.h (arm)"
This reverts commit 89e53be40b.
2019-12-19 17:18:35 +11:00
Kent McLeod
8045f02ffe Revert "Ensure that FPU state enables fpu on aarch32"
This reverts commit 05391acdf4.
2019-12-19 17:18:34 +11:00
Edward Pierzchalski
c9701e3fe9 unify userSize type declarations
Other declarations of `userSize` give it the type `word_t`. Since proofs
use a mangled name that includes the type, giving `userSize` different
types at different locations occasionally breaks proofs.
2019-12-19 15:50:40 +11:00
Edward Pierzchalski
335b4497aa Make padding word-size independent
An unfortunate hack that lets us specify padding within one
`sizeof(seL4_Word)`-sized chunk of a struct, indpendently of the size of
a word.
2019-12-19 15:50:40 +11:00
Edward Pierzchalski
7054225e8f Name anonymous structs
Translation validation reports errors using the "real" struct type name
instead of the typedef name, so having anonymous structs makes debugging
translation validation harder.
2019-12-18 18:20:45 +11:00
Simon Shields
057d7f8933 rockpro64, bcm2837, qemu-arm-virt: specify NUM_PPI
This is needed to enable succesful compilation with SMP on.
Even though the bcm2837 doesn't (yet) support SMP, add the value
for completeness.
2019-12-16 14:29:05 +11:00
Simon Shields
0f61978058 hardware_gen: add elfloader CPUs output
outputs all CPUs described in the DT to the elfloader
header and also includes any devices in the seL4,elfoader-devices
property.
2019-12-16 14:29:05 +11:00
Curtis Millar
05391acdf4 Ensure that FPU state enables fpu on aarch32
When the FPU state is loaded from a thread for the first time the
uninitialised floating point exception register is 0 leading to the FPU
being disabled until an instruction fault occurs in that thread upon
re-entry.

Clearly, if we are loading the FPU state for a thread we want the FPU to
be enabled so we enable it whenever it is loaded.
2019-12-16 14:07:12 +11:00
Curtis Millar
89e53be40b trivial: use global machine/fpu.h (arm) 2019-12-16 14:07:09 +11:00
Curtis Millar
186180cf30 Cache FPU enable state on all platforms
This change broadens the caching of the FPU enable/disable bit from arm
to all platforms to ensure that on x86 time is not wasted on the
fastpath disabling or enabling an already disabled/enabled FPU.
2019-12-16 14:07:08 +11:00
Kent McLeod
5353995516 boot: Use extra_bi_size_bits for vreg size calc
The bootinfo extra size region is rounded up to a power of 2 size before
being mapped into the initial threads address space.  This wasn't being
handled correctly which lead to a situation where if the bootinfo
finishes on the last address of a page table but the extra region size
is not a power of 2 size then there won't be a page directory allocated
where one needs to be and the kernel would crash.
2019-12-13 20:39:19 +11:00
Kent McLeod
e97554e53f Fix calculate_extra_bi_size_bits implementation
This function returns the size_bits for an allocation covering the size
of the extra boot info region.

Previously it was incorrectly handling rounding up the result of CLZL.
2019-12-13 20:34:54 +11:00
Simon Shields
7eb4147e43 hardware_gen: add elfloader output
The elfloader is going to start using devices based on the device tree.
Add an output method for hardware_gen.py that generates header files
that the elfloader can use. Currently they contain an array of
"devices", where each device has a compatiblity string and a series of
regions (represented simply as the physical address of the region).

For now, the elfloader only uses the serial device specified by the
stdout-path property in the DTB.
2019-12-11 13:50:26 +11:00
Oliver Scott
32e31e3a01 trivial: remove beaglebone kernel timer prescaling
With the prescaler set the frequency would be 24MHZ/2.
In order to synchronise with the timer in platsupport for mcs,
both require a 24MHZ freq. Hence this commit turns prescaling
off in the kernel. Kernel timers should accurately timeout test
1 second now. Previously it was running too fast, around half a second.
2019-12-10 14:03:46 +11:00
maybe-sybr
ea4c8cb163 Fix style complaints in gcc.cmake
Unrelated to the rest of the changeset on this branch but a good
opportunity to make the code quality checks happy.
2019-12-06 09:44:57 +11:00
maybe-sybr
dc5b6b6a74 Add support for arm Xcompilers on Red Hat distros
This change introduces a `gcc` hunting helper function to `gcc.cmake` in
order to help us find an appropriately prefixed `gcc` for the target
being built for. We use this helper to find 32b ARM cross-compiling
`gcc`s for both Debian and Red Hat based distros.
2019-12-06 09:44:57 +11:00
maybe-sybr
735b154abb Use autoconf definition for RetypeMaxObjects def
Relates to #168. The definition for `seL4_UntypedRetypeMaxObjects` lives
in the UAPI `types.h` but appears to have no link to the value actually
used by the kernel, which is configurable. This change sets the UAPI
definition to the generated definition from the kernel config steps and
defaults to the previous fixed value if, for some reason, the configured
definition is not available.
2019-12-02 17:42:13 +11:00
G. Branden Robinson
4ef43d507c CHANGES: improve introduction
Recast introductory paragraphs to better describe the document and
characterise the intended audience.

Move information intended for document maintainers and kernel engineers
to a comment.  Add guidance for engineers so they better know when and
how to update this document.  (Thanks to Kent for the discussion!)

The `docs/sel4_release` page is not a set of release notes per se, more
like a feature grid and release history; describe it differently.

Style document title as a top-level heading.
2019-11-29 17:01:59 +11:00
Curtis Millar
04e51d402a Revert the recent changes to Faster FPU switch
These changes need to be reverted until we can properly test the changes
with all of our hardware online (currently we cannot test on x86
hardware).

This reverts commit a0aeec3b304d16909619bc847197df221c73a0c4.
This reverts commit af0fdc82c23f1e7e3f1e568f6987f5afd0d2150a.
This reverts commit a190a14ecaae688a6b40dd0a699b8f49c2c0631e.
2019-11-28 17:27:20 +11:00
Curtis Millar
7e0cec6f8f Ensure that FPU state enables fpu on aarch32
When the FPU state is loaded from a thread for the first time the
uninitialised floating point exception register is 0 leading to the FPU
being disabled until an instruction fault occurs in that thread upon
re-entry.

Clearly, if we are loading the FPU state for a thread we want the FPU to
be enabled so we enable it whenever it is loaded.
2019-11-27 14:09:12 +11:00
Curtis Millar
6d90e0c0d8 trivial: use global machine/fpu.h (arm) 2019-11-27 14:09:12 +11:00
Curtis Millar
e9b90f9f1c Cache FPU enable state on all platforms
This change broadens the caching of the FPU enable/disable bit from arm
to all platforms to ensure that on x86 time is not wasted on the
fastpath disabling or enabling an already disabled/enabled FPU.
2019-11-27 14:09:11 +11:00
Siwei Zhuang
249bcdab63 riscv: Add support for Rocketchip SoC
Support Rocketchip SoC maps to Xilinx ZC706 board and ZCU102 board
2019-11-26 18:34:50 +11:00
Siwei Zhuang
0d1814e5a8 riscv: Only hifive platform has kernel device
Hifive is the only platform that supports kernel devices currently.
2019-11-26 17:15:27 +11:00
Siwei Zhuang
0d93997463 ariane: Remove unused dts overlay
Ariane platform doesn't have any kernel devices. But the DTS parser
doesn't accept empty properties. Removing it completely to avoid DTS
parsing error.
2019-11-26 16:10:21 +11:00
Kent McLeod
4d21d40b1e gcc.cmake: Add option for coloured gcc output
Setting the environment variable GCC_COLORS or CMake option
FORCE_COLORED_OUTPUT will cause GCC's colour messages to be outputted.
2019-11-26 08:58:34 +11:00
Kent McLeod
60ffdb1f0a trivial: Fix x86 KERNEL_TIMER_IRQ definition
This was using the hardware irq number instead of the irq number seL4
uses. This change affects MCS preemption point handling.
2019-11-26 08:49:46 +11:00
Victor Phan
cdbae0b3b2 riscv: update page table level numberings
The numberings are changed from 1,2,... to 0,1,...
2019-11-22 12:21:09 +11:00
Victor Phan
66bc2b1724 rename KDEV_PPTR/PPTR_KDEV to KDEV_BASE
This is the virtual address for the start of the kernel device mapping
region.
2019-11-21 15:53:11 +11:00
Bamboo
e5a986af0c Update VERSION file to 11.0.0-dev 2019-11-20 18:17:11 +11:00