Commit graph

97 commits

Author SHA1 Message Date
Adrian Danis
29695d2636 x64: SKIM window to mitigate Meltdown (CVE-2017-5754) on x86-64
Introduces a kernel option that, when enabled, reduces the kernel window in a user address
space to just be Static Kernel Image and Microstate (SKIM), instead of the full kernel
address space. This isolates the important kernel data from the user preventing a
Meltdown style attack being able to violate secrecy. The kernel text and read only data,
i.e. anything that is static from boot, is not secret and can be allowed in the SKIM window
and potentially read by the user. Additionally to switch to and from the actual kernel
address space a small amount of state needs to also be in the SKIM window.

This is only an implementation for x86-64, although the same design is applicable to ia32
2018-01-17 16:38:52 +11:00
Anna Lyons
d833f9a0c9 Hikey: disable DANGEROUS_CODE_INJECTION
DANGEROUS_CODE_INJECTION does not work on the Hikey due to the current
state of the vspace implementation.
2017-11-23 11:54:45 +11:00
Adrian Danis
383a6d959f Merge branch zcu102-7.0.0 into master 2017-10-03 12:16:08 +11:00
Robbie VanVossen
7e928adbb5 Enable HAVE_FPU for the zynqmp by default.
The FPU is always enabled for ARMv8-a platforms by default. For
the kernel to work correctly, this needs to be selected.
2017-09-27 12:59:05 -04:00
Robbie VanVossen
02ca6a80a4 Added 32-bit support for the zynqmp.
The Zynq UltraScale+ MPSoC (PLAT zynqmp) is a Multi-Processor SOC
made by Xilinx that has a quad-core Cortex-A53, a dual-core Cortex-R5
and an FPGA.

This adds 32-bit, single-core support on the the Cortex-A53 cluster.
2017-09-27 12:58:49 -04:00
Anna Lyons
71cde34b45 Add config option for CONFIG_RESET_CHUNK_BITS
The config variable is used in the kernel but no setting was provided
prio to this commit.
2017-09-08 11:16:27 +10:00
Hesham Almatary
64d576fb47 SELFOUR-806: aarch32 - Implement lazy FP save/restore
This commit implements lazy FP save/restore mechanism, required for user threads
when they use the FPU. The following caveats take place:

* Only support synchronous exceptions. No support for asynchronous ones.
* VFP opcodes are used instead of normal instructions to discard compiler warnings/errors.
* Support is limited to specific ARM subarchitectures we support and tested this commit on.
* Disable the FPU by default if users are not using it to avoid channels.
* FPU support is not verified yet.
* Will not work properly if using a VM that's running besides other VMs/threads that are using the FPU.
2017-06-29 13:42:10 +10:00
Adrian Danis
4f4ef6e74f arm: Add common configuration option for all exynos5 platforms
This option allows for checking if a platform is any of the three supported exynos5xxx platforms
more easily
2017-05-30 13:53:33 +10:00
Kofi Doku Atuah
4b491dcf0c SELFOUR-836: arm-hyp: Config option for saving/loading vs trapping debug state
Provides a configuration option for enabling HDCR.TD* traps, or saving and loading debug
state on VCPU switches. Currently verification only plans to support the trap setting.

As this option complicates all of the #ifdef's related to debug registers even further,
abstractions for enabling/disabling each individual piece of the debug code for different
configuration options are also implemented.

