Commit Graph

73 Commits

Author SHA1 Message Date
Hesham Almatary f340269411 Support building with LLVM
This commit adds support for building the seL4 kernel, loader, monitor,
and libmicrokit with LLVM (Clang, LLVM and ld.lld). Passing --llvm
should instruct the tool to build everything with with LLVM.

Clang/RISC-V don't implement or need -mstrict-align
Also fix a trivial error adding single quotes within a string.

Signed-off-by: Hesham Almatary <heshamalmatary@capabilitieslimited.co.uk>
2025-07-01 11:45:13 +10:00
Ivan-Velickovic e3c67fa505 Add support for SiFive Premier P550
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-06-30 16:26:46 +10:00
julia 4d0d821848 build_sdk: specify KernelSel4Arch when building
This would otherwise give the warning

     platform maaxboard supports multiple architectures, none was given
     defaulting to: aarch64

on platforms which support multiple architectures, for instance, the
maaxboard which can be built for aarch64 and aarch32. This seems to have
been fine because the first option is always the 64-bit option, but this
is probably unlikely to be guaranteed.

For the CMake Builds for sel4test et al, this is set in
cmake-tool/helpers/application_settings.cmake.

Signed-off-by: julia <git.ts@trainwit.ch>
2025-05-28 13:59:40 +10:00
Nataliya Korovkina 6a439fed05 Add Ultra96V2 support
Signed-off-by: Nataliya Korovkina <malus.brandywine@gmail.com>
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-04-09 12:15:51 +10:00
Ivan-Velickovic 14478c131d Enable "KernelAllowSMCCalls" by default on ARM
Previously I did not turn this option on by default because
I thought it would make the kernel proofs not apply anymore.
In reality this is only true really when a user makes use
of the SMC feature. Most users probably will never have to enable
it and the ones that that do will no longer have to patch Microkit
to enable it.

I've added a warning about using SMC calls in the manual to make users
aware of the implications of using this feature.

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-04-09 12:15:19 +10:00
Ivan-Velickovic 1a4872e2e9 build_sdk.py: read from VERSION file
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-03-21 11:24:11 +11:00
Yanfeng Liu 8b24ee0bbf Fix a typo in build_sdk.py
Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2025-03-09 12:31:29 +11:00
Ivan-Velickovic ce34bd7f88 build_sdk.py: fix when host is Linux AArch64
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-03-07 02:39:43 +11:00
Ivan-Velickovic 8aeb9f9006 Release 2.0.0
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-03-06 16:34:27 +11:00
Ivan Velickovic 379ef51d88 Fix loader link address for QEMU virt RISC-V
With the changes to seL4 regarding reserving the SBI region
properly [1] it means we can no longer use 0x80200000
as a loader link address for this platform.

[1]: cf3a64b44c

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2025-03-05 15:05:15 +11:00
Ivan-Velickovic c7e685fe94 Fix path issues with manual
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-03-04 17:49:03 +11:00
Ivan-Velickovic b5dd27fc65 tool: improve emulation of kernel boot
One of the things the tool has to do is emulate the kernel boot process,
this involves getting a layout of all memory and putting into two
categories, 'device' memory and 'normal' memory as defined by the
kernel.

The way we do this currently is by looking at certain symbols in the
kernel ELF that encode this information. This doesn't work well when
the compiler decides to optimise that symbol out and instead embed
the information directly into where it's being used in the kernel code.

So, instead we use the `platform_gen.json` file that gets generated by
the kernel build system to get the same information.

There should be no difference at all in terms of what the tool actually
spits out at the end, it just means that the process of doing this
emulation is less fragile.

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-02-10 12:51:58 +11:00
Ivan-Velickovic d9bbb2ae4a Add support for Raspberry Pi 4B
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-02-05 11:43:11 +11:00
Ivan-Velickovic cec9ed1632 Support for Cheshire on Digilent Genesys 2
Signed-off-by: Matt Rossouw <matthew.rossouw@unsw.edu.au>
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-02-04 11:10:22 +11:00
Matt Rossouw 34355c8502 Added support for Ariane (CVA6) [riscv]
Signed-off-by: Matt Rossouw <matthew.rossouw@unsw.edu.au>
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2025-01-20 12:31:10 +11:00
Ivan-Velickovic 6b3ccd4944 Refactor examples for handling many boards
The current way examples are done in the repository and
shipped in the SDK does not make sense when you have many
boards in my opinion so this restructure moves examples that
are not specific to any particular platform (e.g hello world)
to be generic to every platform supported by Microkit.

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2024-12-23 15:04:20 +13:00
Ivan-Velickovic 87ed49198d Add VERSION file to SDK layout
People tend to rename the SDK etc and so it helps to have
this file so they know what version they're on.

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2024-10-28 21:09:17 +11:00
Ivan-Velickovic b1610a0184 build_sdk.py: remove accidental debug print 2024-10-25 15:50:46 +11:00
Ivan-Velickovic b8573a5e41 build_sdk: fix bug with overriding toolchain
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2024-10-25 13:48:56 +11:00
Alwin Joshy 860bce3d61 Load invocation numbers from JSON file
Instead of hard-coding invocation numbers, we now
get them from a file generated by the seL4 kernel
build.

