Commit graph

249 commits

Author SHA1 Message Date
Julia Vassiliki
b57b3de195 libsel4: export seL4_IOPageTable{Index,Entry}Bits
Some checks failed
Compile / kernel (push) Has been cancelled
C Parser / C Parser (push) Has been cancelled
RefMan / Build PDF (push) Has been cancelled
Proof Sync / Code Freeze (push) Has been cancelled
CI / Checks (push) Has been cancelled
Deploy / Freeze Code (push) Has been cancelled
Deploy / Build Matrix (push) Has been cancelled
Trigger / Repository Dispatch (push) Has been cancelled
Proof Sync / Preprocess (push) Has been cancelled
Proof Sync / Preprocess (MCS) (push) Has been cancelled
Proof Sync / Deploy manifest (push) Has been cancelled
Proof Sync / Deploy MCS manifest (push) Has been cancelled
Deploy / Simulation (push) Has been cancelled
Deploy / HW Build (push) Has been cancelled
Deploy / Matrix (push) Has been cancelled
Deploy / HW Run (push) Has been cancelled
Deploy / Deploy manifest (push) Has been cancelled
This is useful for all x86 IOMMU work, which otherwise has
to duplicate the definitions of VTD_PT_INDEX_BITS in userspace
code. Follow the same pattern as many other existing code in
the libsel4 headers where the kernel depends on it.

Note we can't define seL4_IOPageTableBits in terms of Index + Entry
because the capDL tool does the c-preprocessor to make a YAML file
containing the constant, and it won't do evaluation.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
2026-07-08 16:33:54 +10:00
Julia Vassiliki
c8526a426f libsel4: deprecate old seL4_UserTop constant
This value was inconsistent across platforms, and one
should use seL4_UserVSpaceTop instead.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
2026-07-01 10:57:37 +10:00
Julia Vassiliki
dbc3da9d97 libsel4: add new seL4_UserVSpaceTop constant
This is a consistent, inclusive-top value that is conveying
similar information to that of seL4_UserTop. We are adding
this so as to not break existing userspace, but it will make
it easier for userspace to deal with other platforms.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
2026-07-01 10:57:37 +10:00
Indan Zupancic
f2ab32d203 Debug, x86: Fix seL4_DebugGetThreadAffinity
Currently causes compile errors. It should match seL4_DebugCapIdentify,
except return affinity instead of cap type.

Signed-off-by: Indan Zupancic <indan@nul.nu>
2026-06-23 08:27:38 +10:00
Julia Vassiliki
90b5159800 debug: add get thread affinity syscall
This is useful for sel4test et al for testing that a certain
PD has been succesfully migrated between cores, or that it
is running on a particular core.

Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
2026-06-22 18:06:26 +10:00
Gerwin Klein
c962e51e3b constants: decrease TCB_SIZE_BITS for some configs
The IPC queue changes for MCS in commit 771c9e43ce has decreased the
TCB size slightly, which brings TCB_SIZE_BITS down for config
combinations that have MCS + SMP + HYP + benchmarking enabled.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2026-05-22 13:31:04 +01:00
Ivan Velickovic
11c5d50527 Fix TCB size for SMP + benchmark config
In the definition of tcb_t, there's extra fields if there's
SMP or BENCHMARK_TRACK_UTILISATION or ARM_HYPERIVSOR_SUPPORT.
It looks like the combination of all three (which Microkit uses)
is not enough for 11 bits.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2025-11-24 17:03:56 +10:00
julia
1dde1fcb27 aarch64,vspace: deprecated PUD/PGD typedefs
This was missed in cb8ee83f0cd2268b1d6b1cd5ca30b031db5896c4; their
use was removed from syscall_stub_gen but their typedefs remained.

Signed-off-by: julia <git.ts@trainwit.ch>
2025-08-01 11:30:40 +01:00
julia
eca86cff19 treewide: typo fixes
Signed-off-by: julia <git.ts@trainwit.ch>
2025-04-14 12:05:16 +10:00
Ryan Barry
9fe04a250b aarch32/vcpu: save and restore CNTKCTL
Save and restore the CNTKCTL register alongside other virtual timer
registers when switching VCPUs.

Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2025-03-18 10:55:48 +11:00
Ryan Barry
f02bc94db8 arm: add vcpu save/restore reg range constants
This introduces two new constants to the vcpu reg enum, with the goal of
unifying reg range saves/restores and making explicit which registers
are affected.

Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2025-03-13 09:46:12 +11:00
Ryan Barry
8e18a0b558 aarch64: avoid saving CPACR to a disabled VCPU
seL4_VCPUReg_CPACR was sometimes saved to an inactive current VCPU,
overwriting the previous value and erroneously enabling FPU access.

Signed-off-by: Ryan Barry <ryan.barry@proofcraft.systems>
2025-03-13 09:46:12 +11:00
Ivan Velickovic
85aa104eb4 Fix TCB size on RISC-V 32-bit when FPU is enabled
This configuration is not in CI (hence why it lead to
a build error in the first place) so I just tested
it locally via sel4test with:

