Commit graph

1207 commits

Author SHA1 Message Date
Anna Lyons
9dcb470631 arm: remove plat/machine/timer.h
plat/machine/timer.h is unused on arm, so remove it and fix up the
includes.
2019-06-17 10:44:36 +10:00
Anna Lyons
f5b820e9b9 benchmark: remove unused function
Remove benchmark_utilisation_kentry_stamp.
2019-06-14 14:11:09 +10:00
Anna Lyons
18eefea980 trivial: use UINT32_MAX 2019-06-14 14:11:09 +10:00
Anna Lyons
3e0bbe8245 arm: clean & consolidate pmu management code
- consolidate armv_init_ccnt into arm_init_ccnt, which is general
 - move armv_handleOverflowIRQ definition to benchmark.h
   (no need for extra header)
 - clean up definition of armv_handleOverflowIRQ
2019-06-14 14:11:09 +10:00
Anna Lyons
65529552dc trivial: add missing config include 2019-06-14 12:12:15 +10:00
Anna Lyons
c090b058a5 arm: consolidate benchmark_arch_utilisation_reset
- Move identical definitions from armv6 and armv7 to common arm code.
- Remove excessive #ifdef guards - let the compiler throw it away if
  it isn't used
2019-06-14 12:12:15 +10:00
Anna Lyons
a7728128cd arm: move handleOverflowIRQ to benchmark.h
Consolidate to reduce include complexity and make benchmarking features
easier to find/comprehend.
2019-06-14 12:12:15 +10:00
Anna Lyons
d4868012f8 arm: always handle overflow irqs
Always handle overflow irqs from the cycle counter if overflow irqs are
enabled, not just when we are updating the log. Otherwise if logging
isn't enabled but the counter overflows the kernel will be stuck in a
interrupt handling loop.
2019-06-14 12:12:15 +10:00
Anna Lyons
e2a7c49de6 arm: use NODE_STATE in benchmark_overflowHandler
This code did not compile prior to this change.
2019-06-14 12:12:15 +10:00
Adrian Danis
7c1a705336 SELFOUR-1198: correct restart PC
Fixes a case where a thread can go from Running->Inactive->Restart and use a restart PC
that is out of date. An out of date restart PC occurs when a thread was transitioned to
running after being in a blocked state, but was never scheduled and so did not execute
the traps code that updates the restart PC.

A 'more correct' fix would be to update the restart PC when a thread is first transitioned
to Running, but this results in lots of unnecessary update as
 * Frequently immediately schedule a thread after it is transitioned to running, making
   the update to restart PC completely redundant as it gets immediately overwritten
 * Rarely suspend threads making all the updates a 'high' cost for fixing an infrequent
   operation

As a result this solution lazily fixes the restart PC only when we enter a state where
we might need a correct restart PC, which currently in the kernel is only when we
go from Running->Inactive, which can only happen in `suspend`
2019-05-31 14:45:47 +10:00
Curtis Millar
01b73622f5 Consistent naming of FaultIP and NextIP in kernel
Always refer to the virtual register that stores the address of a fault
as FaultIP and the register that stores the return for a fault NextIP.
2019-05-28 15:12:38 +10:00
Sylvain Gauthier
84e6d4cdb1 Added IRQ routing to specific core for ARM
Add a new syscall, `seL4_IRQControl_GetTriggerCore`, to get a IRQHandler
with specific target core(s) and trigger method. Only available in SMP
mode.
2019-05-20 10:01:40 +10:00
Yanyan Shen
a0ae9f76a1 armv8: Save/restore TPIDRRO_EL0 for VCPUs
TPIDRRO_EL0 is used as IPC Buffer for seL4-native threads.
The register should be saved and restored for VCPUs.
2019-05-17 14:33:42 +10:00
Matthew Brecknell
c030cafad2 x86 boot: pass mem_p_regs by pointer
This avoids taking the address of a local variable in arch_init_freemem,
which is not supported by the Isabelle C parser.
2019-05-15 14:03:40 +10:00
Anna Lyons
8a6180f4b3 arm: make mode reserved regions a constant
Replace an unneccessary function call with a constant. This simplifies
and increases the maintainability of arch_init_freemem.
2019-05-15 14:03:40 +10:00
Anna Lyons
661e8efebb arm: merge redundant hardware.c
hardware.c was defined for both 32 and 64 bit arm kernels. However, the
only difference in the file is the register used in setNextPC. Add this
register as a #define in registerset.h, move hardware.c to be common for
both 32- and 64-bit arm.
2019-05-15 14:03:40 +10:00
Anna Lyons
e3a83035f8 boot: consolidate init_freemem
init_freemem sets up available regions of memory for the hardware that
seL4 is booting on. Previously this function was duplicated across
architectures, with minor duplication.