Signed-off-by: Alwin Joshy <joshyalwin@gmail.com>
2024-10-24 14:24:23 +11:00
Ivan-Velickovic 95041654dc Add support for Pine64 RockPro64
Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2024-10-24 13:13:48 +11:00
Ivan-Velickovic 9d1911519a Allow building SDK with a custom toolchain prefix
We will always have an official, 'supported' C toolchain but it has
become apparent that:
1. GCC toolchain triples are a complete, inconsistent mess.
2. People may have vendored toolchains that they must use when compiling
   from source.

Therefore, we introduce arguments to the build_sdk.py script that allows
overriding the default prefixes.

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2024-10-22 16:18:49 +11:00
Ivan Velickovic 361ccd1a0a Enable building SDK for Linux AArch64
Rust's cross-compiling is limited so this only works from
a Linux host, if you're on macOS it won't work.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-10-02 12:36:18 +10:00
Ivan Velickovic 4cc0f1f974 Add support for i.MX8MP-EVK
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-09-04 10:28:42 +10:00
Ivan Velickovic 292b6b7a1a Add ability to specify version of SDK
This will be used by CI for builds on each commit of Microkit,
which will be useful for getting prebuillt SDKs between official
releases.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-08-20 15:24:55 +10:00
Ivan Velickovic 395cf0e5be Release v1.4.1
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-08-16 15:32:30 +10:00
Ivan Velickovic 9b238f3169 Increase loader link address for MaaXBoard
It was seen on larger Microkit systems that the loader data was
overlapping with the code for the loader itself when the loader
attempted to copy the data to the appropriate location before
jumping to seL4 and starting the system.

I believe the root cause of this problem is not gone and will involve
changing the tool to be smarter with how it allocates physical memory,
my current attempts to do so lead to other issues. I'll have to make a
follow up fix to prevent this from happening again, but for now this
will allow users of the MaaXBoard to run larger Microkit systems.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-08-16 15:04:33 +10:00
Ivan Velickovic 0c80d9a449 Disable 'KernelArmVtimerUpdateVOffset' by default
This changes the behaviour of virtual machines to see the
architectural timer change even when it is not running.

I do not understand why this option applies to all vCPUs
in the kernel, instead of being behaviour that depends on
the configuration of a particular vCPU.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-08-16 12:09:35 +10:00
Ivan Velickovic e6c8f52964 Enable FPU on QEMU virt RISC-V and Star64
We are compiling libmicrokit with hardware floating extensions
which means that user-code must also be compiled with hardware
floating extensions.

This meant that before this patch user programs that make use of
floating point instructions would crash as the kernel has the FPU
disabled.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-08-08 12:29:06 +10:00
Ivan Velickovic 169c7c0f62 Release v1.4.0
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-08-05 19:32:55 +10:00
Ivan Velickovic 1c3d717a04 build_sdk: allow skipping seL4
Useful for when benchmarking/testing the tool itself

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-08-05 18:09:31 +10:00
Ivan-Velickovic b3351ff413 Fix benchmark config to track utilisation
Need to add `KernelVerificationBuild` in order to enable
utilisation tracking in the kernel.

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2024-08-05 16:48:58 +10:00
Ivan Velickovic 8184a48e36 Add support for Pine64 Star64
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-08-05 13:24:26 +10:00
Ivan Velickovic f3900bf83e Add support for QEMU virt RISC-V 64-bit
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-08-05 13:24:26 +10:00
Ivan Velickovic 168681fbf3 Add RISC-V support
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-08-05 13:24:26 +10:00
Ivan Velickovic 23d244b987 build_sdk.py: fix style
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-08-05 13:24:26 +10:00
Ivan-Velickovic bfbb3f2fd6 loader: do not print logs on non-debug mode
The manual says that the loader should not print on release mode,
so this patch just makes that true.