```
../init-build.sh -DPLATFORM=qemu-riscv-virt \
                 -DMCS=1 -DKernelRiscvExtD=1 \
                 -DKernelRiscvExtF=1 -DRISCV32=1
```

and it passed.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-09-16 12:31:52 +01:00
Alwin Joshy
1253115999 hw debug api: aarch64 port
Adding support for the hardware debug API to
aarch64.

Signed-off-by: Alwin Joshy <joshyalwin@gmail.com>
2024-07-18 16:09:52 +10:00
Nick Spinale
a3f6be3c7c libsel4: add links in place of renamed XML files
This commit's parent renames the interface XML files.

The symlinks added in this commit serve to ease the transition to the
new names for downstream projects.

These links are added:

- include/interfaces/{sel4.xml -> object-api.xml}
- arch_include/*/interfaces/{sel4arch.xml -> object-api-arch.xml}
- sel4_arch_include/*/interfaces/{
    sel4arch.xml -> object-api-sel4-arch.xml
  }

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-30 18:28:12 +10:00
Nick Spinale
58fac368f3 trivial: Fix XML style
Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-30 18:28:12 +10:00
Nick Spinale
dbd6efc507 libsel4: rename interface XML files
Before, some object API XML files conflicted when the include,
arch_include, and sel4_arch_include directories were combined:

- include/interfaces/sel4.xml
- arch_include/*/interfaces/sel4arch.xml
- sel4_arch_include/*/interfaces/sel4arch.xml

This commit renames them to:

- include/interfaces/object-api.xml
- arch_include/*/interfaces/object-api-arch.xml
- sel4_arch_include/*/interfaces/object-api-sel4-arch.xml

Now, when the include, arch_include, and sel4_arch_include directories
are combined, we are left with:

- interfaces/object-api.xml
- interfaces/object-api-arch.xml
- interfaces/object-api-sel4-arch.xml

Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-30 18:28:12 +10:00
Nick Spinale
10bb153967 arm: add missing seL4_VPPIEvent_Length constants
Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-27 12:50:40 -04:00
hexcoder
15fa2cf9c2 manual: typos and style/grammar corrections
Co-authored-by: Gerwin Klein <gerwin.klein@proofcraft.systems>

Signed-off-by: hexcoder <heiko@hexco.de>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-17 19:24:20 +10:00
Indan Zupancic
8cbc13d5b8 Manual: Document ARM Virtualisation
This resolves issue #1083.

Signed-off-by: Indan Zupancic <indan@nul.nu>
2024-06-17 00:37:00 +01:00
Indan Zupancic
44af0c5776 Force long enum seL4_VCPUReg
Signed-off-by: Indan Zupancic <indan@nul.nu>
2024-06-17 00:37:00 +01:00
Indan Zupancic
0f676f3b9c Rename seL4_TimeoutMsg to seL4_Timeout_Msg
To make it consistent with the naming of other messages.

Signed-off-by: Indan Zupancic <indan@nul.nu>
2024-06-17 00:37:00 +01:00
Birgit Brecknell
31e82e81da wrap docref references in <docref> tag
Signed-off-by: Birgit Brecknell <bbrcknl@gmail.com>
2024-03-22 09:02:23 +00:00
Kent McLeod
5bce5c0c1e
ARM: Allow VMPIDR_EL2 reg to be set on unicore
Currently the seL4_VCPUReg enum only defines the seL4_VCPUReg_VMPIDR_EL2
register when the kernel is configured for SMP. This register should be
available for unicore systems too as otherwise a user level VMM is not
able to control the value of MPIDR_EL1 that the guest VM reads.

Signed-off-by: Kent McLeod <kent@kry10.com>
2024-03-14 10:02:42 +01: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
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
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
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
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
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
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
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
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
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
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
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
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
Axel Heider
edbc81eba4 consolidate arm core specific constants
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-11-30 09:10:16 +11:00
Jimmy Brush
062eb3cb45 libsel4: idl: Fix punctuation in errors
Signed-off-by: Jimmy Brush <code@jimmah.com>
2021-10-17 15:02:45 +11:00
Jimmy Brush
1740abff65 libsel4: idl: Add ASID errors
Signed-off-by: Jimmy Brush <code@jimmah.com>
2021-10-17 15:02:45 +11:00
Jimmy Brush
73180e0e8d libsel4: Document errors in IDL
Also, remove any detailed discussion of error codes from method
descriptions.

Fixes #499

Signed-off-by: Jimmy Brush <code@jimmah.com>
2021-10-17 15:02:45 +11:00
Kent McLeod
9d3cbd027f armv6: Remove remaining armv6 specific features
- KernelGlobalsFrame caused the definition of seL4_GlobalsFrame which
  was a reservation at the top of the user address space on ARMv6
  platforms.
- KernelDangerousCodeInjectionOnUndefInstr was used to implement calling
  user code in kernel mode won ARMv6.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-09-30 18:07:19 +10:00
Axel Heider
b384dc02af add missing includes
Using LIBSEL4_BIT() requires including sel4/macros.h.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-09-22 12:15:37 +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