Commit graph

70 commits

Author SHA1 Message Date
Anna Lyons
9ca253a3d0 SELFOUR-879: expose index and entry constants 2017-05-09 11:35:52 +10:00
Stephen Sherratt
2c398b7bf6 Abstract setting ipc buffer register into arch fn 2017-05-05 16:01:51 +10:00
Anna Lyons
37fef55a27 trivial: remove unused 'bound' field from ntfn 2017-04-11 13:59:54 +10:00
Adrian Danis
eccaae51dc s/D61/DATA61/ in license headers for consistency 2017-02-21 16:38:51 +11:00
Hesham Almatary
67cdff7b68 SMP: Move/rename migrateTCB() arch tcb.c 2017-02-16 15:28:05 +11:00
Adrian Danis
f6d367e8df x64: Allow full 48bits of virtual address space to be used
Prior to this commit virtual addresses in the bitfield were considered
to be 48-bits, with sign extension to 64-bits. This meant that we were
actually sign extended bit number 47. Whilst this gives correct cannonical
addresses it prevents a portion of the address space from being used.

This commit changes the bitfield to use 49-bit virtual addresses, so that
after the bit 48 is used for sign extension there is still 48-bits of
usable address.
2017-01-27 12:21:07 +11:00
Donny Yang
0ad0c4cded Merge pull request #594 in SEL4/sel4 from ~KOTA/sel4:cap-edits to master
* commit 'df977382f03a82ba46f6d25eb41fb260a061b482':
  x64: Rearrange endpoint_cap structure to improve fastpath speed
  x64: Rearrange cnode_cap structure to improve fastpath speed
  x64: Rearrange pml4_cap structure to improve fastpath speed
  x64: Parallelise isValidVTableRoot_fp() check
2017-01-12 11:08:08 +11:00
Hesham Almatary
2f866d91b3 Benchmark: Define benchmark_util_t in a separate file to avoid circular dependency 2017-01-11 14:19:34 +11:00
Donny Yang
df977382f0 x64: Rearrange endpoint_cap structure to improve fastpath speed
This looks like we're just swapping the positions of capEPBadge and capEPPtr,
but it turns out that the bitwise op being performed on capEPPtr to set the
high bits were part of the data dependency critical path, so this actually
does improve the speed by moving the bitwise op to capEPBadge (albeit it's
now an AND instead of an OR)

I initially set the field size to 32 bits, but it turns out that causes gcc
to emit an instruction (mov r32, r32) that causes the instruction decoder
to switch to the legacy decode path for the rest of the fast path for some
reason.
2017-01-10 17:17:20 +11:00
Donny Yang
c68a69f82a x64: Rearrange cnode_cap structure to improve fastpath speed 2017-01-10 16:57:57 +11:00
Adrian Danis
811800da3e x64: Efficiently pack objects for fastpath
Improves the packing of structures used in the fastpath
2016-11-25 16:26:24 +11:00
Anna Lyons
2fea9a0fe2 SELFOUR-567: use seL4_CapRights_t from libsel4
This change

* changes seL4_CapRights from the kernel to be seL4_CapRights_t in
libsel4
* deprecates the duplicated seL4_CapRights in libsel4, which is
  now the bitfield generated type seL4_CapRights_t.
* fixes all usages in kernel and libsel4

Impact: for verification, this will require the type to change name
from cap_rights to seL4_CapRights_t.
This is a breaking libsel4 API change, although most code uses
seL4_AllRights or similar constants, which will not break
at a source level as these constants have been updated.
2016-11-25 12:29:07 +11:00
Anna Lyons
b827ad37ba SELFOUR-413: refactor libsel4 fault API
This is a *breaking API change*

This commit:

* makes seL4_Fault_tag_t common between the kernel and libsel4
* deprecates the existing functions from sel4/messages.h includes
* introduces a new fault API in sel4/faults.h and
* sel4/sel4_arch/faults.h
* deprecates seL4_GetTag(), as the function did not work without
  the user calling seL4_SetTag() first (seL4_MessageInfo is passed
  in registers and not set in the IPC buffer)
