Commit graph

419 commits

Author SHA1 Message Date
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
amrzar
e63be664c6 SELFOUR-631: implement CLH lock and barrier infrastructure 2016-10-06 11:50:57 +11:00
Adrian Danis
45622671de x86: Define large frame types 2016-10-06 07:39:25 +11:00
Adrian Danis
602836a21b x86: Generic setCurrentVSpaceRoot
Defines a generic setCurrentVSpaceRoot to replace setCurrentPD in
mode generic code
2016-10-06 07:39:25 +11:00
Adrian Danis
74cb86c202 x86: Support for syscall
syscall/sysret is an additional way of performing kernel entry/exits.
Whilst the instructions themselves are not supported when running
in 32-bit mode, this commit provides the config choice for them as
well as the generic support code for them.
2016-10-06 07:39:24 +11:00
Adrian Danis
d72cd75136 x86: Rename invalidateTLBentry->invalidateTLBEntry 2016-10-05 16:40:43 +11:00
Anna Lyons
7336303b7f SELFOUR-276: Add MCP field to threads.
Where MCP = Maximum Controlled Priority

This commit adds:

* seL4_TCB_SetMCPriority

and changes the arguments to

* seL4_TCB_Configure

As of this commit, a thread cannot create or set a threads
priority (including itself) above its mcp. Previously the kernel
did this check against a threads priority, which prevented a thread
from setting it's own priority down and then up again.
2016-10-05 11:11:19 +11:00
Adrian Danis
43772b2dc2 x86: Rename decodeIA32PortOperation->decodeX86PortOperation 2016-10-04 11:17:35 +11:00
Adrian Danis
2320d90904 x86: Fixup IOMMU implementation
Adds a mapping type to frame caps that tracks
what kind of hierarchy the cap is mapped into;
an MMU, IOMMU and in the future an EPT structure.

Additionally the IOMMU code is updated to
have correct functionality and be verification
friendly.
2016-09-29 16:11:11 +10:00
Kofi Doku Atuah
b1f8d21e96 TK1: Split the mux controller from the misc region
The TK1 manual's address map has a 16K MMIO region called the "Misc" region,
where they lump together several controllers that aren't all page aligned,
including a USB controller and a SATA controller of some kind.

They also lump the pinmux controller into this "misc" region, but the
pinmux controller is at a page aligned boundary, and has no other devices
sharing that page, so it can be split off into its own device untyped.

This also makes it easier to request that mapping from userspace.
2016-09-29 15:13:16 +10:00
amrzar
2cbc7123b6 SELFOUR-630:preliminary booting application processors
- update core detection code and Kconfig file
    - update kernel stack managment so that BSP does not use boot stack before IPI APs
    - move arch dependant data to a single structure
    - add cache line size to Kconfig
    - add cpu indexing and apic id mapping
    - boot APs to halting state
    - add guard for kernel stack if there is only one core
2016-09-28 16:10:25 +10:00
Adrian Danis
017cb20b78 arm: Move ACTLR functions out of pl2 headers
The ACTLR register is not a PL2 exclusive register, and is architecturally
defined to exist (although the contents of the register are implementation defined).
2016-09-27 09:34:29 +10:00
Anna Lyons
6f00118314 trivial: move ksKernelEntry definition
so debug builds can see it. Not sure how this built previously?
2016-09-23 15:13:38 +10:00
Adrian Danis
2a84b7d792 Merge pull request #120 in SEL4/sel4 from ~ADANIS/sel4:deviceuntyped to master
* commit '8e77cdb5e91e971f49747492a3350c2b443a3827':
  SELFOUR-421: Add padding for untyped in bootinfo
  SELFOUR-421: minor changes for c-refine
  SELFOUR-421: fix up boolean equality in Arch_sameObjectAs
  SELFOUR-421: added device check to sameObjectAs
  SELFOUR-421: Arch_createObject changed to use new user_data_device in ghostupdates for device pages
  SELFOUR-421 Introduce explicit device frames and untypeds
2016-09-23 04:16:22 +00:00
Joel Beeren
2d74ae7eb8 SELFOUR-421: Arch_createObject changed to use new user_data_device in ghostupdates for device pages 2016-09-23 14:15:09 +10:00
Adrian Danis
d507b2d39e SELFOUR-421 Introduce explicit device frames and untypeds
Kernel objects cannot be created from device untypeds, with the
exception of frames, which do not get zeroed and cannot be used
as an IPC buffer. Device untypeds additionally cannot be used
in the construction of ASID pools.

