Commit graph

448 commits

Author SHA1 Message Date
Adrian Danis
ea47c2d4a4 Remove self include 2016-10-21 12:05:02 +11:00
Adrian Danis
ccb2e4b446 Remove circular include
machine/hardware.h is already including machine/interrupt.h
2016-10-21 12:05:02 +11:00
Adrian Danis
80dbdf5ed0 Remove unused include 2016-10-21 12:05:02 +11:00
Adrian Danis
7c08bc25e9 Remove include of basic_types
arm/arch/types.h does not require any definitions from basic_types
(other than those from stdint, which is already directly included)
2016-10-21 12:05:02 +11:00
Adrian Danis
63649f2636 Remove arch/machine.h include from statedata.h
statedata.h gets included from arch/machine.h, and statedata
does not require any of the machine.h definitions.

As a result of removing this various other, previously missing,
includes need to be added
2016-10-21 12:05:02 +11:00
Adrian Danis
b90238d089 Replace #pragma once with include guards 2016-10-21 12:05:02 +11:00
Adrian Danis
d6eafad1a5 Move cap definitions from objecttype into header 2016-10-20 15:45:06 +11:00
Adrian Danis
325643ac19 Remove circular include between debug and benchmark_track
benchmark_track.h does not depend upon anything in debug.h and
so it does not need to include it. Once this include is removed
debug.h can pull its definition of ksKernelEntry from benchmark_track.h
2016-10-20 15:45:06 +11:00
Adrian Danis
c3370f770b x86: Remove circular include
x86/arch/machine/hardware.h gets include via types.h (through the
compound_types.h header). As this header is defining compound types
it really only needs access to the basic types (i.e. stdint.h)
2016-10-20 15:45:06 +11:00
Anna Lyons
49f26d5c84 Fix benchmark_debug_syscall_start
The lowest syscall number is -8, which doesnt' fit in 3 bits -> change
to 4.
Also, we were storing the -ve number, which also doesn't fit into 3
bits -> invert it when we store it.
2016-10-20 15:07:49 +11:00
Adrian Danis
1c50cec9e8 arm: Remove duplicate definitions
PPTR_TOP and KS_LOG_PPTR are defined in the mode headers, this commit
removes the duplicate definitions in the general arm header
2016-10-20 14:12:03 +11:00
Hesham Almatary
423f3eaf4a Merge pull request #423 in SEL4/sel4 from ~HALMATARY/sel4:benchmarkRefine to master
* commit 'e3f764a65be484d89e29ebc22ea406f1438ae3d3':
  Benchmark: move arch-dependent benchmark.c from api/ to new benchmark/ directory
  Benchmark: Pack arch-independent benchmark-related files into separate directories
2016-10-20 02:23:29 +00:00
Hesham Almatary
5f7fa2fcc8 Benchmark: Pack arch-independent benchmark-related files into separate directories 2016-10-20 11:42:04 +11:00
Adrian Danis
59f50c7183 x86: use vspace_root_t type
switchToThread_fp is passed variables of type vspace_root_t, not
pde_t, this commit brings the two into line
2016-10-20 11:07:55 +11:00
Adrian Danis
9396783741 am335x: Prevent out of bounds array access 2016-10-20 10:56:58 +11:00
amrzar
2d462d4ad9 add basic api for setting affinity 2016-10-19 08:35:37 +11:00
Anna Lyons
3a185a5c32 debug: generate list of syscall names 2016-10-18 14:05:41 +11:00
Rafal Kolanski
01e0ed7d9a Merge pull request #406 in SEL4/sel4 from ~ADANIS/sel4:lazyvcpu to master
* commit 'cdc869309b69d04c8682f166755c26cc7a401667':
  arm_hyp: Used cached value for num LRs
  arm_hyp: Add lazy vcpu switching
  arm_hyp: Declare armHSCurVCPU in header
  arm_hyp: Correctly destroy armHSCurVCPU
  arm_hyp: Move hype state into correct statedata header
