Commit graph

612 commits

Author SHA1 Message Date
Kent McLeod
2317b402a8 libsel4: Add __ASSEMBLER__ guards in .h files
Additional header files may now be included in non-C contexts and so we
need to guard some C definitions with the __ASSEMBLER__ guards
convention.

Signed-off-by: Kent McLeod <kent@kry10.com>
2023-08-12 08:32:20 +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
Kent McLeod
cb8ee83f0c aarch64,vspace: Remove pud cap type
Now the vspace_cap is used for all vspace roots and all other page
tables are referred to by page table caps.

Signed-off-by: Kent McLeod <kent@kry10.com>
2023-08-10 08:20:22 +10:00
Kent McLeod
b3cc852425 aarch64,vspace: Remove page_directory captype
The page_table cap is used in it's place.

Signed-off-by: Kent McLeod <kent@kry10.com>
2023-08-10 08:20:22 +10:00
Kent McLeod
7fec9bc9e9 Add CONFIG_X86_64_VTX_64BIT_GUESTS guards
Guard the new implementation of 64-bit x86 guests behind a config
option. This is done so that existing projects that use x86_64 hosts
with ia32-bit guests can continue to be supported until either the old
feature is preferred to be deprecated, or support can be added to
support both simmultaneously.

Signed-off-by: Kent McLeod <kent@kry10.com>
2023-06-06 13:29:34 +10:00
Chris Guikema
2dbd1b818a 64-bit-vms: Add kernel support for 64-bit VMs
This commit combines a number of smaller commits which do the following:

    * Enter IA-32e mode when running a 64-bit host
    * Handle additional general purpose registers in 64-bit mode
    * Handle 64-bit specific MSR events
    * Properly save and restore FS, GS, and Shadow GS registers

CCDC-GVSC DISTRIBUTION A.  Approved for public release; distribution
unlimited. OPSEC#4481.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-06-06 13:29:34 +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
8eec7ad207 python: include sel4/config.h and not autoconf.h
Include sel4/config.h instead of autoconf.h in the generated code.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2023-04-24 23:02:12 +10:00
Gerwin Klein
57c46bc8d0 bitfield_gen: comment for original source file
Add a `--form_file <file>` option to the bitfield generator for
printing a `/* generated from <file> */` message in a comment.

Use this option in cmake to provide the original source .bf file before
preprocessing so it's easier to find out where the corresponding
definitions are.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2023-04-10 15:46:00 +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
Nick Spinale
b291e943e5 libsel4: expose .pbf files
To enable access by external tools.

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2023-03-01 09:42:58 +11:00
Klim Tsoutsman
d90fada8b3 libsel4: update seL4_NBWait attributes
Currently, building `libsel4` as a static library with `KernelIsMCS`
enabled fails with the following error:

```
static declaration of 'seL4_NBWait' follows non-static declaration
```

This [was mentioned][1] in the original PR that modified exported
functions to use `LIBSEL4_INLINE_FUNC`.

[1]: https://github.com/seL4/seL4/pull/101#issuecomment-442010551

Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
2023-01-17 09:08:07 +11:00
Peter S. Housel
8ca4a87c9a Add Quartz64 support
This adds support for the Pine64 Quartz64 and other devices based on
the Rockchip RK3566. The platform support is adapted from the
Rockpro64 code, except that the RK356x has A55 cores, and adjusting
for the fact that the ARM Generic Timer is the only on-chip timer
available.

Signed-off-by: Peter S. Housel <housel@acm.org>
2022-11-21 16:43:20 +11:00
Axel Heider
548a81a057 riscv: support qemu-riscv-virt platform
Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-11-13 11:53:54 +11:00
Axel Heider
1d19d9f576 qemu-arm-virt: add more supported CPUs
Also reject any unknown CPU.

Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
2022-11-13 11:53:54 +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
Jimmy Brush
b316072daa x64: fix sysenter syscalls
The MCS-related macros were causing the build to fail when configured to
use the sysenter instruction. Additionally, some message registers
weren't explicitly being passed to the assembly block for
seL4_NBSendRecv in this configuration.

Signed-off-by: Jimmy Brush <code@jimmah.com>
2022-05-23 14:22:04 +10:00
Ivan Velickovic
8fad907adc docs: clarify arch_flags in TCB register syscalls
For writing/reading/copying TCB registers, the
arch_flags parameter is not used on RISC-V (in
addition to x86 and ARM).

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2022-05-19 19:09:47 +10:00
Stephen Williams
55fde27e10 Add support for the Avnet MaaXBoard
Signed-off-by: Mark Jenkinson <mark.jenkinson@capgemini.com>
Co-Authored-By: Stephen Williams <stephen.williams@capgemini.com>
2022-05-11 17:31:07 +10:00
Kent McLeod
8e227395a0 aarch64: Remove reserved VSpace slots from API
Now that there is no need to reserve page table entries in each VSpace
object, the full architecture specified address space range is usable.

Signed-off-by: Kent McLeod <kent@kry10.com>
2022-03-24 20:26:15 +11:00
Axel Heider
83a02a96fc python: use '#paragma once' include guard
Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-03-23 17:28:07 +11:00
matt rice
97610e1249 xml: remove condition attribute
Signed-off-by: matt rice <ratmice@gmail.com>
2022-03-22 18:33:38 +11:00
matt rice
311d4a0a34 libsel4/tools: use condition element
Signed-off-by: matt rice <ratmice@gmail.com>
2022-03-22 18:33:38 +11:00
matt rice
accccf3dbb add condition elem, test it against condition attr
Signed-off-by: matt rice <ratmice@gmail.com>
2022-03-22 18:33:38 +11:00
matt rice
6bc6b31816 add optional condition element to xsd
The condition element currently exists parallel
to the condition attribute.  The condition attribute
should be removed in a subsequent patch.

