Commit graph

97 commits

Author SHA1 Message Date
Kent McLeod
f6e5e218dc Remove symlinked libsel4 files from include dir
These files can be included normally using libsel4 include paths. This
removes situations where the same file is available under different
include paths due to symlinking into different directory structures.
2019-03-21 12:44:57 +11:00
Anna Lyons
d0930f67de style: consistently attach return type
Add attach-return-type to astyle
2019-03-19 14:05:36 +11:00
Anna Lyons
761006e03b style: consistently align pointer with name
Run astyle with align-pointer=name
2019-03-19 14:04:54 +11:00
Kent McLeod
c1b1d07579 bitfields: Split definition cannonical addresses
These shared objects have different definitions based on the cannonical
address of the virtual memory system.
2019-02-08 17:17:02 +11:00
Thibaut Perami
3df00ea4d7 SELFOUR-6: Add GrantReply to the rights system.
GrantReply is a new access right added to endpoint capabilities, which
allows seL4_Call to be used on those capabilities (specifically, it
allows reply caps *only* to be granted across endpoints).

Prior to the addition of GrantReply, endpoint capabilities required the
Grant access right, which allowed any arbitrary capabilitiy to be
transferred over an endpoint. Using GrantReply, systems can now be
constructed where threads using seL4_Call over an endpoint do not need to be in the same
security subsystem.
2018-12-12 14:04:28 +11:00
Edward Pierzchalski
8bf7c55de4 Dedup user_data and user_data_device definitions.
These are reasonably expected to exist on every platform by the
UMM type generator. They also had identical definitions, so we
consolidate them.
2018-12-06 15:04:41 +11:00
Adrian Danis
7641e43872 Refactor logic for cap revocability in cteInsert into new function with arch case
Revocability of a cap, with respect to its parent, is a general property on caps and
makes sense to be abstracted. This allows for the addition of an arch case without
further complicating the cteInsert function itself.
2018-04-24 14:04:46 +10:00
Bruce Mitchener
b942a50441 Fix trivial comment typos. 2018-03-27 10:51:26 +11:00
Adrian Danis
bce62b4e43 Check that TCB object is not larger than necessary 2018-03-23 12:28:54 +11:00
Adrian Danis
a2a2d9b937 Define tcb_t as half the TCB object size
A TCB object has two objects inside it, the cnode object and the 'actual tcb object'.
For simplicity of verification we would like the tcb_t portion of the object to also
be size aligned instead of just just being offset by the size of the cnode.
2018-03-23 12:28:54 +11:00
Adrian Danis
f5abc87894 Rename TCB_SIZE_BITS to TCB_CNODE_SIZE_BITS
This definition is used as the size of the cnode portion of the TCB object (and not the tcb_t)
portion and so this provides a much less confusing name.
2018-03-23 12:28:54 +11:00
Anna Lyons
33398f2191 SELFOUR-331: add seL4_TCB_SetSchedParams
This allows the prio and mcp to be set in one system call.
2018-02-26 11:24:42 +11:00
Anna Lyons
05b83acd95 SELFOUR-1016: Require auth cap to set prio/mcp
This fixes confused deputy problem when setting priorities/mcps.
2018-02-26 11:24:22 +11:00
Adrian Danis
d4d1613f6c Arch abstract for postCapDeletion
Allows architectures to define their own operations for post deletion of capabilities.
The Arch_ variants could be extended to Mode_ if desired in the future, but there is
no need to do this until it is necessary.
2018-02-23 10:03:50 +11:00
Adrian Danis
d258cb3107 Generic postCapDeleted definition
Moves the explicit call of `deletedIRQHandler` in `emptySlot` into a new
`postCapDeleted` function that is a generic function to call after a capability
has been deleted.

Currently `deletedCap` only implementes the IRQ case.
2018-02-23 10:03:50 +11:00
Adrian Danis
d8ae122cc8 Generalise finaliseCap to more than just IRQs
Changes finaliseCap to return a generic definition of cleanup information that
needs to be done, instead of just encoding an IRQ number. The post deletion information
is encoded as a `cap_t` due to the capability type already being a union of all
the possible information. Aside from providing a properly generic mechanism the motivation
is to support a similar cleanup phase for I/O ports in the future.
2018-02-23 10:03:50 +11:00
Adrian Danis
ee96314840 x64: Declare virtual addresses as 48-bits instead of 49-bits
In f6d367e8df virtual addresses were changed from 48
bits to 49 bits, but this does not seem necessary and the commit does not have enough
detail to justify the change. As such it is being changed back to 48 bits in this
commit, which is far less confusing and results on the bitfield generated functions
switching on bit 47 to determine sign extension (instead of bit 48), which matches
what the hardware description says should be done.
2017-12-19 16:13:08 +11:00
Adrian Danis
d2644e8ab7 Declare and check IPC buffer size
Adds a named constant of the IPC buffer size bits that can be used when checking the
size/alignment of an IPC buffer. This constant has a compile time assertion to ensure
it corresponds to the actual IPC buffer
2017-10-27 16:12:18 +11:00
Adrian Danis
15c0f0eb75 Increase badge size for endpoints on 64-bit platforms
This unifies the badge size of endpoints and notifications on 64-bit platforms to a
consistent 64-bits, and also changes the libsel4 definitions to match for both.
2017-10-27 12:15:09 +11:00
Adrian Danis
b5854775a5 Increase size of guards on 64-bit platforms
The maximum guard size was unnecessarily restricted to 18 bits as it is on 32-bit
platforms. This change increases it to the current maximum possible of 58 bits.
The 58-bit limitation exists due to the need to encode a guard+guardsize into a
single word for cnode invocations.
2017-10-27 12:15:09 +11:00
Adrian Danis
5f4640dc6c Move cnode_capdata to libsel4 shared types bitfield
This data structure is meant to be the user visible format of the data for a cnode_cap,
yet it is defined in a kernel only bitfield file. Moving it to libsel4 opens up the
possibility of consolidating the definitions in libsel4
2017-10-27 12:14:44 +11:00
Adrian Danis
18db530231 Abstract zombie word radixes
Zombie caps perform bit packing that relied on the log2(wordBits), which was being
hard coded to 5. Whilst 5 is the correct value on 32-bit platforms, it is incorrect
on 64-bit ones. This changes the previously hardcoded 5 to be the, already existing,
wordRadix definition.
2017-10-26 11:50:51 +11:00
Hesham Almatary
ee28936d48 SMP: Introduce ENABLE_SMP_SUPPORT
- Make it more readable and less confusing compared to the 'CONFIG_MAX_NUM_NODES > 1' check
2017-06-29 16:23:39 +10:00
Anna Lyons
40c61e5c18 Fix licenses (the rest) 2017-06-22 15:29:12 +10:00
Anna Lyons
8c7081c9aa trivial: use BIT in compile asserts in structures.h 2017-06-02 14:47:26 +10:00
Anna Lyons
59415dc99c Add compile assert to ensure tcbName size > 0
Otherwise in debug mode, printing tcbName
can crash the system.
2017-06-01 15:11:51 +10:00
Anna Lyons
bb5ecb1b3e SELFOUR-880: add seL4_DebugDumpScheduler
- when CONFIG_DEBUG is enabled, track all threads
- when CONFIG_PRINTING is enabled, provide seL4_DebugDumpScheduler which
allows the user to dump the state of the kernel scheduler.
2017-05-30 15:22:23 +10:00
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