Commit graph

508 commits

Author SHA1 Message Date
Adrian Danis
a328f0fd39 fastpath: rename cap_vroot
The variable cap_pd was renamed to cap_vroot to be a more correct name
across different architectures. This rename shouldn't have happened
as it causes a visible rename for verification, this commit undoes this
change
2016-10-12 14:13:23 +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
2acccc92df x64: force return via IRQ path so that register writes have an affect 2016-10-12 12:22:32 +11:00
Adrian Danis
e29db6103c x64: Sanitize instruction addresses to avoid GP faults 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
7f9970e5e2 x64: Add x86_64 support 2016-10-12 12:22:31 +11:00
Adrian Danis
68858c2e4b x64: Modify linker script for 64-bit builds 2016-10-12 12:06:22 +11:00
Adrian Danis
03ec049d6b x64: 64-bit elf loading 2016-10-12 12:06:22 +11:00
Adrian Danis
0fbe80b734 x64: Use SEL4_ARCH to determine mode include dir choice
Prepare for 64-bit builds by using SEL4_ARCH to determine mode include dir choice
and add 64-bit mode src directory
2016-10-12 12:06:22 +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
amrzar
e63be664c6 SELFOUR-631: implement CLH lock and barrier infrastructure 2016-10-06 11:50:57 +11:00
Adrian Danis
32e98e072d Merge pull request #381 in SEL4/sel4 from ~ADANIS/sel4:x64support to master
* commit '45622671de2cd6c23e676be657c03e61a8c9f17e':
  x86: Define large frame types
  x86: Generic setCurrentVSpaceRoot
  x86: Support for syscall
2016-10-06 00:15:50 +00:00
Adrian Danis
3961ed8c5a Merge pull request #384 in SEL4/sel4 from ~ADANIS/sel4:pae to master
* commit '9effe043e963739f6b65538ce75ebba5706bde98':
  add stub Arch_userStackTrace for x86 PAE
2016-10-05 22:58:44 +00: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
Adrian Danis
5970a03f3e arm: Correct fail cases for reading and writing VCPU fields 2016-10-05 14:06:02 +11:00
matt rice
9effe043e9 add stub Arch_userStackTrace for x86 PAE 2016-10-04 17:21:10 -07:00
Bamboo
b77903cc6f [STYLE_FIX] 2016-10-05 00:14:58 +00:00
Matthew Brecknell
8050cf0987 SELFOUR-276: remove some redundant checks
Existing thread priorities and MCPs are already guaranteed to be less than
seL4_MaxPrio.
2016-10-05 11:11:19 +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
Bamboo
9641565629 [STYLE_FIX] 2016-10-04 00:02:10 +00:00
Adrian Danis
f094fc33be Merge pull request #373 in SEL4/sel4 from ~ADANIS/sel4:iommu to master
* commit '2320d909044d271960d4d11dc84a0294e391dbc6':
  x86: Fixup IOMMU implementation
2016-10-04 00:00:27 +00:00
Hesham Almatary
c8a9178c8a Merge pull request #372 in SEL4/sel4 from ~HALMATARY/sel4:BenchmarkNullSyscall to master
* commit '9c507cffd1472a41700417c91d87d7e12d1eb641':
  SELFOUR-603 - Benchmark: Add null syscall
  Benchmarks: Add new generic benchmark entry mode
2016-09-29 23:10:01 +00: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
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
Hesham Almatary
9c507cffd1 SELFOUR-603 - Benchmark: Add null syscall 2016-09-28 11:05:25 +10:00
Adrian Danis
2a6a53fa72 SELFOUR-664: Support for prefetcher on Cortex-A9
Add support for enabling the L1 and L2 prefetcher on cortex-A9.
2016-09-27 09:34:29 +10:00
Adrian Danis
a150f5dde7 Merge pull request #365 in SEL4/sel4 from ~ADANIS/sel4:selfour538 to master
* commit '5fbcda43c594045ae5e863e9697c3a7660492bb4':
  SELFOUR-538: Avoid out of bounds read in debug mode
2016-09-26 00:50:13 +00:00
Bamboo
bdd9beff6d [STYLE_FIX] 2016-09-23 14:19:20 +10:00
Adrian Danis
8e77cdb5e9 SELFOUR-421: Add padding for untyped in bootinfo 2016-09-23 14:15:09 +10:00
Xin,Gao
59aa0ccd6f SELFOUR-421: minor changes for c-refine 2016-09-23 14:15:09 +10:00
Joel Beeren
1ec7ce8653 SELFOUR-421: fix up boolean equality in Arch_sameObjectAs 2016-09-23 14:15:09 +10:00
Joel Beeren
2ffb8d0089 SELFOUR-421: added device check to sameObjectAs 2016-09-23 14:15:09 +10: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
Adrian Danis
5fbcda43c5 SELFOUR-538: Avoid out of bounds read in debug mode 2016-09-22 12:16:07 +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
Amirreza Zarrabi
7e9b46d54a Merge pull request #354 in SEL4/sel4 from ~AZARRABI/sel4:ioapic_id_check to master
* commit 'aaa6ecc6ad6285a1f242c3867c63e0e28e282777':
  In xAPIC (P4 and above) 256 ID is availabe on system bus while in APIC serial bus only 16 ID available. Don't check I/O APIC IDs for xAPIC systems in 32bit system.
2016-09-13 01:34:13 +00:00
amrzar
aaa6ecc6ad In xAPIC (P4 and above) 256 ID is availabe on system bus while in APIC serial bus only 16 ID available.
Don't check I/O APIC IDs for xAPIC systems in 32bit system.
2016-09-13 08:30:22 +10:00
Christian Helmuth
af576aaee5 pc99: check for THRE only when writing chars to serial
Fixes #36
2016-09-12 10:03:25 +02:00