Commit graph

3746 commits

Author SHA1 Message Date
Bamboo
21c1a2ca7a Release 12.1.0
Update VERSION
Update CHANGES

Signed-off-by: Damon Lee <Damon.Lee@data61.csiro.au>
2021-06-10 16:59:48 +10:00
Kent McLeod
7b0602c5f7 cmake: Apply KernelAArch64SErrorIgnore setting
KernelAArch64SErrorIgnore needs to be saved into the cache in
seL4Config.cmake if it is set by any platform's config.cmake.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-06-10 11:08:13 +10:00
Indan Zupancic
1d573487c9 ARM64: Add option to ignore SErrors
By default any SError interrupt will halt the kernel. SErrors
may be caused by e.g. writes to read-only device registers or
uncorrectable ECC errors.

When this option is enabled SErrors will be ignored.

Enable this option for the TX2 platform.

Signed-off-by: Indan Zupancic <Indan.Zupancic@mep-info.com>
2021-06-09 17:45:51 +10:00
Axel Heider
e1e26c7ef8 CMake: cleanup KernelSel4ArchArmHyp
Don't create CONFIG_ARCH_AARCH32 on every platform and architecture.
Remove KernelSel4ArmHypAarch32.

Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-06-09 09:51:07 +10:00
Axel Heider
9a4d3ae51d CMake/autoconf: remove unused AUTOCONF_INCLUDED
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-06-09 09:50:02 +10:00
Axel Heider
3f45ab38df use "#pragma once" include guard
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-06-09 09:50:02 +10:00
Damon Lee
db7bb41314 trivial: Extend !__ASSEMBLER__ preprocessor flag
The scheduler context flags enum should not be inside assembler-related
files.

Signed-off-by: Damon Lee <Damon.Lee@data61.csiro.au>
2021-06-02 12:46:01 +10:00
Ben Leslie
7dc6dffa0f Add support for iMX LP UART
Add support the i.MX low-power UART. This is available on
chipsets such as i.MX8QXP.

Note: This is a preliminary patch in advance of providing
full support for the i.MX8QXP platform.

Note: getchar is not implemented (current) for this platform.

Signed-off-by: Ben Leslie <benno@brkawy.com>
2021-06-02 11:43:48 +10:00
Ben Leslie
aee84c8cd1 Set KernelPaddrUserTop correctly on ARM platforms
On ARM platforms the code assumes the top phys addr is
exclusive, not inclusive (as is the case on other platforms).

While it would be good to make this consistent across platforms
that is a more invasive change. This simple fix makes the
confir correct for ARM. A more comprehensive consistency fix
can be applied at a later time.

Signed-off-by: Ben Leslie <benno@brkawy.com>
2021-06-02 11:39:46 +10:00
Kent McLeod
027a7c4a25 pc99: Remove PT_PHDR segment from linker script
This is to work around an issue in a variant of syslinux that treats a
PHDR segment as distinct from a PT_LOAD segment and rejects an ELF if
the two segments are overlapping.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-05-26 14:23:25 +10:00
Matthew Brecknell
72f323d961 arm: fix decodeARMMMUInvocation branch hint
A previous update added a disjunct to an `if` condition outside the
existing `unlikely` branch hint. This commit extends the hint to the
full `if` condition.

Signed-off-by: Matthew Brecknell <Matthew.Brecknell@data61.csiro.au>
2021-05-20 11:52:33 +10:00
Nick Spinale
7bb2717e41 arm-hyp: read inactive cntv_ctl from saved context
Like SCTLR, CNTV_CTL is switched to/from hardware when we enable/disable
the VCPU, so it must be read from a saved VCPU context when that VCPU
isn't active.

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2021-05-20 10:07:09 +10:00
Damon Lee
6477781221 trivial: Fix semicolon error and missing symbol
Signed-off-by: Damon Lee <Damon.Lee@data61.csiro.au>
2021-05-18 16:51:28 +10:00
Damon Lee
af82abe2ee ia32: Fix linker errors with capDL printing
Although the functions aren't implemented properly, this is a stop gap
issue to prevent the linker from raising problems about missing
references to various platform-specific capDL printing functions.

