Commit graph

3983 commits

Author SHA1 Message Date
Axel Heider
fe2d400f06 arm: remove obsolete function setInterruptMode()
The function setInterruptMode() is no longer in use, setIRQTrigger() is
used instead.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-08-18 10:08:06 +10:00
Axel Heider
b9781a0f19 trivial: remove superfluous empty lines
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-08-18 10:08:06 +10:00
Axel Heider
248b9639ec boot: use SEL4_PRIx_word instead of 'lx'
All architectures define paddr_t as word_t, but the actual definition of
word_t is specific to every architecture's word size. For this reason, a
dedicated format specifier for word_t has been introduced, it hides
all these detail.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-08-18 09:42:08 +10:00
Axel Heider
74b81ede92 boot: make functions static
The functions insert_region() and create_rootserver_objects() are not
used outside of boot.c, so there is no reason to make it publicly
available.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-08-18 08:55:48 +10:00
Axel Heider
d57b2cd0f8 Ensure ksKernelEntry.core is always set
The field ksKernelEntry.core always exists, ensure it is properly set on
non-SMP configurations also.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-08-17 18:19:37 +10:00
Axel Heider
acd693db17 prefer macro CURRENT_CPU_INDEX()
Replace the macro SMP_TERNARY(getCurrentCPUIndex(), 0) by the much
simpler macro CURRENT_CPU_INDEX() that does the same.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-08-17 18:19:37 +10:00
Axel Heider
1e3c8011d6 define macro SEL4_WORD_CONST()
CURRENT_CPU_INDEX() is supported to return a word_t. The C parser from
the verification toolchain requires declaring word_t constants without
casting integer values to word_t.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-08-17 18:19:37 +10:00
Gerwin Klein
10d6cc0ae9 arm: flush cache to RAM on retype reset
This fixes a correctness and security issue where uncached user
mappings might see old data from before the clearMemory operation.

See also the discussion on GitHub issue #481

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-16 16:10:58 +10:00
Gerwin Klein
697430abf0 github: enable hw test for imx8mm
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-16 15:56:45 +10:00
Gerwin Klein
7f08674bb7 github: add TX2 to hardware test
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-13 18:16:54 +10:00
Axel Heider
16b82ecdb1 trivial: fix typos in comments
Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-08-13 09:05:42 +10:00
Axel Heider
9416cd8f97 clarify that parameter is initial thread's region
Align the parameter naming within each architecture's file and also
across architectures.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-08-13 08:31:26 +10:00
Gerwin Klein
1324734ffb github: adjust event name
Trigger moved to pull_request_target, so event name is changing as well.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-12 18:24:07 +10:00
Gerwin Klein
2e59eeae7d github: remove test branch trigger
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-12 18:24:07 +10:00
Gerwin Klein
f975153948 github/hw: rpi3 power-up not fully stable yet
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-10 17:54:24 +10:00
Gerwin Klein
934fc2642b github: split off more x86 sessions
More x86 boards have become available, so we can have one session
per mode and compiler.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-10 17:54:24 +10:00
Gerwin Klein
5688e6e9f6 trivial: fix link
The link will probably go back to .html when the website is finished,
but this commit will avoid annoying test failures in the meantime.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-10 17:54:24 +10:00
Gerwin Klein
302339fd8a for testing only
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-10 17:54:24 +10:00
Gerwin Klein
0fa13e059a github: add action for hardware test runs
This switched the action from pull_request to pull_request_target,
because we need access to secrets. GITHUB_TOKEN permissions are
downgraded to PR-like permissions, and the action needs to be triggered
manually by labelling with label 'hw-test'.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-08-10 17:54:24 +10:00
Axel Heider
89a5b8fd31 boot: move create_untypeds() to generic code
Also merge create_device_untypeds() and create_kernel_untypeds() into
create_untypeds() to simplify the code.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-30 08:46:12 +10:00
Kent McLeod
379bf5abe3 hardware_gen.py: Address some warning messages
CMake treats any text output that is generated by tools during the
configuration phase as important if it isn't part of a message(STATUS)
command. Output generated by hardware_gen.py often shows up as warnings
about device tree properties that are usually uninformative. Resolving
some of the warning conditions removes these messages for most
platforms.

- Setting kernel_size in hardware.yml to 0x1000 to handle cases where
  the kernel only needs the first page of a device that has a
  device-tree definition larger than that.
- Remove status print about each Interrupt processed as it's usually not
  useful information.
- Only process IRQs for a selected kernel device if the rule for that
  device has any interrupt queries. This prevents warnings for IRQ
  controllers that the script doesn't know how to process when it
  doesn't need to.

Signed-off-by: Kent McLeod <kent@kry10.com>
2021-07-29 16:03:01 +10:00
Gerwin Klein
d93aa01459 github: split sel4test into separate workflows
The reason is that with separate workflow files allow different
triggers. In particular, we don't want to re-run all simulations
on all `labeled` triggers, but if we explicitly skip the simulation
job for those triggers, than previous simulation runs are not
shown any more in the GitHub check status, so failed runs will be
overlooked.