This change provides a top-level init_freemem suitable for all
architectures.

- arm/riscv: change get_avail_p_reg to return whole p_reg array
- update all architectures to use new init_freemem.
- wrap init_freemem calls with arch_init_freemem for each arch, where
arch_init_freemem sets up the available and reserved regions of memory
which are passed to init_freemem.
2019-05-15 14:03:40 +10:00
Anna Lyons
67f2de94a1 trivial: riscv - remove unused function prototype 2019-05-15 14:03:40 +10:00
Anna Lyons
41780b0602 x64: add missing constant PPTR_TOP
PPTR_TOP represents the top that can be made available to the
user as untyped.
2019-05-15 14:03:40 +10:00
Yanyan Shen
134eb53e31 aarch64: Correct tpidrro_el0 2019-05-14 13:15:50 +10:00
Jasper Lowell
69339d4203 Boot code: Statically allocate idle thread
The idle thread is not managed at user-level and so it can instead be
statically allocated. This simplifies the boot code and increments
towards being easier to formally verify.
2019-05-07 12:21:31 +10:00
Kofi Doku Atuah
c3766ccd16 ARM, HYP, CP14, Debug: Don't deliver CP14 accesses to userspace as faults
Persuant to the fact that userspace cannot save and restore the debug coprocessor,
there is no point in delivering a fault message to userspace when CP14 is accessed.

The debug coprocessor must be entirely handled by the kernel, and a new hardware
accessor and manipulation capability must be designed and implemented now.
2019-05-06 14:34:19 +10:00
Matthew Brecknell
1c6c06dc3e boot: implement intStateIRQNode as an array
It turns out that verifying this is easier than if intStateIRQNode is a
pointer that is statically initialised to point to another array.
2019-05-03 16:19:19 +10:00
Anna Lyons
a6b4cf739d boot: allocate irq cnode statically
The memory used for the irq cnode is never available to the user. As a
result this memory can be allocated statically, simplifying the
bootcode.

