Commit Graph

227 Commits

Author SHA1 Message Date
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
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
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
Axel Heider
800b2444a1 trivial: style and formatting
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-03-03 11:47:23 +01:00
Oliver Scott
7f37417646 ia32: remove redundant deference
In `seL4_X86DangerousRDMSR` on ia32.
2021-02-02 13:32:26 +11:00
Curtis Millar
0d35551966 riscv: Implement benchmark log buffer
Can now perform benchmarks on the kernel using the log buffer to trace
kernel behavior.

Signed-off-by: Curtis Millar <curtis.millar@data61.csiro.au>
2020-12-03 10:31:16 +11:00
Kent McLeod
0101071f70 smmuv2: Reserve VSpace slot for holding CB count
A slot in the top level VSpace page table is used to hold the number of
SMMUv2 ContextBanks that are assigned to a VSpace. This means a
reduction of available virtual addresses at userlevel as the slot cannot
be used for holding regular mappings.

Signed-off-by: Kent McLeod <kent@kry10.com>
2020-11-03 10:14:46 +11:00
Qian Ge
1a9756f65b SMMU: basic driver for init and probing
Introducing the driver in kernel for detecting SMMU features
and initialise the hardware.

Signed-off-by: Oliver Scott <Oliver.Scott@data61.csiro.au>
2020-10-28 17:30:42 +11:00
Kent McLeod
b86bce2d4b aarch64,cortex-a53,hyp: Reduce seL4_UserTop value
This ensures that no frames can be mapped that would overwrite the
currently stored VMID for the vspace.

Signed-off-by: Kent McLeod <kent@kry10.com>
2020-10-16 14:38:31 +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
00a9ba9123 aarch32: Move tpidruro from vcpu to tcb context
This register is visible to software executing at PL0 but not writeable.
Storing it in the VCPU context required custom save/restore handling as
it had to be explicitly handled when switching from a VCPU thread to a
non-VCPU thread so that it didn't become a channel. It is possible to
now update this register via seL4_TCB_WriteRegisters for software
executing at PL0.

This also fixes a bug where if a vcpu-thread is switched for a
non-vcpu-thread and then switched to a different vcpu-thread the
original vcpu-thread's copy of this register will get set to 0.

Signed-off-by: Kent McLeod <Kent.Mcleod@data61.csiro.au>
2020-05-15 12:04:39 +10:00
Yanyan Shen
4006310e68 riscv: Add FPU state in TCB
Add FPU state storage in TCB and increase TCB size bits when FPU
is enabled.

Signed-off-by: Yanyan Shen <yanyan.shen@data61.csiro.au>
2020-05-07 13:48:26 +10:00
Kent McLeod
0c88f21aaf libsel4,riscv: Remove seL4_UserException_FLAGS
This field is unused and is never set to anything by the kernel. Other
architecture definitions of seL4_UserException_Msg contain an equivalent
field for a current-program-status-register-like register that the fault
handler can read and modify as part of fault handling. RISC-V's
equivalent register SSTATUS doesn't contain any fields that would be
useful for a fault handler to modify at this stage and so the register
isn't transferred in the fault.

Signed-off-by: Kent McLeod <Kent.Mcleod@data61.csiro.au>
2020-04-16 15:19:54 +10:00
Kent McLeod
7cc1142c7a aarch64,vcpu: Add CNTKCTL_EL1 register to vcpu_t
This register is accessible from EL1 and affects whether Generic Timer
registers are accessible from EL0. When switching out of guests, the
kernel needs to restore the correct access for native threads.

Signed-off-by: Kent McLeod <Kent.Mcleod@data61.csiro.au>
2020-04-09 15:52:31 +10:00
Saer Debel
a221ee1ca8 Enabled IPC debug features under new config
Introduced a new config flag to enable
userError format strings to be written to the IPC buffer.
Another config bool has been introduced to toggle
printing the error out and this can also be set at runtime.

Signed-off-by: Saer Debel <saer.debel@data61.csiro.au>
2020-04-06 14:21:46 +10:00
Qian Ge
c0a2b666d4 fixing missed header files
This is the second commit for replacing ifndef with pargma
once in kernel header files. A few header files are missed
in the first round, hence this commit.
2020-03-23 13:11:51 +11:00
Qian Ge
512a0200de replacing all ifndef with pargma once
All the kernel header files now use pargma once rather than the ifndef,
as the pre-processed C files do not change while header files
are protected with pargma once. This will also solve any naming issues
caused by ifndef.
2020-03-23 11:04:46 +11:00
Gerwin Klein
79da079239 Convert license tags to SPDX identifiers
This commit also converts our own copyright headers to directly use
SPDX, but leaves all other copyright header intact, only adding the
SPDX ident. As far as possible this commit also merges multiple
Data61 copyright statements/headers into one for consistency.
2020-03-09 13:21:49 +08:00
Alison Felizzi
bddd405417 arm: Added define for VMPIDR and VMPIDR_EL2
Added constant definitions for the VMPIDR (arm32) and VMPIDR_EL2
(arm64) registers. These being vcpu registers that can be
written, read, saved and restored. The 'Virtualization Multiprocessor
ID Register' (VMPIDR) is needed to program a vcpu's affinity during
initialisation. This is currently only exposed on SMP configurations.

Co-authored-by: Anna Lyons <anna@gh.st>
2020-02-20 12:52:59 +11:00