Signed-off-by: matt rice <ratmice@gmail.com>
2022-03-22 18:33:38 +11:00
matt rice
b0d70f1ebc add libsel4/tools/sel4_idl.xsd to replace dtd
No intended changes to the schema, just change
the schema from dtd to xsd, and update ci to use it.

Signed-off-by: matt rice <ratmice@gmail.com>
2022-03-22 18:33:38 +11:00
matt rice
a961f9e46c Some more dtd simplifications
Allow 0 or 1 description and 0 or more errors.

Signed-off-by: matt rice <ratmice@gmail.com>
2022-02-07 13:36:04 +11:00
matt rice
5a39ae3f81 remove usage of ANY in dtd
This patch restricts mixed-content elements from ANY
to the various leaf nodes which are used.

This is intended to allow for easier parsing in languages with
no recursive datatypes like rust.
Since they no longer have to handle things like
'<description> text
   <description>more text</description>
<description>'

which the dtd allowed for, but never used.

tested with:

for i in {libsel4/arch_include/*/interfaces/,\
libsel4/include/interfaces/,\
libsel4/sel4_arch_include/*/interfaces}/*.xml;
do
     xmllint --noout --dtdvalid libsel4/tools/sel4_idl.dtd $i;
done

Signed-off-by: matt rice <ratmice@gmail.com>
2022-02-07 13:36:04 +11:00
Wojciech Sipak
19f0fea91d add Rust support in stub generator
This adds an alternative script for syscall_stub_gen.py
syscall_stub_gen_rs.py was initially derived from Robigalia project
which can be found here: https://gitlab.com/robigalia/sel4-sys
However, this is no longer compatible.

The script is intended to be used with a proper sel4-sys crate
in order to allow Rust applications to interface with the seL4 API.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
Signed-off-by: Karol Gugala <kgugala@antmicro.com>
2022-02-04 23:02:35 +11:00
Kent McLeod
abeba041f6 libsel4,ia32: Add missing comma to asm statement
Fixes a syntax error on libsel4 on ia32 with position independent code
compilation options.

Signed-off-by: Kent McLeod <kent@kry10.com>
2022-01-31 09:56:26 +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
Axel Heider
649b63d32f align conditional syntax in xml
Use the same style everywhere to simplify parsing.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-01-19 09:32:01 +11:00
Axel Heider
d9196f27d9 trivial: remove trailing whitespaces
Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-01-19 09:32:01 +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
Axel Heider
dae3d25ae3 risc-v: remove unused file bootinfo.h
Signed-off-by: Axel Heider <axelheider@gmx.de>
2022-01-04 19:07:06 +11:00
Gerwin Klein
f94888a688 libsel4: adjust asm immediate syntax for clang
Commit 8035f1a7c4 removed "-fno-integrated-as" for llvm, which on more
recent versions (clang-11) means that we now need `#` instead of `$`
for immediate values.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-12-09 11:09:50 +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
Axel Heider
d278b68ee2 align include guards for seL4_DebugSendIPI()
Align the API wrapper guards with the kernel syscall implementation,
the function is available if CONFIG_ENABLE_SMP_SUPPORT is set instead
of depending on CONFIG_MAX_NUM_NODES.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-11-30 10:02:54 +11:00
Axel Heider
edbc81eba4 consolidate arm core specific constants
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-11-30 09:10:16 +11:00
Kent McLeod
f5c60239c1 qemu-arm-virt: Add KernelUserTop option on aarch32
32-bit architectures have to share a small 4GiB address space between
privileged and non-privileged modes. Picking the address to split the
address space at affects how much virtual memory userlevel can use, and
how much physical memory the kernel can turn into untypeds. This is
something that should be configurable policy as different divisions make
sense for different applications.  For now we only add the config
option to qemu-arm-virt to try it out before potentially adding it to
all 32-bit platforms.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-10-28 08:29:29 +11:00
Axel Heider
ed39a40457 arm/zynqmp: fix comment about arm core
ZnyqMP uses Cortex-A53 not an A57.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-10-27 17:17:17 +11:00
Axel Heider
7337b515eb arm/bcm2711: remove check for HAVE_AUTOCONF
HAVE_AUTOCONF is always set nowadays, checks are deprecated.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-10-27 17:17:17 +11:00
Kent McLeod
6c3bde8fd8 imx8mm-evk: Don't use symlink for constants.h
Not using a symlink means that ninja install now works for this
platform.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-10-26 09:31:12 +11:00
Gerwin Klein
51d3b824b8 manual: fix explanation of CNode_Mutate
Mutate cannot be used to badge endpoints (many years ago, before the
first public release, this was possible, but was removed).

Also explain why Mutate is not always replaceable with Mint+Delete.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-19 15:50:47 +11:00
Gerwin Klein
526206aabe libsel4 idl: error conditions of SchedContext bind
Add error conditions for the lazy bind of SchedContexts to
notifications or TCBs (introduced in e18e32e28e).

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-10-18 18:08:32 +11:00