Commit graph

261 commits

Author SHA1 Message Date
Adrian Danis
6d6b047b2d Minor fixes for other ARM platforms 2016-06-07 13:35:55 +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
Adrian Danis
6915cf03be x86: Update autoconf.h for standalone builds 2016-06-03 09:42:37 +10:00
Adrian Danis
93bca86e40 x86: Introduce support for XSAVE feature set
The XSAVE feature set is the future proof way for x86 CPUs to
manage extended CPU state. Extended state is MMX, FPU, SSE, AVX etc
registers. This is a replacement for the current FXSAVE and the
512 byte FPU region.

XSAVE introduces a few problems that this commit has to address

* The alignment of the XSAVE region is 64bytes, instead of the 16
  bytes of the FXSAVE region
* XSAVE region size is dependent on the desired features, which
  are detected at run time
* There are multiple variants of the XSAVE instruction that have
  different potential optimizations, but are not always supported

The solutions to these are

* Re-order the FPU state and user registers in the user context
  struct so that the new XSAVE region is first, and is thus
  aligned to 64bytes without needing lots of padding
* Provide config options for desired features (including XSAVE
  instruction variant) and required XSAVE region size. These
  are checked at boot time to ensure the CPU meets these
  requirements
2016-06-02 11:06:37 +10:00
Adrian Danis
96bcba168b x86: Add functions for writing to the extended control registers 2016-06-02 11:06:37 +10:00
Adrian Danis
1cb58c1f37 Add config_default macro
This macro allows for using the value of a CONFIG_ variable in situations
where it may not be defined. This could be due to it being a dependency
on another CONFIG_ variable that is not currently defined. This arrises
from code blocks like

if (config_set(CONFIG_FOO)) {
    return CONFIG_VAR_DEPENDS_ON_FOO;
}

This will not compile when CONFIG_FOO is not set. Using

return config_default(CONFIG_VAR_DEPENDS_ON_FOO, 42);

Provides a way for this to be built
2016-06-02 11:06:07 +10:00
Adrian Danis
e667a7e04b x86: Add missing CR4 bit definition 2016-06-02 11:06:07 +10:00
Adrian Danis
58f26d2f30 x86: Add missing CPUID functions 2016-06-02 11:06:07 +10:00
Adrian Danis
2516e65cfa x86: Add XSS MSR definition 2016-06-02 11:06:07 +10:00
Adrian Danis
4d76c71e31 x86: Calculate register offset from structures
The address being calculated is the end of the user context array.
There is no need for this to be done as a magic number offset
from the tcb_t, this commit takes an index into the actual array,
using the constant that is defined as the length of that array.
2016-06-02 11:06:07 +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
Hesham Almatary
bcf0a235b1 SELFOUR-446 Unify code base for trace points and track feature 2016-06-02 10:49:25 +10: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
dfb3551eef arm-hyp/tk1: address review comment 2016-05-30 16:33:28 +10:00
Yanyan Shen
c85094bb75 arm-hyp/tk1: add guards so other plats can compile. 2016-05-30 15:37:22 +10:00
Yanyan Shen
55f8b14417 arm-hyp/tk1: address review comments. 2016-05-27 11:00:01 +10:00
Yanyan Shen
27ecdffe3c arm-hyp/tk1: address review comments. 2016-05-27 00:16:53 +10:00
Adrian Danis
16b1bcf0a8 SELFOUR-489: Remove 'bound' field from TCBs
Its probable this was meant to be a boolean flag to represent
whether or not the TCB had a bound notification object. However,
this field is unused and its presence is confusing.
2016-05-26 10:17:19 +10:00
Yanyan Shen
5650a8fa84 arm-hyp/tk1: make style 2016-05-25 16:35:02 +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
bbdf7a89a7 Mark tlbLockCount as visible so it is not discarded
This variable is referenced in assembler and needs to not get discarded
by the optimizer prior to linking.
2016-05-24 08:46:54 +10:00
Felix Kam
39a2c4f108 Merge pull request #181 in SEL4/sel4 from ~FKAM/sel4:lockTLBEntryPatch to master
* commit 'b9a7f3c9a13ff7e997e28b63676a1dd2a1b7f381':
  Make lockTLBEntry comply with the decompiler
