Commit graph

1053 commits

Author SHA1 Message Date
Adrian Danis
7d7f338b2b arm: Provide TLS_BASE virtual register
This commit provides a universal TLS_BASE virtual register on ARM, similar to as exists
on x86. Depending on the precise configuration this virtual register maps to a different
register
 * aarch64: TPIDRURW is used for the TLS_BASE and is already declared and being saved
   and restored on context switches, so this just adds TLS_BASE as an alias of it
 * armv6: Has no hardware register for use for a TLS_BASE, and so the virtual register
   gets stored into the globals frame
 * armv7+: TPIDURO is used for TLS_BASE and so the restore paths are modified to load
   TLS_BASE into it
2018-07-03 13:34:59 +10:00
Adrian Danis
89297f96e0 arm: Add missing helpers for read/write of TPIDRURO 2018-07-03 13:34:51 +10:00
Anna Lyons
bff7189653 arm: remove assumption that CONFIG_IPC_BUF_* must be set
Previously arm code assumed that either CONFIG_IPC_BUF_TPIDRURW or
CONFIG_IPC_BUF_GLOBALS_FRAME needed to be set. Given that neither of
these options are required for aarch64, remove this assumption and only
guard code with #ifdefs are required.
2018-06-27 16:21:25 +10:00
Yanyan Shen
a160e23db2 arm: Remove redundant comments 2018-06-21 18:34:40 +10:00
Yanyan Shen
2d6fa0d24a arm: Use writeTTBR0Ptr which masks and sets bits 2018-06-21 18:34:40 +10:00
Yanyan Shen
693f7cf2bb armv7/hyp: use break in vcpu_hw_write_reg
C parser does not like void functions attempting to return
with a parameter, even if the parameter has type void.
2018-06-19 16:08:31 +10:00
Yanyan Shen
7e8bbcc527 armv7/hyp: Move armv7 code armv7-a/armv/vcpu.h 2018-06-19 16:08:31 +10:00
Yanyan Shen
997f508fc3 arm/hyp: Add timer functions 2018-06-19 16:08:31 +10:00
Yanyan Shen
da4af02863 arm/hyp: Add setters/getters for SPSR registers 2018-06-19 16:08:31 +10:00
Yanyan Shen
b8673036f5 arm/hyp: Fix style 2018-06-19 16:08:31 +10:00
Yanyan Shen
d6b3321186 arm/hyp: Fix typo TTBRC -> TTBCR 2018-06-19 16:08:31 +10:00
Yanyan Shen
ef13a83a6e arm: Change TTBR0/1 read/write function names.
The following functions, readTTBR0, writeTTBR0, readTTBR1, and
writeTTBR1, write and return raw TTBR0/1 values.
The function writeTTBR0Ptr is added for used in context swtich
functions, and it modify the input physical address before
writing the TTBR0. Places using these functions are also
updated.
2018-06-19 16:08:31 +10:00
Yanyan Shen
81317fb645 arm/hyp: refactor VCPU states
Use an array and constants to replace register names in the VCPU.
2018-06-19 16:08:31 +10:00
Yanyan Shen
60e2acdb56 arm/hyp: add support for running multiple ARM VMs
This commit saves/restores various control registers that can be
modified by guest VM kernels, so seL4 can execute multiple ARM
32-bit VMs multiplexing a single physical core.

When the CONFIG_HAVE_FPU option is selected, the commit allows
the VMs to use FPU registers and enables lazily saving/restoring
FPU registers for the VMs.
2018-06-19 16:08:31 +10:00
Adrian Danis
4cb1d5dfd4 riscv: Define explicit functions for registers
Replaces (read|write|set|clear)_csr macros with explicit functions. This provides a boundary
for verification to reason about the operation.
2018-06-18 14:01:22 +10:00
Adrian Danis
64b7bd9f9c riscv: pte_t type in asid_pool
The asids in risc-v only point to pte_t and so this does not need to be a void* type
2018-06-15 11:39:24 +10:00
Adrian Danis
cc1da13022 riscv: Remove unused register arrays
These arrays use to exist but are no longer used and array definitions such as
SYSCALL_MESSAGE are the new norm. As these have no meaning they are being deleted
to reduce confusion.
2018-06-15 11:38:10 +10:00
Sebastian Holzapfel
5f1d63becf rpi3/aarch64: update linker script & relocate PHYS_BASE
rpi3 documentation states RAM *should* be mapped from 0x00000000 onwards,
but we omit the start of physical memory as it caused early boot issues
on access. Instead use u-boot's default kernel load address as PHYS_BASE.
2018-06-04 13:46:19 +10:00
Sebastian Holzapfel
26b66ba92c rpi3: fix PADDR_OFFSET nit 2018-06-04 13:45:44 +10:00
Sebastian Holzapfel
6033fad28a rpi3/aarch64: add aarch64 memory map 2018-06-04 13:44:08 +10:00
Joel Beeren
5535ed0074 x86: update declaration for decodeX86PortInvocation to use call variable 2018-05-24 05:56:16 +10:00
Nathan Studer
b15d1476d5 Support a PADDR base other than 0
Several of the mapping calculations rollover when dealing with 32-bits due to the location
of memory on spike, the kernel/user window addresses, and the kernel load address.

