Commit graph

365 commits

Author SHA1 Message Date
Yanyan Shen
d8d006fab9 armv8/hyp: Add armHSCurVCPU and armHSVCPUActive 2018-03-28 12:15:09 +11:00
Yanyan Shen
2a7076177f armv8: Use array regs in vcpu for aarch64 2018-03-28 12:15:09 +11:00
Yanyan Shen
0b71b332c1 armv8: Add VCPU_PTR and VCPU_REF 2018-03-28 12:15:09 +11:00
Yanyan Shen
942b1bd2a9 armv8: Add VCPU_SIZE_BITS for EL2 2018-03-28 12:15:09 +11:00
Yanyan Shen
e289a0526c armv8: Add tcbVCPU for EL2 arch_tcb 2018-03-28 12:15:09 +11:00
Yanyan Shen
544c73b4cb armv8: Handle SPSR_EL1 in sanitiseRegister for VMs 2018-03-28 12:15:04 +11:00
Yanyan Shen
7246586310 armv8: Define PPTR_TOP for EL2 2018-03-28 12:11:33 +11:00
Yanyan Shen
4a67506cd3 armv8: Add EL2 support for kernel exit code 2018-03-28 11:17:58 +11:00
Yanyan Shen
a47d4b8759 armv8: Generalise ESR shift and constants 2018-03-28 11:17:58 +11:00
Yanyan Shen
a5e683b70f armv8: Extend AttrIndx to 4-bit for stage-2 2018-03-23 17:39:49 +11:00
Yanyan Shen
894f3b9d94 armv8: Add virq types 2018-03-23 17:39:49 +11:00
Yanyan Shen
ba0da28e30 armv8: Add VGICMaintenance and VCPUFault 2018-03-23 17:39:49 +11:00
Yanyan Shen
5a8b96000c armv8: Add vcpu_cap 2018-03-23 17:39:49 +11:00
Yanyan Shen
e7c2c8b1a1 armv8: EL2 uses 48-bit base without sign extension 2018-03-23 17:39:49 +11:00
Yanyan Shen
1157c708fa arm: Remove duplicate extern declarations. 2018-03-14 20:26:13 +11:00
Yanyan Shen
f001f7b22e armv8: Add checkTCR_EL2 function. 2018-03-14 14:02:35 +11:00
Yanyan Shen
cd4854f4de armv8: Get CPU index from TPIDR_EL2 when SMP&&HYP. 2018-03-14 14:02:35 +11:00
Yanyan Shen
56b03faeb6 armv8: Add address translation helper functions. 2018-03-14 14:02:35 +11:00
Yanyan Shen
bef8a955c1 armv8: Get ESR and FAR according to current EL. 2018-03-14 14:02:35 +11:00
Yanyan Shen
abe01d34f9 armv8: Invalidate local TLB according to EL. 2018-03-14 14:02:35 +11:00
Yanyan Shen
33bc152dc7 armv8: Add functions to invalidate all TLB entries. 2018-03-14 14:02:35 +11:00
Yanyan Shen
d4770d4d44 armv8: Set vector table according to current EL. 2018-03-14 14:02:35 +11:00
Yanyan Shen
a0a306fc83 armv8: Add getVTTBR() to read VTTBR_EL2. 2018-03-14 14:02:35 +11:00
Yanyan Shen
3ce9b94239 armv8: Use VTTBR_EL2 as user VSpaceRoot in EL2. 2018-03-14 14:02:35 +11:00
Yanyan Shen
d5e763e028 armv8: Use TTBR0_EL2 as kernel VSpaceRoot in EL2. 2018-03-14 14:02:35 +11:00
Yanyan Shen
f1849ef878 armv8: Add EL2 support for writeTPIDRPRW function. 2018-03-14 14:02:35 +11:00
Sebastian Holzapfel
60aac65c99 ARM/v7-a: Force -O2 compilation of idle thread
This fixes a problem with -O0 SMP builds on ARM visible as kernel
data aborts whenever the idle thread executes.

The idle thread receives no stack pointer. At -O2, this is fine
as the wfi() call is inlined and stack operations in idle_thread
are optimized out. At -O0, the stack operations remain and wfi()
is not inlined, resulting in stack accesses in the idle thread
that cause data aborts.