2016-05-23 06:30:42 +00:00
Adrian Danis
0c1d959b0e x86: Define Additional MSRs
Define these MSRs in preparation for their use on the x86_64 port
2016-05-23 14:17:36 +10:00
Yanyan Shen
17ec138bf2 arm-hyp/tk1: enable SMMU interrupts 2016-05-20 17:05:44 +10:00
Yanyan Shen
a56c5ff16e Merge branch 'feature/arm_hyp_tk1' of ssh://bitbucket:7999/~yshen/sel4k into feature/arm_hyp_tk1 2016-05-20 12:24:52 +10:00
Yanyan Shen
b1e4f92fbd arm-hyp/tk1: reserve the SMMU interrupt 2016-05-20 12:23:51 +10:00
Yanyan Shen
11720f23ad arm-hyp/tk1: fix bugs found during testing 2016-05-20 00:00:46 +10:00
Adrian Danis
086b5192c5 Merge pull request #180 in SEL4/sel4 from ~ADANIS/sel4:printing to master
* commit '1287590e9736f48e30b42fe678f2bf081a8c1874':
  Correct separation of printing and debug builds
2016-05-19 00:17:03 +00:00
Felix Kam
b9a7f3c9a1 Make lockTLBEntry comply with the decompiler
lockTLBEntry, an assembly function, had tlb_lock_count as a symbol that
needed to be placed sufficiently close to be loaded and stored with
offset-from-pc addressing. When assembled, the symbol would turn up
between functions, as opposed to within a literal pool (it's a variable,
not a constant) or the .bss / data sections. The decompiler doesn't
handle that use case, and likely won't.  This change turns
tlb_lock_count into a C global variable (so that it will be placed in
the .bss / data sections), and splits lockTLBEntry into two parts so the
critical section will still fit in a 64-byte aligned region, and
therefore be guaranteed to live within a single page.
2016-05-18 16:53:13 +10:00
Adrian Danis
1c1e976de2 x86: Improve translation invalidation
x86_64 (with PCIDs enabled) supports a more fine grained invalidation
approach for the TLB and Page Structure Cache. This change expands
the number and kinds of information passed for certain invalidations,
and provides an implementation of this for ia32.
2016-05-18 13:49:28 +10:00
Adrian Danis
1287590e97 Correct separation of printing and debug builds
Fixes some build issues with 541289a326
as well as further allowing debugging (via the capdl interface) to
happen when printing is turned off.
2016-05-17 15:10:08 +10:00
Yanyan Shen
508e87477f arm/tk1: connect objects with SMMU invocations 2016-05-17 12:16:34 +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
Yanyan Shen
55e58e1a41 arm/tk1: a checkpoint for iospace.c 2016-05-13 22:40:13 +10:00
Yanyan Shen
879d9724c1 arm/tk1: a checkpoint for SMMU implementation 2016-05-13 16:42:53 +10:00
Yanyan Shen
c4692926a8 arm_hyp/tk1: address review comments 2016-05-10 13:15:08 +10:00
Yanyan Shen
454efecbcf Merge branch 'feature/arm_hyp_tk1' of ssh://bitbucket:7999/~yshen/sel4k into feature/arm_hyp_tk1 2016-05-04 17:05:34 +10:00
Yanyan Shen
fa9b6e4312 arm/tk1: addresses/interrupts for hyp mode 2016-05-04 16:53:27 +10:00
Yanyan Shen
c13eeffddc arm/tk1: add system MMU structures for TK1 2016-05-04 16:42:35 +10:00
Yanyan Shen
4d8f933aba arm/arm_hyp: replace macros with explicit inline 2016-03-24 12:52:38 +11:00
Yanyan Shen
67bcf2357c arm_hyp: rm ARM_HYP ifdefs; func inline assembly
vcpu.c:
encapsulate inline assembly into inline functions that added to
device_pl2.h file.

other files:
replace #ifdef ARM_HYP with config_set(ARM_HYP)
2016-03-24 12:42:19 +11:00
Yanyan Shen
d195a02b91 arm_hyp: remove unused function declaration.
remove map_hypervisor_devices function declaration.
2016-03-24 12:42:19 +11:00
Yanyan Shen
cbb6bf15d1 arm_hyp: add file to contain hyp mode inline funcs
machine_pl2.h:
new place for hyp mode inline functions.

boot.c:
replace #ifdef ARM_HYP with config_set(ARM_HYP).

vcpu.h, machine_pl2.h:
add empty functions when ARM_HYP is not defined to
pass compilation.
2016-03-24 12:42:19 +11:00
Adrian Danis
6932e6a725 Merge branch master into arm_hyp 2016-03-22 16:48:52 +11:00
Yanyan Shen
cc729fab45 Merge pull request #145 in SEL4/sel4 from ~YSHEN/sel4k:feature/tk1 to master
* commit 'b9410822c17886309021671ac547589f4f76db05':
  arm/tk1: add support for Nvidia Tegra K1 board
2016-03-22 05:31:49 +00:00