- remove allocation of irq cnode
- add static init
- generate irq cnode size from cmake for arm
- add static constants for riscv, x86 as there is no variability at the
moment.
2019-05-03 16:18:39 +10:00
Simon Shields
6a31a57ef8 ARM: optionally pass bootloader DTB to userspace
We now support receiving a DTB from the ELF loader and passing it on
to userspace in extra bootinfo. We still support booting without a DTB,
though - the device tree address is set to zero in the boot code and no
extra bootinfo region is provided.
2019-05-01 12:18:52 +10:00
Kent McLeod
d250dc03c7 spike: Use sip CSR for isIRQPending
An instruction is pending if the STIP or SEIP bits are set in the sip
CSR.
2019-05-01 11:00:11 +10:00
Anna Lyons
f7c43820d2 trivial: fix #ifdef on am335x 2019-04-15 08:47:32 +10:00
Anna Lyons
2c05d13c40 trivial: arm_hyp - fix build 2019-04-12 14:47:46 +10:00
Anna Lyons
82d0485911 arm: priv_timer -> include/drivers/timer/arm_priv
update configs that use it.
2019-04-12 14:25:58 +10:00
Anna Lyons
391b717d1d arm: generic_timer -> drivers/timer/arm_generic
- move generic_timer.h to drivers/timer/arm_generic.h
- update all configs that use it.
2019-04-12 14:25:58 +10:00
Anna Lyons
cb9499069d zynqmp: use declare_default_headers
- remove unused header files replaced by declare_default_headers
2019-04-12 14:25:58 +10:00
Anna Lyons
66df769f8c zynq7000: use declare_default_headers
- remove unused header files replaced by declare_default_headers
2019-04-12 14:25:58 +10:00
Anna Lyons
26a3b55521 omap3: use declare_default_headers
- remove unused header files replaced by declare_default_headers
- move timer.h to drivers/timer/omap3430.h
- move interrupt.h to drivers/irq/omap3.h
2019-04-12 14:25:58 +10:00
Anna Lyons
df4d19ae5f imx7: use declare_default_headers
- remove unused header files replaced by declare_default_headers
2019-04-12 14:25:58 +10:00
Anna Lyons
e4f567e19e imx6: use declare_default_headers
- remove unused header files replaced by declare_default_headers
2019-04-12 14:25:58 +10:00
Anna Lyons
7bf513b75e imx31: use declare_default_headers
- remove unused header files replaced by declare_default_headers
- move interrupt.h -> drivers/irq/imx31.h
- move hardware.bf -> drivers/timer/imx31-epit.bf
- move timer.h -> drivers/timer/imx31-epit.h
- move definitions from hardware.h to plat/imx31/machine/hardware.c
2019-04-12 14:25:58 +10:00
Anna Lyons
209563d4ca hikey: use declare_default_headers
- remove unused header files replaced by declare_default_headers
2019-04-12 14:25:58 +10:00
Anna Lyons
e1a36c2601 exynos: use declare_default_headers
- remove unused header files replaced by declare_default_headers
- move timer.h to drivers/timer/exynos5422-mct.h
- move mct.h to drivers/timer/mct.h
2019-04-12 14:25:58 +10:00
Anna Lyons
474a7da5c0 bcm2837: use declare_default_headers
- remove unused header files replaced by declare_default_headers
- move machine.h to drivers/irq/bcm2836-armctrl-ic.h
2019-04-12 14:25:58 +10:00
Anna Lyons
2d77062df4 apq8064: use declare_default_headers
- remove unused header files replaced by declare_default_headers
2019-04-12 14:25:58 +10:00
Anna Lyons
a69c3f0f9c am335x: use declare_default_headers
- move timer.h to include/drivers/timer/am335x.h
- move interrupt.h to include/drivers/irq/am335x.h
- remove unused header files replaced by declare_default_headers
2019-04-12 14:25:58 +10:00
Anna Lyons
0a4ffd0a9a allwinnerA20: use declare_default_headers
- move timer.h to include/drivers/timer/allwinner.h
- remove unused header files replaced by declare_default_headers
2019-04-12 14:25:58 +10:00
Kent McLeod
78c8ac9fae tx2: use declare_default_headers
- remove unused header files replaced by declare_default_headers
2019-04-12 14:25:58 +10:00
Kent McLeod
e86190839e tx1: use declare_default_headers
- remove unused header files replaced by declare_default_headers
2019-04-12 14:25:58 +10:00
Kent McLeod
04aabf92ce tk1: use declare_default_headers
- remove unused header files replaced by declare_default_headers
2019-04-12 14:25:58 +10:00
Kent McLeod
d703eab23d cmake: add declare_default_headers
This allows for arm headers to be generated for an arm platform
in include/plat/default that specifies the following:

- maxIRQ
- TIMER_CLOCK_HZ
- the timer header to use
- the interrupt controller header to use
2019-04-12 14:25:53 +10:00
Curtis Millar
f99f6790ab Use more robust check for TCB size
The complex conditions for the AARCH32 TCB size are updated to better
reflect the circumstances in which the TCB will have a particular size.
2019-04-08 11:18:41 +10:00
Curtis Millar
01c7e62cce Update size comments to reflect the size better
This changes the comments regarding the size of the TCB to be more
generally accurate to help manually determine the size of the TCB for
different configurations.
2019-04-08 10:48:32 +10:00
Curtis Millar
49d2a96dbd Add message register macros to ARMv6 2019-04-05 16:13:56 +11:00
Anna Lyons
56de1ad74b aarch64: adjustments to pass c-parser
This commit updates the aarch64 build to pass the c-parser.

- replace 0b constants with decimal
- remove empty array definition
- replace __uint128_t with uint64_t, and double the array size
- remove variable shadowing

No further verification guarantees are provided for aarch64 code.
2019-04-05 15:39:20 +11:00