Adjust the kernel window so that it covers the typical location of memory on
spike.
2018-05-10 12:44:19 -04:00
Yanyan Shen
7cf9aff9e9 armv8/hyp: Call VMID-based TLB functions in EL2 2018-05-01 21:18:27 +10:00
Yanyan Shen
190c44d0d8 armv8: Add invalidateLocalTLB_VMID/IPA_VMID 2018-05-01 21:18:21 +10:00
Yanyan Shen
604f70f607 armv8: Add invalidateLocalTLB_IPA function 2018-05-01 20:59:21 +10:00
Yanyan Shen
0b085a8efb armv8: Add invalidateLocalTLB_VMALLS12E1() 2018-05-01 20:59:21 +10:00
Adrian Danis
5fade8b29f x86: Hide tcbArchEPTRoot when not VTX 2018-04-30 16:08:31 +10:00
Adrian Danis
13f0a4e8d4 riscv: Implement Arch_isCapRevocable 2018-04-26 10:01:47 +10:00
Yanyan Shen
df440f4f18 armv8/hyp: Read/write MDCR_EL2 for debug control 2018-04-25 00:20:49 +10:00
Adrian Danis
de42f82691 x86: Introduce IO port control caps
Changes the way IO ports work such that instead of 'minting' IO port caps down into new
IO port caps with smaller ranges new IO port ranges must be allocated centrally from
an IO port control cap. This mechanism acts in a very similar fashion as IRQ handler/control
capabilities and ensures that allocated IO ports do not overlap. Disallowing overlapping
IO ports is necessary to ensure the CDT remains valid as capabilities are deleted.
2018-04-24 14:04:46 +10:00
Adrian Danis
8081b9ec80 x86: More efficient and verification friendly setIOPortMask
Refactors setIOPortMask to both be more efficient by never operating on individual bits,
whilst still having a structure that is more amenable to verification
2018-04-24 14:04:46 +10:00
Adrian Danis
ca1b785e58 x86: Generic setIOPortMask from VCPU code
Moves the function for manipulating a bitmap of IO ports from VCPU code into common
IO port code. This will be needed in the future by the IO Port control implementation
2018-04-24 14:04:46 +10:00
Adrian Danis
6c7d94a093 Type wrapper for a word_t that may alias 2018-04-24 14:04:46 +10:00
Adrian Danis
7641e43872 Refactor logic for cap revocability in cteInsert into new function with arch case
Revocability of a cap, with respect to its parent, is a general property on caps and
makes sense to be abstracted. This allows for the addition of an arch case without
further complicating the cteInsert function itself.
2018-04-24 14:04:46 +10:00
Yanyan Shen
9acfe72e3f arm: Split TLB functions into local & local+remote
The TLB functions with "Local" postfix only execute on the
current calling core. The functions with the postfix
perform local operations and then IPI remote cores
to perform the same operations if necessary.
2018-04-18 19:09:53 +10:00
Anna Lyons
d3feb06cdd riscv: fix licenses
- add files from elsewhere to the license ignore
- s/D61_BSD/DATA61_BSD
2018-04-18 10:52:02 +10:00
Adrian Danis
679c0b09ed Remove strlen
This is not suitable for verification and strnlen must be used instead.
2018-04-18 10:10:14 +10:00
Adrian Danis
82c997aebe Expose string functions in all builds
These are useful beyond just debug and printing builds
2018-04-18 10:10:14 +10:00
Anna Lyons
1b68590b3f riscv: use one definition of page bits 2018-04-18 10:10:14 +10:00
Adrian Danis
06a66cd1ca trivial: style 2018-04-18 10:10:14 +10:00
Adrian Danis
43e1705280 Remove strcmp
This function causes difficulties for verification and strncmp should be used instead.
2018-04-18 10:10:14 +10:00
Adrian Danis
ddd1e128ba riscv: Remove now out of date todo 2018-04-18 10:10:14 +10:00
Adrian Danis
f5fa2072a5 riscv: Guard potentially undefined page size constants
These pages don't have a defined size on rv32 (i.e. when PT_LEVELS == 2)
2018-04-18 10:10:14 +10:00
Anna Lyons
76c61025ac riscv: remove dev_pregs
We don't have any devices currently, and in future they will be
discovered, not statically specified.
2018-04-18 10:10:14 +10:00
Anna Lyons
b7d4bc1629 riscv: remove trailing whitespace line 2018-04-18 10:10:14 +10:00
Anna Lyons
f68779d76e riscv: move LOAD to hardware.h in mode
removes the #ifdef and uses the dir structure instead.
2018-04-18 10:10:14 +10:00
Adrian Danis
402cc309f1 riscv: Remove bogus L1 cache line size 2018-04-18 10:10:14 +10:00
Adrian Danis
fbe634620c riscv: Remove currently unuspported SMP code 2018-04-18 10:10:14 +10:00
Adrian Danis
eccaed9f70 riscv: Remove currently unsupported FPU 2018-04-18 10:10:14 +10:00
Anna Lyons
99d93ebe04 riscv: correct typo in comment 2018-04-18 10:10:14 +10:00