Part of these refactored #ifdef guards was to remove the guards completely from libsel4
around the definitions of the number of breakpoints and watchpoints.
2017-04-03 14:21:27 +10:00
amrzar
24c6a7e521 tx1: add fpu config variable 2017-03-07 08:59:32 +11:00
amrzar
8610061aa9 aarch64: FPU lazy context switch 2017-02-27 14:25:01 +11:00
amrzar
0707ae874b Move arch independent functions to generic files and HAVE_FPU config 2017-02-27 12:52:18 +11:00
amrzar
195e5a0db8 pcc99: move max restore config value to main Kconfig 2017-02-27 12:52:18 +11:00
amrzar
2e250fcce5 plat: add tx1 support 2017-02-15 12:35:13 +11:00
amrzar
fac16fe89e aarch64: add preliminary folders and Makefiles 2017-02-10 16:43:55 +11:00
Adrian Danis
d5bafdc74b arm: SELFOUR-779: Remove ARM_MPCORE config
The ARM_MPCORE configuration was added to capture which systems have the additional
ThreadID registers. This was an unneeded indirection as any arm version from v7 and
beyond has these registers. For the purposes of seL4 this means any arm version
except v6. This change scrubs ARM_MPCORE and replaces it with negated usages of
ARCH_ARM_V6. Additionally the IPC buffer config defaults were updated as the
ARM_MPCORE config was explicitly selecting the optimal one.
2017-01-23 09:45:34 +11:00
Hesham Almatary
e9922b7456 Unify kernel stack definition/declaration and share it between architecures/modes
Rather than defining a kernel stack in random places for each
architecure for each mode (32/64) and for single/SMP modes, make the
stack definition shareable between all of the above. This is also useful
for the future ARM SMP work.
2017-01-17 15:52:58 +11:00
Adrian Danis
5037717cde x86: Explicitly define kernel stack size
This commit changes the previous hard coded 4K kernel stack size
to being a configurable power of 2 sized stack
2017-01-13 15:20:14 +11:00
Adrian Danis
6560e9cad9 x86: Restrict CACHE_LN_SZ to x86 in Kconfig
This configuration option is actually for x86 and ARM has its own per
platform cache line size definitions
2017-01-12 16:10:46 +11:00
Frank
7348ca0341 In Kconfig changed dependency for disable prefetcher
from IA32 to x86 to include 64 bit kernels
Added skylake to supported processor for function disablePrefetchers
2017-01-10 15:09:34 +11:00
Frank
88eef11c46 Implemented prefetcher for arm: Hikey
Fixed typo
2017-01-03 12:08:49 +11:00
amrzar
125bc17149 SELFOUR-723: kernel config for the hikey platform
Also:
- cleanup unused Cortex A57
- Cortex A53 is v8 so removing 'ARM_CORTEX_A53' form v7 files
- define rpi3 as v8
2016-12-01 08:07:44 +11:00
Adrian Danis
9f99e77c38 SELFOUR-553: Support ARM MPCore registers
This commit adds support for saving/restoring an additional register
that exists on ARM MPCore platforms. As this register is user wrieable,
as well as readable, it must saved and restored by the kernel to
prevent gross information channels.
2016-11-22 11:49:52 +11:00
Adrian Danis
858fa717c6 tk1: Remove temporary SMMU memory mapping support 2016-11-02 15:12:56 +11:00
Adrian Danis
7f9970e5e2 x64: Add x86_64 support 2016-10-12 12:22:31 +11:00
amrzar
3f9eb7c873 SELFOUR-632: implement cores non-architecture dependent structres 2016-10-10 16:33:48 +11:00
Kofi Doku Atuah
bebfcf6d27 SELFOUR-499: X86, ARM: Add userspace invocations for hardware debugging
This commit implements the body of SELFOUR-499. The API exposes the x86 DR0-7
and ARM coprocessor 14 features to userspace by virtualizing them as context-
switched registers in the TCB. Implemented as TCB invocations. This feature is
only built when CONFIG_HARDWARE_DEBUG_API is selected.

* Add low-level support routines for setting, unsetting, getting, enabling
  and disabling breakpoints.
* Add support for single-stepping as well.
  ^ Single-stepping is not supported on ARMv6 since the hardware
    doesn't have support.
  ^ ARM implements single-stepping as instruction breakpoints
    configured to fault on every instruction -- this is achieved through
    the "mismatch" mode, which is only supported from ARMv7 onwards.
* Also support explicit software break requests, a la "BKPT" and "INT $3".

