Commit graph

182 commits

Author SHA1 Message Date
Axel Heider
a58480425c make SMP conditional check more general
Check for CONFIG_ENABLE_SMP_SUPPORT instead of checking for the
number in CONFIG_MAX_NUM_NODES. This allows enabling SMP support
with just one node also.

Signed-off-by: Axel Heider <axel.heider@codasip.com>
2024-04-11 09:20:00 +01:00
Birgit Brecknell
f6656e2c78 Add a glossary to the manual
Add a glossary with seL4-specific terms and their
definitions.
Remove chapter number from bibliography
Tweak Makefile for glossary

Signed-off-by: Birgit Brecknell <bbrcknl@gmail.com>
2024-03-20 14:54:06 +11:00
Nick Spinale
9bac64c6ce libsel4: Eliminate unnamed enums
Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-02-08 15:34:14 +11:00
bbrcknl
cbf25791b7
make method names consistent (#1144)
* make method names consistent; delete duplicates

Signed-off-by: Birg <bbrcknl@github.com>
2024-01-19 14:25:02 +11:00
Birg
391bfb15f8 update some manual todos
Signed-off-by: Birg <bbrcknl@github.com>
2023-11-29 10:21:32 +00:00
Axel Heider
7d93471e9c debug: use c99 standard instead of gcc extensions
Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-11-16 12:09:52 +00:00
Alex Pavey
e62bc9bba3 smc_cap: Add SMC Capability with Call method
See PR at https://github.com/seL4/seL4/pull/701

Signed-off-by: Robbie VanVossen <robert.vanvossen@dornerworks.com>
2023-08-27 11:44:51 +10:00
Axel Heider
b8c0b1cb02 boot: introduce seL4_BootInfoFrameSize
Provide seL4_BootInfoFrameSize (and seL4_BootInfoFrameBits) for
userland, to there is no longer a need to hard-code the 4 KiByte
assumption.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-08-23 15:10:32 +02:00
Robbie VanVossen
e25d9c90e1 libsel4: Make bootinfo consistent
Some slot positions in the rootnode would depend on configuration.
However that makes it difficult to add new root caps, especially if
multiple caps only exist based on configuration. Make all caps always
there, but null if not configured.

Signed-off-by: Robbie VanVossen <robert.vanvossen@dornerworks.com>
2023-08-12 14:41:52 +10:00
Gerwin Klein
35c41a822f macros: avoid breaking C subset
__builtin_offsetof is not part of the verification C subset -- avoid
accidental use by not declaring a macro for it and filter out the
single use by explicitly marking it as invisible to verification.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-05-31 14:55:57 +10:00
Axel Heider
4d1da1002b libsel4: use sel4/config.h instead of autoconf.h
Make sel4/config.h the only file to eventually include autoconf.h

Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-04-24 23:02:12 +10:00
Axel Heider
675604e3b6 add compile assert for seL4_UntypedDesc size
This header file is shared by kernel and userland. We can control the
kernel compiler setting, but userland might use an arbitrary setup.
Put a safeguard in place that things works as expected.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-03-28 13:34:35 +11:00
Gerwin Klein
ecbeacb3ab constants.h: explain seL4_CoreSchedContextBytes
The "excluding extra refills" was confusing. seL4_CoreSchedContextBytes
is the size of sched_context_t + minimum refills, excluding any extra
refills.

We'd write it that way, but sched_context_t is not in scope in this
file.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-03-06 21:54:08 +11:00
Michael McInerney
bb6a00ffe2 mcs: correct MinSchedContextBits
This also adds a compile assert for checking that MinSchedContextBits
is the correct size in relation to seL4_CoreSchedContextBytes.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
2022-11-04 13:39:02 +11:00
Axel Heider
6e1bb9d2a8 cleanup deprecated.h header files
Add a comment that they are empty on purpose. They are not removed to
keep the infrastructure in case there will be deprecated items in the
future.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-10-04 10:48:50 +11:00
Axel Heider
481ce9d5ed remove deprecated header files
Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-10-04 10:48:50 +11:00
Axel Heider
0218cf086d simplify macro seL4_CompileTimeAssert()
Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-01-24 22:24:03 +11:00
Gerwin Klein
0cd8906dd7
keep seL4_Word for seL4_BootInfoID (#739)
This reverts a small part of 1596aa5857 which unexpectedly broke the
binary verification frontend, because the verification tool chain
forces the enum to `int` instead of `long`.

See also seL4 issue #738 -- when that issue is solved, we may be
able to go back to the more specific type.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2022-01-08 09:24:28 +11:00
Axel Heider
1596aa5857
use enum for SEL4_BOOTINFO_HEADER_xxx (#724)
* use enum for SEL4_BOOTINFO_HEADER_xxx

Also add more comments and use seL4_BootInfoID in seL4_BootInfoHeader.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-01-06 08:45:47 +11:00
Kent McLeod
ac32eba15d Remove userError from seL4_ReplyRecv path
Remove a userError that is present on mainline kernel but not on MCS.

seL4_ReplyRecv is often used in a loop to create an event handler. When
first entering this loop, or when handling signals from notifications,
there won't already be a pending caller blocked on the reply object. In
this case the kernel doesn't perform a reply transfer and continues with
the receive operation. This is a common operation and shouldn't result
in a userError being printed by the kernel each time the reply phase
ends up as a no-op.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-11-30 15:24:15 +11:00
Kent McLeod
87f5992d12 libsel4: def. CONFIG_KERNEL_LOG_BUFFER in autoconf
Define CONFIG_KERNEL_LOG_BUFFER in the same way as all other kernel
config options so that it is present in autoconf.h

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-09-06 08:08:54 +10:00
Kent McLeod
c7d5bb0ed4 libsel4: Fix name for AARCH64_VSPACE_S2_START_L1
CONFIG_AARCH64_VSPACE_S2_START_L1 has the correct namespace for a kernel
config option.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-09-06 08:08:54 +10:00
Kent McLeod
b6de9db07a libsel4: Fix Config name for ENABLE_SMP_SUPPORT
CONFIG_ENABLE_SMP_SUPPORT has the correct namespace for a kernel config
option.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-09-06 08:08:54 +10:00
Kent McLeod
1d2a588bbf libsel4,config.h: Remove misleading #defines
autoconf.h is expected to contain all defined config options for an seL4
build configuration. Having these redefinitions were leftover from when
the verification build system didn't produce an autoconf.h file and set
the config separately.  Its more likely that these defaults would
incorrectly hide an include path misconfiguration and produce settings
that are inconsistent with the kernel's configuration.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-09-06 08:08:54 +10:00
Axel Heider
4138e7e595 macros: avoid compiler warning for helper type
Avoid a warning if GCC parameter '-Wno-unused-local-typedefs' is used.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-01 10:48:47 +10:00
Axel Heider
8ecf358ba2 macros: improve SEL4_COMPILE_ASSERT
- Add underscored in name to improve readability.
- Add brackets to ensure parameters are atoms
- add comment clarifying c99 usage

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-01 10:48:47 +10:00
Axel Heider
a16324a588 trivial: move macro definition
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-01 10:48:47 +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
Axel Heider
d486a16961 allow specific printf() formatting for seL4_Word
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-04-21 14:55:50 +10:00
Curtis Millar
afbea15710 mcs: Add sporadic flag to SchedControl_Configure
This adds a flags parameter to SchedControl_Configure to enable
configuration of a sporadic SC.

This also allows flags to be added in the future as needed without
breaking the API.

This allows the user to configure an SC either to be constrained as a
sporadic task where accumulated time is only delayed to when a task has
become runnable (implementing the sporadic server algorithm) or
whenever the task becomes the current executing task (implementing the
sliding-window constraint as in constant-bandwidth servers).

This can be used to prevent non-realtime tasks from exceeding bandwidth
under any circumstances, even in an over-committed configuration, whilst
also allowing work-conserving tasks to be configured in the same system.

To implement sporadic servers, we need to ensure that the suspension of
a task cannot be used as a mechanism to amplify budget of a task by
granting that task access to effectively multiple periods worth of
replenishments within a single period.

To align the implementation of SCs with the model of sporadic servers we
must delay available time until the release of a task. Within seL4, a
release would be any time where an SC changes from not being associated
with a Running, RunningVM, or Restart thread to one that is.

This can occur when an SC is bound to a new thread in such a state or
when a thread changes to such a state from any non-running states.

Critically, replenishments should not be delayed at the point when an SC
becomes the current SC (as was the case prior to this commit). This has
the effect of enforcing a continuous, constant bandwidth which is a
restriction that is incompatible with standard scheduling logic.

Accounting for this requires inserting a new refill_unblock_check
call whenever a sporadic SC is unblocked and removing the
refill_unblock_check call from when said SC is scheduled.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2021-04-14 15:24:40 +10:00
Axel Heider
e4256d48fa libsel4: unify seL4 type definitions
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-04-06 16:15:01 +10:00
Axel Heider
7e1047af05 libsel4: add printf format specifier PRI_sel4_word
This provides a generic way to print an seL4_Word on 32-bit and 64-bit
platforms, aligned with PRIu64 and friends. Use it as:
printf("foo = %" PRI_sel4_word "\n", (seL4_Word)foo);

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-04-01 10:33:41 +10:00
Axel Heider
e7268f92db libsel4: check constants against types
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-04-01 10:33:41 +10:00
Axel Heider
11c435b803 libsel4: unify definitions in simple_types.h
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-04-01 10:33:41 +10:00
Axel Heider
02afe87a55 libsel4: use _Static_assert() if available
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-04-01 10:33:41 +10:00
Axel Heider
c3a2a87e42 libsel4: cleanup macros.h
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-04-01 10:33:41 +10:00
Axel Heider
e86364c975 libsel4: add missing macros.h include
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-04-01 10:33:41 +10:00
Axel Heider
ffa5c74666 libsel4: remove HAVE_AUTOCONF
Today the file autoconf.h is created by the CMake build system and thus
HAVE_AUTOCONF is always defined. Time to get rid of some legacy by
removing the check if HAVE_AUTOCONF is set.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-04-01 10:33:41 +10:00
Axel Heider
73bde900b1 trivial: remove empty lines
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-04-01 10:33:41 +10:00
Kent McLeod
4bd4bbac13 Remove HAVE_AUTOCONF guard in sel4/config.h
This option was legacy from when autoconf.h wasn't always present in the
include path. Now it causes incorrect configuration options.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-03-08 14:39:27 +11:00
Axel Heider
800b2444a1 trivial: style and formatting
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-03-03 11:47:23 +01:00
Kent McLeod
e798f0e7b0 libsel4: Remove weak def of __sel4_ipc_buffer
This symbol definition leads to an additional thread local storage
allocation for each object file that includes this header file. Then
when the final executable is linked, the weak symbol references are all
replaced by the global symbol declared by libsel4 in sel4_bootinfo.c.
The net result is unnecessarily large thread local storage being
required for each thread.

Signed-off-by: Kent McLeod <kent@kry10.com>
2020-12-08 09:56:49 +11:00
Curtis Millar
1ce721b418
Move config header to libsel4
This makes the kernel configuration defaults public and known to the
user level. Generally shouldn't depend on these definitions outside of
code testing and benchmarking the kernel.

Signed-off-by: Curtis Millar <curtis@curtism.me>
2020-11-10 16:24:44 +11:00
Oliver Scott
c66d9cee7a trivial: style and comment
Signed-off-by: Oliver Scott <Oliver.Scott@data61.csiro.au>
2020-10-28 17:30:42 +11:00
Qian Ge
7316bfc676 SMMU: providing master control caps to root task
Adding the master control caps that are used to create transaction
and context banks caps. This commit includes the internal kernel
structure that required to manage any created transaction and
context bank caps.

Signed-off-by: Oliver Scott <Oliver.Scott@data61.csiro.au>
2020-10-28 17:30:42 +11:00
Curtis Millar
40edd02c22 trivial: Use correct configuration for TLS base
Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2020-10-12 15:21:43 +11:00
Gerwin Klein
5c1b81d9bb libsel4: fix license tags
These files should have been released under BSD-2-Clause in the first
place (as per parent LICENSE.md file).

Closes #245

Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
2020-09-04 20:30:01 +08:00
Stefan O'Rear
5a341610c4 Do not generate data symbols for enums
With clang 11 these become bss symbols rather than commons, resulting in
multiple definition errors at link time.  gcc 10 is likely to expose the
same issue.

Signed-off-by: Stefan O'Rear <sorear@fastmail.com>
2020-08-26 12:48:00 +10:00
Kent McLeod
e1f6cf0ab0 Add 2 new benchmark utilization syscalls
- seL4_BenchmarkDumpAllThreadsUtilisation: Prints a JSON formatted
record of total and per-thread utilisation statistics about the system.
This currently includes a thread's total cycles scheduled, total number
of times scheduled, total cycles spent in the kernel and total number of
times entering the kernel and then totals of each for all threads on the
current core.
- seL4_BenchmarkResetAllThreadsUtilisation: Resets the current counts of
every user thread on the current core.

These syscalls are only available in a Debug build configuration as they
use a kernel debug list of all of the threads that exist for a given
node.

Signed-off-by: Kent McLeod <Kent.Mcleod@data61.csiro.au>
2020-07-15 15:15:27 +10:00
Kent McLeod
88a7d138c4 KernelBenchmarksTrackUtilisation: Add more stats
For each thread also track number of times scheduled, number of kernel
entries and amount of cycles spent inside the kernel.  Also add
core-wide totals for each.

Signed-off-by: Kent McLeod <Kent.Mcleod@data61.csiro.au>
2020-07-15 15:15:27 +10:00