2016-10-17 04:25:01 +00:00
Adrian Danis
cfe0f8e9db x64: Support for hardware debugging when using SYSENTER
Hardware debugging was already supported if using SYSCALL for kernel
invocations, this adds support for when using SYSENTER. SYSENTER
is special because when entering the kernel the TF flag is not masked,
so the case of taking a debug exception in the kernel needs to be
handled. Also, unlike ia32, there is a race between performing
popf and calling sysexit where interrupts can be received. This race
is avoided by performing a full state restore with iret if a thread
is single stepping.
2016-10-14 15:47:16 +11:00
Adrian Danis
2a1d1e94d7 arm_hyp: Add lazy vcpu switching 2016-10-14 14:24:12 +11:00
Adrian Danis
04612f16c6 arm_hyp: Declare armHSCurVCPU in header 2016-10-14 14:24:12 +11:00
Adrian Danis
fdad50853a arm_hyp: Move hype state into correct statedata header
The hypervisor state is declared in arch/32/statedata.c, but is
defined in arch/statedata.h. This commit moves the definitions to
arch/32/statedata.h to match all the other state in arch/32/statedata.c
2016-10-14 14:24:12 +11:00
Amirreza Zarrabi
36e5db7aac Merge pull request #399 in SEL4/sel4 from ~AZARRABI/sel4:smp_idle to master
* commit '1887ae9dce65c3a32df244c19b635cbe5e3d72bf':
  Update SMP idle thread handling
2016-10-14 00:22:46 +00:00
amrzar
1887ae9dce Update SMP idle thread handling 2016-10-14 11:15:39 +11:00
Adrian Danis
235a02ec4e x86: Use FLAGS_* defines instead of magic numbers 2016-10-13 16:58:27 +11:00
Adrian Danis
b01cf7f0d7 x86: Make stack.h a mode specific header
The functionality of setKernelEntryStackPointer is all ia32 specific and
this commit moves this to a mode specific include location
2016-10-13 16:49:11 +11:00
Adrian Danis
a4c014ca8e x64: Missing c_exit_hook 2016-10-13 15:26:37 +11:00
Adrian Danis
d1d4568114 x86: Define FLAGS bits instead of having magic numbers 2016-10-12 14:38:00 +11:00
Adrian Danis
a3c88cfc5b pc99: Update autoconf.h for standalone builds 2016-10-12 14:18:55 +11:00
Bamboo
f062dcdcf9 [STYLE_FIX] 2016-10-12 03:07:32 +00:00
Adrian Danis
6d07c44329 x64: Partial hardware breakpoint support
This only implementes debug support if using the SYSCALL kernel invocation
method, will not work yet with SYSENTER
2016-10-12 13:38:37 +11:00
Adrian Danis
6294225ca7 x86: Rename [ER]FLAGS to FLAGS
Having a different name for the FLAGS register creates an unnecessary difference
between ia32 and x86_64 code since regardless of the name/size the bits in the
register mean exactly the same thing
2016-10-12 13:38:35 +11:00
Adrian Danis
e2bf4881c8 x64: Refactor Arch_initContext
Split Arch_initContext into mode and arch portions
2016-10-12 13:38:26 +11:00
Adrian Danis
48df6d3ab4 x64: Define kernelBase for breakpoint code 2016-10-12 12:22:32 +11:00
Adrian Danis
600fe2bc09 x86: Move hardware debug state
Assembly traps rely on the registers and kernel stack being at a
known offset
2016-10-12 12:22:32 +11:00
Adrian Danis
9c1d204eaf x64: Correctly invalidate PCIDs 2016-10-12 12:22:32 +11:00
Adrian Danis
4f09f9c42d x86: Refactor elf code 2016-10-12 12:22:32 +11:00
Adrian Danis
7d50c439a8 Defined untyped size ranges in libsel4 2016-10-12 12:22:32 +11:00
Adrian Danis
4c94f43c51 x64: Fastpath 2016-10-12 12:22:32 +11:00
Adrian Danis
f3094f2e86 x64: extend message_info_t to 64-bit 2016-10-12 12:22:32 +11:00
Adrian Danis
067b71cad4 x64/libsel4: Add x64 libsel4 implementation 2016-10-12 12:22:32 +11:00
Adrian Danis
7f9970e5e2 x64: Add x86_64 support 2016-10-12 12:22:31 +11:00
Adrian Danis
726f5edaf5 x64: Check size of unsigned long 2016-10-12 12:06:22 +11:00
Adrian Danis
03ec049d6b x64: 64-bit elf loading 2016-10-12 12:06:22 +11:00
Bamboo
e1d4ffd13e [STYLE_FIX] 2016-10-12 00:17:10 +00:00
amrzar
f80be7055b Add VISIBLE attrubute to UP states 2016-10-12 10:11:51 +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
Kofi Doku Atuah
8b39c73544 Define kernelBase for 32-bit x86. 2016-10-06 16:03:04 +11:00
Bamboo
e3974daac1 [STYLE_FIX] 2016-10-06 01:10:16 +00:00