This then changes the API to the rootserver (i.e. bootinfo) to
send device untypeds instead of device frames. On ARM these
device untypeds are the same as the previously exported device
frame regions. On x86 PCI scanning is removed and all physical
memory addresses (that are not important for kernel integrity)
are released to the user.

In order to have bits in the frame and untyped caps on ARM the
number of software ASIDs had to be reduced from 2^18 to 2^17,
and the maximum untyped size reduced from 2^31 to 2^30
2016-09-23 14:15:08 +10:00
Kofi Doku Atuah
97a9b9ab9e Fix TCB Max-name-length macro
The previous macro computed to (0 - sizeof(tcb_t)). Basically a negative
number, which is just a really big unsigned number, so this macro was
basically allowing TCB naming of any length.
2016-09-22 15:37:34 +10:00
Adrian Danis
4044e20412 Revert "Merge pull request #358 in SEL4/sel4 from ~AZARRABI/sel4:multicore to master"
This reverts commit ce2f666bb8, reversing
changes made to dc183f96b8.
2016-09-22 14:22:18 +10:00
Adrian Danis
8ffc353172 Revert "[STYLE_FIX]"
This reverts commit d29f743bbc.
2016-09-22 14:22:08 +10:00
Adrian Danis
7f4694ec3e pc99: Update standalone config with CACHE_LN_SZ 2016-09-22 14:10:08 +10:00
Bamboo
d29f743bbc [STYLE_FIX] 2016-09-22 04:01:23 +00:00
Amirreza Zarrabi
ce2f666bb8 Merge pull request #358 in SEL4/sel4 from ~AZARRABI/sel4:multicore to master
* commit 'fbc071b4f11b3d7d423e26908a661f416b07cda2':
  SELFOUR-630:preliminary booting application processors - update core detection code and Kconfig file - update kernel stack managment so that BSP does not use boot stack before IPI APs - move arch dependant data to a single structure - add cache line size to Kconfig - add cpu indexing and apic id mapping - boot APs to halting state - add guard for kernel stack if there is only one core
2016-09-22 03:59:32 +00:00
Kofi Doku Atuah
df6fe18acf Link libsel4's macros.h into the kernel
Also, include libsel4 macros.h link in types.h.
2016-09-21 13:57:44 +10:00
amrzar
fbc071b4f1 SELFOUR-630:preliminary booting application processors
- update core detection code and Kconfig file
- update kernel stack managment so that BSP does not use boot stack before IPI APs
- move arch dependant data to a single structure
- add cache line size to Kconfig
- add cpu indexing and apic id mapping
- boot APs to halting state
- add guard for kernel stack if there is only one core
2016-09-21 12:14:10 +10:00
Hesham Almatary
9e104c1626 Merge pull request #353 in SEL4/sel4 from ~HALMATARY/sel4:BenchmarkReset to master
* commit '8808ba7fa00591528c1c730c6cfeb4ee6ef82e8b':
  Benchmark: Implement per-thread reset syscall
2016-09-20 00:22:49 +00:00
Kent McLeod
41ec5cf754 SELFOUR-537: Support for raspberry pi3 2016-09-19 15:53:53 +10:00
Stephen Sherratt
5a0bdb7480 Store active irq in global variable on kzm
The first time the irq number is read from the controller, the interrupt
is acknowledged. Subsequent reads of the irq number result in an invalid
irq number being read.

This modifies the kzm interrupt controller driver to save the current irq
number when it's first read from the interrupt controller, preventing the
need for future reads from the controller until the next interrupt arrives.
2016-09-14 13:43:35 +10:00
Hesham Almatary
8808ba7fa0 Benchmark: Implement per-thread reset syscall 2016-09-12 13:54:12 +10:00
Adrian Danis
4491cae521 SELFOUR-556: Rationalize BITS vs INDEX_BITS
s/PGD_BITS/PGD_INDEX_BITS
Current convention is to say that X_BITS is the log base 2
size of an object, not the log base 2 number of indices
2016-08-31 09:24:47 +10:00
Adrian Danis
35c50cfdaf SELFOUR-556: Rationalize BITS vs INDEX_BITS
s/PD_BITS/PD_INDEX_BITS
Current convention is to say that X_BITS is the log base 2
size of an object, not the log base 2 number of indices
2016-08-31 09:24:47 +10:00