* New invocations:
  * seL4_TCB_SetBreakpoint().
  * seL4_TCB_GetBreakpoint().
  * seL4_TCB_UnsetBreakpoint().
  * seL4_TCB_ConfigureSingleStepping().
* New constants:
  ^ Event types:
    ^ seL4_InstructionBreakpoint.
    ^ seL4_DataBreakpoint.
    ^ seL4_SoftwareBreakRequest.
  ^ Access types:
    ^ seL4_BreakOnRead.
    ^ seL4_BreakOnWrite.
    ^ seL4_BreakOnReadWrite.
  ^ Exports:
    ^ seL4_NumHWBreakpoints.
    ^ seL4_NumExclusiveBreakpoints.
    ^ seL4_NumExclusiveWatchpoints.
    ^ seL4_NumDualFunctionMonitors.
    ^ seL4_FirstBreakpoint.
    ^ seL4_FirstWatchpoint.
    ^ seL4_FirstDualFunctionMonitor.

See documentation in the seL4 API manual.
2016-10-10 13:53:21 +11:00
Hesham Almatary
c8a9178c8a Merge pull request #372 in SEL4/sel4 from ~HALMATARY/sel4:BenchmarkNullSyscall to master
* commit '9c507cffd1472a41700417c91d87d7e12d1eb641':
  SELFOUR-603 - Benchmark: Add null syscall
  Benchmarks: Add new generic benchmark entry mode
2016-09-29 23:10:01 +00:00
amrzar
2cbc7123b6 SELFOUR-630:preliminary booting application processors
- update core detection code and Kconfig file
    - update kernel stack managment so that BSP does not use boot stack before IPI APs
    - move arch dependant data to a single structure
    - add cache line size to Kconfig
    - add cpu indexing and apic id mapping
    - boot APs to halting state
    - add guard for kernel stack if there is only one core
2016-09-28 16:10:25 +10:00
Hesham Almatary
c7c294a1fc Benchmarks: Add new generic benchmark entry mode
This enables non-feature specific benchmarking mode. It just defines
CONFIG_ENABLE_BENCHMARKS.
2016-09-28 10:52:27 +10:00
Adrian Danis
d507b2d39e SELFOUR-421 Introduce explicit device frames and untypeds
Kernel objects cannot be created from device untypeds, with the
exception of frames, which do not get zeroed and cannot be used
as an IPC buffer. Device untypeds additionally cannot be used
in the construction of ASID pools.

This then changes the API to the rootserver (i.e. bootinfo) to
send device untypeds instead of device frames. On ARM these
device untypeds are the same as the previously exported device
frame regions. On x86 PCI scanning is removed and all physical
memory addresses (that are not important for kernel integrity)
are released to the user.

In order to have bits in the frame and untyped caps on ARM the
number of software ASIDs had to be reduced from 2^18 to 2^17,
and the maximum untyped size reduced from 2^31 to 2^30
2016-09-23 14:15:08 +10:00
Kent McLeod
41ec5cf754 SELFOUR-537: Support for raspberry pi3 2016-09-19 15:53:53 +10:00
Hesham Almatary
09358f9b6a SELFOUR-448 Benchmark: Track thread's CPU utilisation time 2016-06-24 12:43:09 +10:00
Adrian Danis
5578c55df3 trivial: fix previous merge 2016-06-21 14:44:53 +10:00
Adrian Danis
6cd10e9369 Merge branch master into arm_hyp 2016-06-21 08:50:15 +10:00
Adrian Danis
82034bbc02 Merge branch master with arm_hyp 2016-06-17 09:57:07 +10:00
Matthew Fernandez
f403c347c8 Kconfig: Simplify ARM platform selection.
This commit leaves all config variables intact, but refactors the menu to
obviate the need to know the CPU and ARM version of your target platform in
order to locate it.
2016-06-16 16:47:37 +10:00
Anna Lyons
88e4a1274a Refactor benchmark menu
Make it impossible to define ENABLE_BENCHMARKS without one
of the benchmarking features defined. Previously this would
result in the kernel not compiling.
2016-06-15 15:40:18 +10:00
Adrian Danis
5f0ae410f4 arm-hyp: Minor cleanups
Cleanup some small licensing, whitespace and configuration details
2016-06-06 11:51:58 +10:00
Adrian Danis
c64ae63e5c Merge branch master into arm_hyp 2016-06-06 11:51:46 +10:00
Hesham Almatary
95909cd8bc Default MAX_NUM_TRACE_POINTS to 0 for compatibility
Some libraries and apps assume MAX_NUM_TRACE_POINTS = 0
if benchmarks are disabled.
2016-06-02 12:29:16 +10:00
Adrian Danis
b001bc4489 Merge branch 'master' into 'arm_hyp'
Conflicts:
	Kconfig
	libsel4/tools/syscall_stub_gen.py
	src/plat/exynos5/machine/hardware.c
	src/plat/tk1/machine/Makefile
	src/plat/tk1/machine/hardware.c