* removes previously deprecated functions (deprecated prior to 3.0.0)
* updates the seL4 manual to reflect the changes
2016-11-25 12:29:07 +11:00
Anna Lyons
33a771d3cb Split fault types into arch/generic
Prior to this commit faults were separate
per architecture. This commit extracts the common
fault types and introduces arch specific faults,
reducing code duplication across architectures.
2016-11-25 12:29:07 +11:00
Adrian Danis
bdf10bb4c1 Refactor includes so trace point support builds
benchmark.h requires a definition of KS_LOG_PPTR, but its previous
placement in machine.h resulted in a circular include. This commit
factors out KS_LOG_PPTR and related definitions to a separate header,
creates the corresponding header for x86, and prevents circular
includes in the x86 builds
2016-11-23 14:29:00 +11:00
Anna Lyons
8452068cc3 Move migration logic to own function
This makes it easier to port to the RT branch, where
migration can happen in several different places.
2016-11-18 16:34:13 +11:00
Adrian Danis
31628d9a58 Remove recycle
Removes the recycle operation and adds an operation
to cancel any badged sends on and endpoint. Calling
Revoke + CancelBadgedSend is equivalent to Recycle
on a badged endpoint
2016-11-18 14:10:01 +11:00
Anna Lyons
4a82597b7a trivial: change remoteTCBStall to take tcb
Instead of cap_t. This allows the function to be used from other
functions that have the tcb pointer and not the cap.
2016-11-07 10:37:17 +11:00
Thomas Sewell
03c71b63e1 SELFOUR-444: Preemptible zeroing for retype.
Change to the order of operations and timing behaviour of
invokeUntyped_Retype. The Retype operation now zeroes the
entire range of the Untyped cap (if it is being used for
the first time) before installing any objects. This avoids
the need for long-running initialisation of large objects,
whose initial contents are always zero. The initial zeroing
phase is preemptible, and may take multiple timeslices to
complete.
2016-11-01 17:05:36 +11:00
amrzar
25bb94372f SELFOUR-635: support for TCB operations
This will update TCB invocations to consider multicore environment, this may include:
- adds the affinity invocation to transfer TCB between different cores and update TCB structure for core ID
- checking the thread/core state before performing TCB operation, e.g. deleting the runnable TCB, etc
2016-10-30 08:59:32 +11:00
Adrian Danis
7fbde1bbcb SELFOUR-287: 32-bit vt-x implementation
This is an implementation of vt-x for x86 kernels running in
ia32 mode.
2016-10-27 16:20:30 +11:00
amrzar
f050e6a9c5 implement layout of ipi interrupt handling 2016-10-23 12:21:14 +11:00
Adrian Danis
d6eafad1a5 Move cap definitions from objecttype into header 2016-10-20 15:45:06 +11:00
Hesham Almatary
5f7fa2fcc8 Benchmark: Pack arch-independent benchmark-related files into separate directories 2016-10-20 11:42:04 +11:00
amrzar
2d462d4ad9 add basic api for setting affinity 2016-10-19 08:35:37 +11: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
7d50c439a8 Defined untyped size ranges in libsel4 2016-10-12 12:22:32 +11:00
Adrian Danis
7f9970e5e2 x64: Add x86_64 support 2016-10-12 12:22:31 +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
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
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
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
Hesham Almatary
d97603bd84 SELFOUR-566: Decouble seL4_DebugNameThread from CONFIG_PRINTING 2016-07-15 12:30:17 +10:00
Anna Lyons
69f140a226 trivial: remove duplicated setMRs_syscall_error 2016-07-12 14:44:14 +10:00
Hesham Almatary
09358f9b6a SELFOUR-448 Benchmark: Track thread's CPU utilisation time 2016-06-24 12:43:09 +10:00
Hesham Almatary
8541b87326 SELFOUR-516 Remove EXPECTED_TCB_SIZE 2016-06-21 14:25:26 +10:00
Adrian Danis
fd2f5ec85b Explicitly check if a capability is physical or not
Previously the return value of cap_get_capPtr was compared to 0 in
sameRegionAs to emulate a check in the abstract specification that
tests if the cap is a physical cap or not. Overloading 0 results
in a scenario where a legitimate deviceUntyped's children do not
get considered to be children because they have a capPtr of 0.

This change adds and explicit function that returns whether or not
a capability is physical or not, and uses that in sameRegionAs
2016-06-16 16:42:30 +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
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
Adrian Danis
e61a1056cc SELFOUR-56: Remove diminish rights from IPC
Diminish rights were to prevent a user from sending a writeable
cap over a read only endpoint. It turns out this 'security' can
be worked around without difficulty (by putting caps in a cnode
and sending the cnode) making the current diminish rights
implementation functionally useless.

Removing diminish rights has the benefit of simplifying all the
IPC paths.
2016-02-23 13:58:48 +11:00
Adrian Danis
cfcaf49c2d SELFOUR-399: object sizes and globals frame addr should come from the same source 2016-02-10 09:13:16 +11:00
Adrian Danis
bddd804a6e x86: IOAPIC/MSI syscalls
Restructure the x86 interrupt handling to allow for a more flexible
method of using IOAPIC and MSI interrupts. The essence of this change
is to allow for the user to pick, for both IOAPIC and MSIs, which
CPU vector to use. Additionally there is future support, in the API,
for seL4 to eventually protect MSI interrupts with the vt-d interrupt
routing tables.

API behaviour for legacy systems using the PIC is preserved

Part of SELFOUR-281
2016-02-02 15:58:18 +11:00
Anna Lyons
d93699c9a3 SELFOUR-114: remove duplication of seL4_MessageInfo_t, adjust naming to avoid cparser mangling 2016-01-11 11:16:08 +11:00
Adrian Danis
bd7f06d2dc Move structures.bf files that contain 32-bit specific code into specific
mode directories

This commit is 'broken' as it leaves the repository in an unbuildable state.
The purpose of having this commit is so that there is a commit where the
modifications to these files is *just* a rename, making it easier to merge
these changes into other branches.
2015-12-14 12:48:12 +11:00
Adrian Danis
994c22dd13 trivial: style 2015-12-10 16:09:39 +11:00
Adrian Danis
0ecff9f393 unsigned int -> word_t 2015-12-10 10:45:21 +11:00
Adrian Danis
2d61910e0f Rename uint32_t -> word_t in any relevant places 2015-12-10 10:45:20 +11:00
Adrian Danis
e2c6dbca3f Cast to word_t instead of 'int' to be compatible with both 32 and 64 bit applications 2015-12-10 10:45:18 +11:00
Adrian Danis
d58d4f3e87 Use word_t for zombie pointers to be 64-bit compatible 2015-12-10 10:45:18 +11:00