Signed-off-by: Damon Lee <Damon.Lee@data61.csiro.au>
2021-05-18 14:39:44 +10:00
Oliver Scott
baad619db3 risc-v: fix register bug
An aditional parameter for the dtb was added to the init_kernel
function call in the elfloader. The corresponding _start entry
in the kernel was never updated.

Signed-off-by: Oliver Scott <Oliver.Scott@data61.csiro.au>
2021-05-17 11:26:43 +10:00
Curtis Millar
2f35873885 mcs: Add debug assert to check scheduling correct
The scheduler cannot correctly schedule once the timestamp exceeds
MAX_RELEASE_TIME as releases beyond this point may be subject to
overflow. For most systems this should still allow a great many years if
the timestamp starts from 0 at system boot.

Some systems currently start with a random initial timestamp and my
begin with a timestamp that prvents correct budgeting. This assert helps
to catch cases where scheduling becomes invalid due to the timestamp
exceeding the give bound.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-05-17 10:06:58 +10:00
Curtis Millar
dd693a924c mcs: Refactor loop for easier verification
This refactor removes accesses to global state in the loop making
verification easier

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-05-17 10:06:58 +10:00
Curtis Millar
a2ec92a2fb Remove loop to ensure head refill not overlapping
The implementation currently never produces a case where the head might
overlap any subsequent refill as it now always effectively prepends when
merging refills at the head rather than appending.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-05-17 10:06:58 +10:00
Curtis Millar
dc959bad4d Default MAX_BUDGET_US to allow for system uptime
The proofs currently only guarantee that the system scheduler is correct
while the current time is less than INT64_MAX - 3 * MAX_PERIOD ticks.
With the MAX_PERIOD configured to almost INT64_MAX, this would imply
that the system scheduler is never correct.

To ensure that we get a large duration where the system is correct, we
take 1/8th of the TOTAL representable time as the MAX_PERIOD, ensuring
that 3 * MAX_PERIOD is still less than half of all representable time.
For a system with a 1MHz scheduling clock, this produces a valid
execution time on the order of 2^19 years.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-05-17 10:06:58 +10:00
Curtis Millar
263a2b95bb mcs: Account for overrun up to integer overflow
This re-introduces the overrun handling but bounds charging of budget
such that we never calculate a refill with a start using an integer
overflow.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-05-17 10:06:58 +10:00
Kent McLeod
e2ca0b6119 mcs: Remove refill_full check from checkBudget
A refill can still be charged if the refill list is full. This means
that we only require sufficient capacity to continue a timeslice.

Signed-off-by: Kent McLeod <kent@kry10.com>
Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-05-17 10:06:58 +10:00
Curtis Millar
4b519e8ccb mcs: Expand comments describing preemtion cases
When a task is preempted the head refill is partially charged. When it
is later resumed and again charged, the new charge will be added to the
refill created before the preemption resulting in only a single new
refill being created for each activation.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-05-17 10:06:58 +10:00
Curtis Millar
b7fbaae030 mcs: Refills are disjoint
We guarantee that all refills in an SC are disjoint.

We don't care about ordering or disjointness for round-robin SCs.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-05-17 10:06:58 +10:00
Curtis Millar
c5c4eae1f5 mcs: Use single function to charge budget to SC
This replaces the refill_split_check and refill_budget_check with a
single function that chanrges the provided usage to an SC and updates
the refills.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-05-17 10:06:58 +10:00
Curtis Millar
21b51e612b mcs: schedule_used merge cases
We only need to guarantee that the head refill is MIN_BUDGET so we allow
refills of any size.