2016-06-02 10:57:12 +10:00
Hesham Almatary
46698d5383 Merge pull request #192 in SEL4/sel4 from ~HALMATARY/sel4:feature/syscall_bench2 to master
* commit 'bcf0a235b114fe8c24c3a187f55c67c373f259d3':
  SELFOUR-446 Unify code base for trace points and track feature
  SELFOUR-446 Benchmark: Track interrupts and user/vm faults
  Fix: move seL4_LogBufferSize to the correct file
  SELFOUR-446 Benchmark: Track syscall feature
2016-06-02 00:53:20 +00:00
amrzar
128768edac Add support for armV8 and Hikey 32bit 2016-06-01 14:15:29 +10:00
Hesham Almatary
7cbaeb8ed0 SELFOUR-446 Benchmark: Track interrupts and user/vm faults 2016-05-31 08:54:57 +10:00
Yanyan Shen
eee71654b2 arm-hyp/tk1: add ARM_HYP as a dependency 2016-05-27 12:45:51 +10:00
Yanyan Shen
bb9e84e6ec arm-hyp/tk1: add default SMMU translation for VM 2016-05-25 16:31:26 +10:00
Hesham Almatary
fc1feb670e SELFOUR-446 Benchmark: Track syscall feature
Benchmark feature that currently:
- Keeps track of system calls info
- Start time
- Duration
- Capability type
- Invocation tag
- Log the number of invocations of each system call*
- Log the number of invocations for each capability type per syscall.
- Has 3 new syscalls (dump, reset, get size).
- This new feature uses the existing log buffer (which is 1MiB for x86
and ARM). Since the number of syscall invocations is not
deterministic, the logged number of invocations is limited by the size
of the buffer. I suggested to enable the users to pass their own
user-level buffer, to enable more flexibility, later.
- ENABLE_BENCHMARKS is now a parent config option of trace points and
system call track features, they can't be used at the same time.
2016-05-25 13:47:49 +10:00
Adrian Danis
9aeee98792 SELFOUR-449 Implement user stack trace on double fault 2016-05-25 12:07:23 +10:00
Adrian Danis
541289a326 Further separate 'release' and 'verification' builds
Originally building the kernel was largely considered to be done in
one of two ways
1. Release build with no assertions, no debug symbols and no printing.
   This was generally considered to be a 'verified' build
2. Debug build with assertions, debug symbols and printing

Since then various options were added, such as the 'code injection'
option, which we wanted on builds that did not have assertions or
other options that affected performance. As such it did not depend
upon a debug build and had large warning signs saying that enabling
this in a release build would not give you a verified or trusted
kernel.

Most recently the ability to print from the kernel in release mode
was added. For the same reason that tying the ability to print with
the performance reduction of various debugging was not always desireable.

This change attempts to unify the current state and have a single top
level option to enable a 'verification friendly' build. All other
options (assertions, printing, code injection) then depend upon
this configuration not being set.
2016-05-17 10:51:55 +10:00