This should achieve both: no unnecessary runs, and visible status.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-07-26 21:04:52 +10:00
Gerwin Klein
4cdd97c532 github: use correct label field
The trigger matched against the whole label object, not the name as
it should have.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-07-26 21:04:52 +10:00
Gerwin Klein
f1ac3d829e github sel4test: don't run on PRs to docs
Save some checking time for changes that are to docs only and
don't affect sources.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-07-26 14:58:09 +10:00
Gerwin Klein
bd9a8b2ff7 github: constrain triggers for longer builds
The previous trigger would start duplicate builds for each new
label added to a PR. This commit locks this down a bit more so
that builds only run when the trigger label is added or on other
triggers when the label is present.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-07-26 14:58:09 +10:00
Gerwin Klein
52a89f9e0f github: add action for hardware builds
The action is triggered on push to master or when the label "hw-build"
is present on pull requests.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-07-26 14:58:09 +10:00
Gerwin Klein
e80217f87e README: add badge for simulation test
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-07-19 14:57:10 +10:00
Axel Heider
d1a456bebd remove redundant defines
These defines are set up in the architecture specific bootinho.h.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-19 11:19:43 +10:00
Axel Heider
e20652f664 make definition for NULL generic
Make the definition for NULL generic, so it can be used in constants
that are shared by C and assembly code.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-19 10:45:20 +10:00
Axel Heider
fec1b90ef8 provide and use macro ULL_CONST()
- Provide the macro ULL_CONST() for 'unsigned long long' constants, and
  use it where applicable.
- Add a verbose explanation why the 'unsigned long long' type is used
  for time constants.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-19 10:45:20 +10:00
Axel Heider
e27613b30f remove redundant definition of HZ_IN_KHZ
The constant HZ_IN_KHZ is defined in util.h already,

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-19 10:45:20 +10:00
Axel Heider
974458fde1 reorder and consolidate macro definitions
- Reorder the macro definitions to ensure things are define before they
  are used.
- provide a verbose explanation why the UL_CONST() macro is needed.
- make BIT() macro is defined generic by using UL_CONST().

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-19 10:45:20 +10:00
Axel Heider
93ab556e0c style: add spaces around the operator
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-19 10:45:20 +10:00
Axel Heider
72547433df trivial: remove superfluous empty line
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-19 10:45:20 +10:00
Gerwin Klein
c650c41848 github: run SimplExportAndRefine conditionally
The SimplExportAndRefine session is one of the steps of binary
verification and only available for ARM and RISCV64.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-07-16 11:11:13 +10:00
Gerwin Klein
0665ae3edd github: add C proof check on labelled PR
This action will run the C proofs when the label `proof-test` is added
to a pull request. Intended to be used when the preprocess test has
failed and the PR is ready to check proofs.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-07-16 08:12:28 +10:00
Axel Heider
913bf483df boot: add UNREACHABLE statements
Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-07-12 17:57:00 +10:00
Axel Heider
d34d48fc85 boot: verbosely log boot errors
Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-07-12 17:57:00 +10:00
Axel Heider
caf6eb2a6b Set KernelPaddrUserTop correctly on RISC-V
The top phys addr is exclusive, not inclusive. On 64-bit platforms there
is a trivial way to fix this as long as the whole address space is never
used. For 32-bit platforms the fix will be more complicated, so this is
postponed.

Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-07-09 15:27:07 +10:00
Curtis Millar
76b1de0670 Add ODroid C4 support
This adds support for the ODroidC4. The ODroidC4 is just a beefier
ODroidC2 with some bits moved around. The devices we care about here are
all essentially the same except the cores are A55s instead of A53s.

Signed-off-by: Curtis Millar <curtis@curtism.me>
2021-07-09 14:05:05 +10:00
Curtis Millar
84e8509997 Add ARM Cortex A55
This adds basic support for the ARM Cortex A55 cpu core as is used in
the Amlogic S905x3 that is found in the ODroid C4.

Signed-off-by: Curtis Millar <curtis@curtism.me>
2021-07-09 14:05:05 +10:00
Gerwin Klein
1dcff9cc20 Add GitHub action for sel4test simulation runs
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
2021-07-05 12:57:20 +10:00
Axel Heider
d55c5cf637 risc-v: remove obsolete file
Remove the latest traces of the hack that RISC-V platforms are spike
instances.

Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-07-05 09:17:33 +10:00
Axel Heider
5fee77b5d7 trivial: remove superfluous empty line
Signed-off-by: Axel Heider <axel.heider@hensoldt-cyber.de>
2021-07-03 18:47:14 +02:00
Axel Heider
ad4ea6cd08 CMake: unify config options define generation
Add disabled options from the build system as comments in the generated
header files.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-01 12:05:37 +10:00
Axel Heider
e65906dfa1 debug: always print TIMER_CLOCK_HZ as a uint64
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-01 11:40:37 +10:00
Axel Heider
32d81495fa boot: make linker definitions generic
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-01 11:30:19 +10:00
Axel Heider
938c1c9557 boot: fail boot if region configuration is invalid
Also make the output more verbose in case of errors, which is
helpful when porting the kernel to new platforms.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-01 10:48:47 +10:00
Axel Heider
adbd374370 boot: make create_untypeds_for_region() static
Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-01 10:48:47 +10:00
Axel Heider
c630e54c06 boot: improve code readability
Make the code flow more verbose and log a error message.

Signed-off-by: Axel Heider <axelheider@gmx.de>
2021-07-01 10:48:47 +10:00