We still merge overlapping refills and delay tail refills if there are
no more refills available.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-05-17 10:06:58 +10:00
Axel Heider
852b1e5007 Check start <= end for the last region also
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 20:43:20 +10:00
Axel Heider
e1fdbb8031 Add missing linebreak in printf()
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 20:43:20 +10:00
Axel Heider
5b1809c1d2 Add missing attribute BOOT_CODE
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 20:43:20 +10:00
Axel Heider
e6bb190034 Align location of BOOT_BSS section attribute
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 20:43:20 +10:00
Axel Heider
2ff49e9bd8 Fix typo and grammar in comment
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 20:43:20 +10:00
Alistair Francis
d49ab2ddde gcc.make: Add support for riscv64-elf- toolchain
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2021-05-14 15:59:18 +10:00
Axel Heider
2da1b3f74a state which conditional compilation block ends
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:34:38 +10:00
Axel Heider
c162608739 debug: use SEL4_PRIx_word
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:34:38 +10:00
Axel Heider
0117aafab9 support PRIu64 and SEL4_PRIu_word in kernel
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:34:38 +10:00
Axel Heider
4608941f38 debug: restructure kernel console handling
Remove the UART handling details from the top level I/O handling that
implements printf(). The architecture's I/O handling must define how
the debug channel is implemented and what special handling is
required. This allows separating UART and SBI debug output handling.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:13:36 +10:00
Axel Heider
753131af20 debug: pass buffer to printf() output channel
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:13:36 +10:00
Axel Heider
dbe04b117c debug: cleanup printing API implementation
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:13:36 +10:00
Axel Heider
f6cbca9014 debug: fix NULL output wrapper handling
It seems no kernel code uses the padding feature in the printf() format
string, so this NULL pointer dereferencing case has never been observed
anywhere practically. Furthermore, this code is not part of the formal
verification, so this step also could not catch this.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:13:36 +10:00
Axel Heider
12027cec76 debug: fix ksnprintf() corner case handling
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:13:36 +10:00
Axel Heider
a58eb4b6d0 debug: reduce printf() stack usage
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:13:36 +10:00
Axel Heider
b830fc2213 debug: use sizeof as function
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:13:36 +10:00
Axel Heider
b75ded657c define generic debug_capDL() function
Replace capDL() by a generic debug_capDL() where all architectures are
supposed to provide an implementation or print an error.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-05-14 13:03:39 +10:00
Kent McLeod
5f58ac7429 x86_64: Optimize boot image size
Go through the ELF file to look for large sections that are filled with
zeros and fixup any definitions to minimize them.

Also write more of the pc99 linker script to maintain alignments between
file offsets and address mappings.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-05-14 08:30:16 +10:00
Kent McLeod
176baac003 Use BOOT_BSS instead of BOOT_DATA where possible
For variables that don't have initial data can be BOOT_BSS and not take
up space in the ELF file.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-05-14 08:30:16 +10:00
Gerwin Klein
41497c6e60 Add MCS to the preprocess check
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-05-07 09:54:27 +10:00
Curtis Millar
00d6f4dfb2 mcs: Fix derefrence of scheduling context
Fix issues where scheduling context is dereferenced after it is removed
from the associated TCB.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-05-05 11:03:27 +10:00
Corey Lewis
455e5e1086 mcs: refactor the thread cap case of finaliseCap
While the new check is technically redundant, it is consistent with how
schedContext_completeYieldTo is called elsewhere and eases verification.

Signed-off-by: Corey Lewis <Corey.Lewis@data61.csiro.au>
2021-05-04 13:47:12 +10:00
Corey Lewis
e7eb2ae33e mcs: further refactor reply_pop
Signed-off-by: Corey Lewis <Corey.Lewis@data61.csiro.au>
2021-05-04 13:47:12 +10:00
Corey Lewis
72cdedc8d2 mcs: refactor reply_pop
This makes it have the same structure as reply_remove and is easier to
verify.

Signed-off-by: Corey Lewis <Corey.Lewis@data61.csiro.au>
2021-05-04 13:47:12 +10:00
Corey Lewis
dfbbac6ddc mcs: refactor reply_remove
This should have the same control flow and will be much easier to
verify.

Signed-off-by: Corey Lewis <Corey.Lewis@data61.csiro.au>
2021-05-04 13:47:12 +10:00