Signed-off-by: Ivan-Velickovic <i.velickovic@unsw.edu.au>
2024-08-04 13:10:55 +10:00
Ivan Velickovic 71e53b9092 Add 'benchmark' configuration
This patch adds a new configuration for each platform called
'benchmark'.

The purpose of this is to enable Microkit systems to leverage the
benchmark configuration of seL4 that tracks things like kernel entries
and CPU utilisation. This also exports the PMU to user-space.

This is not ideal, which is why RFC-16 exists.
However, we need to be able to do benchmarking for projects like the
seL4 Device Driver Framework in the meantime. It may take a while
to get the RFC approved and implemented which is why we are adding
this 'temporary' configuration.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-07-29 23:00:04 +10:00
Ivan Velickovic bd3151ea8f Export ARM timer for QEMU virt AArch64
The QEMU virt platform does not have a timer and so the only
way to get a timer driver working is to use the architectural
timer.

Exporting the architectural timer to user-space can be problematic
as it means any user-space program can access it, including ones
you may not trust. However, as this platform is only intended for
development purposes, this is not an issue.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-07-09 16:29:35 +10:00
Ivan Velickovic b5eef1728d build_sdk.py: fix typos
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-07-09 15:53:44 +10:00
Ivan Velickovic 3543fd2dfb Fix SDK permissions
Change the permissions to be owner-writeable. This means we no
longer need `sudo` to move or remove the SDK after unpacking the
tar.

I can't know the original reason for doing this, but I imagine it
was to prevent users from accidentally removing the SDK unless they
really wanted to.

However, the user-experience of this is poor and in not worth it in
my opinion.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-07-09 11:49:47 +10:00
Ivan Velickovic 1ccdfcb3b2 Release version 1.3.0
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-07-01 17:27:51 +10:00
Ivan Velickovic ec2f23bfe0 Add initial support for virtual machines
This PR adds support for running seL4 in hypervisor mode as well as
a new 'virtual machine' abstraction.

This commit message says 'initial support' as features such as
multi-vCPU/core support for VMs are not yet implemented. However,
with this patch, we can run guest operating systems such as Linux
on a Microkit system.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-07-01 12:51:45 +10:00
Gerwin Klein c0e7c9db66 docs: type set manual in seL4 foundation style
Co-authored-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2024-06-27 10:54:11 +10:00
Nick Spinale 04b7894ef6 build_sdk.py: add support for skipping tool
Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-26 19:01:08 +10:00
Ivan Velickovic 143c503cd7 Add hierarchy example to SDK and fix spelling
This makes sure that the hierarchy example ends up in the actual
SDK.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-06-25 14:59:46 +10:00
Nick Spinale d3ed300fef build_sdk.py: add support for minimal build
Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-06-24 18:20:52 +10:00
Ivan Velickovic bed500b2ef Rewrite the Microkit tool
This commit rewrites the entire Microkit tool from Python to Rust.

This is was done for the following reasons:
* The current tool was difficult to build from source. It took too long,
  did not have any cache for rebuilds, and sometimes would not reliably
  build/link with musl.
* While perhaps not as extensive as C, Rust does have some verification
  tooling surrounding it, meaning it is possible for us to verify the
  Microkit tool in the future. Although at this time there are no
  concrete plans to verify the tool.

This rewrite, while not significantly reducing our dependencies in
general, does improve the situation. We are no longer dependent on
pyoxidizer, which was causing most of the issues with the tool.

We introduce a dependency on the Rust toolchain. The tool itself has
two dependencies (for XML parsing). No other dependencies are needed,
and it was a conscious decision to re-invent the wheel where the Rust
standard library was lacking (compared to the Python standard library).

The other programming languages considered for the rewrite were Zig and
Go. While they both have their benefits and costs (as does Rust), they
were not chosen due to them not being in any other seL4 Foundation
supported projects meaning that it could have been difficult to continue
maintaining the tool in the future.

The main cost of rewriting the tool in Rust is that it has undoubtedly
become more complicated and harder to understand. This could potentially
result in a higher barrier to entry for contributors. However, most
contributions such as adding platform support will not need to touch the
tool.

Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-05-22 14:50:34 +10:00
Nick Spinale c2cfd9a37c Make tool binary world-accessible
Signed-off-by: Nick Spinale <nick@nickspinale.com>
2024-04-24 11:20:02 +10:00
Ivan Velickovic 1f65c5302b Initial support for QEMU's ARM virt platform
Signed-off-by: Ivan Velickovic <i.velickovic@unsw.edu.au>
2024-03-28 09:03:21 +11:00