Indan Zupancic 1bd0e3b788 FPU: ksCurFPUOwner instead of ksActiveFPUState
Trivial change, except for x86 virtualisation and bootup.

Normally the seL4_TCBFlag_fpuDisabled flag is used to decide whether
to enable or disable the FPU. However, with x86 virtualisation there
is only one TCB. Use the task flag for the host and always enable FPU
for the guest.

When either the host or the guest's FPU is loaded, ksCurFPUOwner will
point to our TCB. saveFpuState and loadFpuState check fpu_active and
do the right thing depending on the current FPU user. To make this
work it was necessary to pass tcb_t to saveFpuState and loadFpuState.
Use the idle thread to store the initial FPU state. x86KSnullFpuState
is kept to simplify verification.

However, when Arch_initFpu is called, the idle thread hasn't been
created yet, so move the initialisation to after create_idle_thread,
but before create_initial_thread, as that leads to Arch_initFpuContext
using x86KSnullFpuState.

Also initialise VCPU FPU registers correctly for x86, otherwise the
initial state is wrong and can't be loaded when XSAVES is enabled.

Signed-off-by: Indan Zupancic <indan@nul.nu>
2025-07-24 16:44:08 +10:00
2025-07-24 16:44:08 +10:00
2025-07-24 16:44:08 +10:00
2025-07-23 10:18:04 +10:00
2020-04-01 17:23:36 +08:00
2025-05-26 06:01:48 +02:00
2022-05-18 13:40:55 +10:00
2025-02-26 17:11:57 +11:00
2024-07-02 06:59:46 +10:00

The seL4 microkernel

CII Best Practices CI seL4Test C Parser Compile Proof Sync RefMan XML

This project contains the source code of seL4 microkernel.

For details about the seL4 microkernel, including details about its formal correctness proof, please see the sel4.systems website and associated FAQ.

DOIs for citing recent releases of this repository:

  • DOI

We welcome contributions to seL4. Please see the website for information on how to contribute.

This repository is usually not used in isolation, but as part of the build system in a larger project.

seL4 Basics

Community

See also the contact links on the seL4 website.

Reporting security vulnerabilities

If you believe you have found a security vulnerability in seL4 or related software, we ask you to follow our vulnerability disclosure policy.

Manual

A hosted PDF version of the manual for the most recent release can be found here.

A web version of the API documentation is available as well.

Repository Overview

  • include and src: C and ASM source code of seL4
  • tools: build tools
  • libsel4: C bindings for the seL4 ABI
  • manual: LaTeX sources of the seL4 reference manual

Build Instructions

See the seL4 website for build instructions.

Status

License

See the file LICENSE.md.

Description
The seL4 microkernel
Readme 27 MiB
Languages
C 72.7%
Python 9.5%
CMake 6.1%
TeX 5.9%
Assembly 2.7%
Other 3.1%