Forcing -O2 behaviour was deemed the simplest solution for now.
Giving the idle thread a stack would have had larger verification
ramifications for what is now a fairly uncommon use case.
2018-03-13 13:09:47 +11:00
Yanyan Shen
81aed11952 armv8: Add PSTATE_IDLETHREAD for EL2. 2018-03-05 14:47:12 +11:00
Yanyan Shen
ff34f8895a armv8: Add SCTLR EL1 stack alignment check field. 2018-03-05 13:42:15 +11:00
Yanyan Shen
d46d4be043 armv8: Define CNT_TVAL and CNT_CTL for EL2. 2018-03-01 16:00:39 +11:00
Yanyan Shen
0da9ff1b67 aarch64: Correct the CPUID_MASK 2018-02-27 11:52:29 +11:00
Adrian Danis
d4d1613f6c Arch abstract for postCapDeletion
Allows architectures to define their own operations for post deletion of capabilities.
The Arch_ variants could be extended to Mode_ if desired in the future, but there is
no need to do this until it is necessary.
2018-02-23 10:03:50 +11:00
Adrian Danis
2cfff40d9d Allow Arch_finaliseCap to return cleanup information
Changes Arch_finaliseCap and Mode_finaliseCap to return the same finaliseCap_ret_t type
as finaliseCap. This allows the Arch and Mode specific functions to define cleanup
information of its capabilities if necessary, just like the generic capabilities can
in finaliseCap.
2018-02-23 10:03:50 +11:00
Yanyan Shen
1936323e48 armv8: Add SMP support for aarch64
(1) Use NODE_STATE() to access per-core kernel data.
(2) Allocate kernel stack in src/arch/arm/64/head.S.
(3) Use the TPIDR_EL1 to contain the kernel stack pointer
    as well as the logical core ID. The kernel stack must
    be 4-KiB aligned, and the lowest 12 bits of TPIDR_EL1
    are for the logical core ID.
(4) Define the LD_EX, ST_EX, and OP_WIDTH as "ldxr", "stxr",
    and "w".
(5) Add irq_remote_call_ipi and irq_reschedule_ipi
2018-01-24 10:26:33 +11:00
Yanyan Shen
f92af27aec arm: add LD_EX, ST_EX, OP_WIDTH macros for ARM
The macros are used in try_arch_atomic_exchange function, and
they will be replaced by "ldrex", "strex", and null.
2018-01-24 10:18:02 +11:00
Yanyan Shen
13343815e3 armv8: add macro L1_CACHE_LINE_SIZE for aarch64 2018-01-24 09:35:50 +11:00
Adrian Danis
252e0a82a7 aarch64: Declare base pointer size to be 48 bits to match x86
This matches the change in ee96314840
2017-12-20 16:13:43 +11:00
Anna Lyons
6d25d1e94a Fix armv6 CCNT definition 2017-12-19 13:46:09 +11:00
Bamboo
a32264bfb5 [STYLE_FIX] 2017-11-28 00:02:37 +00:00
Anna Lyons
cddc4e6ef5 Inline resetTimer for all platforms
- for arm generic timer platforms, we remove resetTimer ->
resetGenericTimer indirection and simply include generic_timer.h
- this reduces boiler plate for platforms that share timer drivers, as
  they simply include the one header
- there is far more timer code in the RT kernel, which motivates this
change
2017-11-28 10:21:46 +11:00
Anna Lyons
5ec0a36f86 Move arm generic timer initTimer to c file
This prepares to inline the resetTimer definition from generic_timer.h
without creating a mess of circular includes
2017-11-28 10:21:46 +11:00
Anna Lyons
c89b9828db Make TIMER_CLOCK_HZ available in timer.h for ARM
The RT kernel needs this value accessible to common functions.
2017-11-28 10:21:46 +11:00
Anna Lyons
de45ae1457 Move arm generic timer to own header
Only platforms that use it should include the code
2017-11-28 10:21:46 +11:00
Anna Lyons
2f7d3bb9b0 Move definition of initTimer to be arm specific
initTimer does not exist on x86
2017-11-28 10:21:46 +11:00
Anna Lyons
8397feae4a aarch64: implement cycle counter, PMU
- add timestamp(), timestamp_t for aarch64
- implement CONFIG_EXPORT_PMU_USER
2017-11-28 10:14:12 +11:00
Anna Lyons
e753404913 Provide a general ARM timestamp function
Use SYSTEM_READ_WORD, each platform defines the CCNT constant.
2017-11-28 10:14:12 +11:00
Anna Lyons
3017f9b72a Move timestamp_t definition to types.h
it was causing circular references in files where it is defined and
hardware macros are also used.
2017-11-28 10:13:49 +11:00
Hesham Almatary
3d2ae69f9c ARM/SMP: Re-implement atomic exchange taking sel4 IPI into account 2017-11-23 14:35:54 +11:00
Anna Lyons
49a26db19d Combine common arm generic timer code
Previously both aarch32 and aarch64 duplicated common
generic timer code. Unify them in include/arch/arm/machine/timer.h
2017-11-20 14:37:55 +11:00
Anna Lyons
3de2b5cfe9 Initialise gpt_cnt_tval to squash compiler warning 2017-11-20 14:37:55 +11:00