Commit graph

489 commits

Author SHA1 Message Date
Adrian Danis
40ce1b11f1 libsel4: remove unused extra_cflags
This is now unused due to the usage of CPPFile which allows us to just use the includes
via the `include_directories`
2018-02-22 14:51:48 +11:00
Adrian Danis
08b29f30f0 libsel4: Replace GenCPPCommand with CPPFile
CPPFile is a much more robust version of GenCPP command. We drop the `extra_cflags`
as the CPPFile command uses regular cmake compilation and will use the include
directories added by `include_directories`, which includes all the directories from
 `extra_cflags`
2018-02-22 14:51:48 +11:00
Adrian Danis
596d4c6239 libsel4: Provide includes directly to include_directories
include_directories makes these directories directly available to all compilation that
happens, without needing to provide additional target link directories. This is the
first step to removing the `extra_cflags` variable
2018-02-22 14:51:48 +11:00
Kent McLeod
a82b066c36 libsel4: Correct type typo in syscalls.h 2018-02-06 17:17:13 +11:00
Adrian Danis
eec02fd223 x86: Dangerous read/write MSR interface
Provides a syscall interface for reading and writing arbitrary MSR values. This is
being introduced as an alternative to the DebugRun, as the main purpose of debug run
is for modifying the performance monitoring events via read/write MSR.
2018-01-17 16:35:39 +11:00
Anna Lyons
4e620499c8 Minor fixes to syscall.xml
- update comment to reflect behaviour (it's #if condition not #ifdef
name)
- remove redundant xml
2018-01-15 14:16:47 +11:00
Hesham Almatary
3f862cbfe0 Fix: Guard seL4_DebugDumpScheduler with PRINTING instead of DEBUG
Definitions of seL4_DebugDumpScheduler (for each arch) guard
seL4_DebugDumpScheduler with PRINTING and not DEBUG.
2017-12-07 14:55:34 +11:00
Alexander Boettcher
734320d717 x86: add framebuffer info of MBI2 via boot_info 2017-11-30 22:54:01 +01:00
Adrian Danis
6707a74131 x86: GetStatusBits only defined on ia32
The GetStatusBits invocation is only implemented on ia32. Adding the condition to the
XML list prevents the invocation from being in the list of invocations on x86_64, when
it has no implementation.
2017-11-22 17:01:03 +11:00
Adrian Danis
2b6e302008 cmake: Avoid placing lists in generator expressions
Placing lists directly in the generater expression means that this string, despite having
semicolons in it, is not actually a list, as it has an expression (the generator expression)
spanning multiple lists. This leads to confusion during argument processing and expansion
2017-11-03 13:49:37 +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
Bamboo
bbb9717cd8 [STYLE_FIX] 2017-10-27 01:30:35 +00: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
bdf78d2361 libsel4: Correct 64-bit guard size bits constant
This constant was incorrectly defined as 5 when it is actually 6 on 64-bit kernels
2017-10-27 12:15:09 +11:00
Adrian Danis
2a70716833 libsel4: Make guard and badge definitions mode specific
The definitions of guard and badge sizes is going to be changed for 64-bit platforms,
this change provides an easy way of providing different definitions
2017-10-27 12:15:09 +11:00
Adrian Danis
8108c811ed libsel4: Remove bitfield type unifying Guard and Badge construction
Using the bitfield generator to treat guards and badges as a union type can be convenient,
but it requires reserving a bit in the data for the bitfield run time type information.
This type information is not needed by the kernel as it knows implicitly whether the passed
data is a badge or a guard based on the kind of cap being operated on. However, with the
type information present we cannot pass a word sized piece of data to the kernel.

The solution here is to go back to using a plain seL4_Word as the type for invocations
that want a capdata and let the user either construct a badge as a plain word, or use
the seL4_CNode_CapData bitfield for constructing a guard, although they have to manually extract
the word representation out of it.
2017-10-27 12:15:09 +11:00
Adrian Danis
2e6cadd9f0 Rename cnode_capdata to seL4_CNode_CapData
The purpose of renaming this type is to match the style of the other shared types in libsel4.
Previously its name was fine as this was a private kernel type.
2017-10-27 12:14:44 +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
Alexander Boettcher
023977fc4b x86: Provide copy of RSDP in bootinfo
This gives a rootserver a way to find the ACPI tables in cases where there is no BIOS region
to scan for an RSDP.
2017-10-06 10:08:46 +11:00
Adrian Danis
7468ed450c Merge branch benchmark into master 2017-10-04 17:41:04 +11:00
Adrian Danis
383a6d959f Merge branch zcu102-7.0.0 into master 2017-10-03 12:16:08 +11:00
Robbie VanVossen
02ca6a80a4 Added 32-bit support for the zynqmp.
The Zynq UltraScale+ MPSoC (PLAT zynqmp) is a Multi-Processor SOC
made by Xilinx that has a quad-core Cortex-A53, a dual-core Cortex-R5
and an FPGA.

This adds 32-bit, single-core support on the the Cortex-A53 cluster.
2017-09-27 12:58:49 -04:00
Adrian Danis
567127defe manual: Expand parts of the x86 virtualisation documentation
This provides documentation for kernel design of the x86 virtualisation, the additional
syscall and object invocations. The ARM design is not fully expanded.
2017-09-18 14:01:46 +10:00
Adrian Danis
09443ed0c1 manual: Correct parameter type of VCPU_EnableIOPort invocation
Type was previously `seL4_CNode`, which is incorrect as the invocation is taking a
cptr to an I/O port, not a cnode, this change reflects that.
2017-09-18 14:01:22 +10:00
Adrian Danis
a1a6390d65 manual: Correct VCPU_SetEPTRoot invocation parameter name
Changes the parameter name to match the actual object that should be passed, as required
by the kernel code.
2017-09-18 14:01:22 +10:00
Adrian Danis
d3c9f36d94 manual: Correct asidpool assign label
Fixes an inconsistency between manual_label for the x86 AsidPool_Assign invocation
and its reference in the manual. This makes the x86 align with the ARM name.
2017-09-18 14:01:22 +10:00
Adrian Danis
cfb30f34b9 libsel4: Remove unused argument in seL4_VMEnter syscall
This VCPU argument does not make sense given semantics of the VMEnter syscall,
and as a result the argument is ignored by the kernel.
2017-09-06 15:48:37 +10:00
Alexander Boettcher
a3b0bd5c4f benchmark: support reading out idle cpu time on remote cpu
Fixes #68
2017-09-04 12:50:42 +02:00
Adrian Danis
a8d6315eb1 libsel4: x86: Remove nested struct declarations
Nested structs with attributes are not understandable by the C parser. This change simply
moves the nested definitions into the global namespace (with suitable names).
2017-09-01 15:23:02 +10:00
Adrian Danis
86442b078e libsel4: x86: Correctly pack substructs in VBE struct
The VBE information struct is a representation of the actual VBE information passed from
multiboot and needs to have the precise layout as described.
2017-09-01 10:46:51 +10:00
Adrian Danis
4c8be8f4f9 x86: Increase TCB size for debug builds
Debug builds require one additional byte in the TCB to have a NULL terminated tcb name.
2017-08-22 14:51:10 +10:00
Adrian Danis
0b73072016 Add a CMake based build system
This commit adds an alternate build system using CMake that operates indepenently of
the existing Kconfig+Kbuild+make based build system
2017-08-22 13:56:26 +10:00
Anna Lyons
8fb06eecff libsel4: Return seL4_Error in invocation stubs
Some stubs return structs, which will not change, however instead of
long for those that don't return structs they now return a seL4_Error.
2017-08-22 07:57:54 +10:00
Adrian Danis
a9e1f51713 SELFOUR-1062: Hide all IOMMU related code behind #ifdef guards
The IOMMU implementation is not going to be verified at the moment, and so the code for
it needs to be hidden from verification, which we do by #ifdef'ing it out if the IOMMU
is not enabled. As a result the IOMMU configuration depends on a non verification target
2017-08-21 16:44:58 +10:00
Hesham Almatary
72478f3606 Manual: document mode/arm object invocations 2017-08-09 10:01:00 +10:00
Adrian Danis
ae9fe9b5d1 aarch64: Use tpidrro_el0 for IPC buffer instead of tpidr_el0
Changing the register used for the IPC buffer is useful as the standard TLS model for
aarch64 is to use tpidr_el0 for the thread pointer, which we are presently using
for the IPC buffer. This therefore paves the way for implementing proper TLS support
on aarch64.

Since we are not using tpidr_el0 for the IPC buffer we need to save/restore (or at
least clear) this register on thread switch to prevent it being a user channel. Saving
and restoring of it is achieved by ensuring CONFIG_IPC_BUF_TPIDRURW is not set, which
as we are no longer using this strategy this will be the case. To that end as aarch64
only has one IPC buffer strategy this commit makes the choice of IPC buffer strategy
dependeont on aarch32.
2017-08-07 22:52:46 +10:00
Hesham Almatary
64d576fb47 SELFOUR-806: aarch32 - Implement lazy FP save/restore
This commit implements lazy FP save/restore mechanism, required for user threads
when they use the FPU. The following caveats take place:

* Only support synchronous exceptions. No support for asynchronous ones.
* VFP opcodes are used instead of normal instructions to discard compiler warnings/errors.
* Support is limited to specific ARM subarchitectures we support and tested this commit on.
* Disable the FPU by default if users are not using it to avoid channels.
* FPU support is not verified yet.
* Will not work properly if using a VM that's running besides other VMs/threads that are using the FPU.
2017-06-29 13:42:10 +10:00
Kent McLeod
8e3598bdcf SELFOUR-912: migrate ARM docs from latex to xml 2017-06-29 12:06:39 +10:00
Anna Lyons
422118c3e6 SELFOUR-913: migrate x86 docs from latex to xml 2017-06-28 11:47:00 +10:00
Anna Lyons
192a4162ee manual: allow non sec autorefs
Previously anything in an autoref block was assumed to reference
a section, which isn't true. Change 'sec' to 'label' and move the
'sec' prefix into the label itself.
2017-06-27 16:22:34 +10:00
Anna Lyons
64cf2308ac tools: fix licenses 2017-06-22 15:27:30 +10:00
Anna Lyons
07f948331f libsel4: fix licenses
- some were incorrectly marked GPL (libsel4 is BSD)
- update NICTA --> DATA61 etc
- fix tags D61 --> DATA61
- update year to 2017
2017-06-22 15:27:29 +10:00
Adrian Danis
2038316358 x86: Split large structs into portions
The C parser does not enjoy parsing structs with many fields
2017-06-21 17:14:48 +10:00
Anna Lyons
1b9b1292c7 seL4_DebugDumpScheduler: add docs 2017-06-19 14:44:22 +10:00
Anna Lyons
61f1bd5efc seL4_DebugDumpScheduler: remove unused argument 2017-06-19 14:43:03 +10:00
Anna Lyons
10801bd891 SELFOUR-962: allow API level description in manual 2017-06-19 13:59:08 +10:00
Anna Lyons
4ac01f61c3 manual: Add docs for seL4_Benchmark_FlushCaches 2017-06-19 13:59:08 +10:00
Anna Lyons
c6056ecbe9 SELFOUR-961: allow lists in API docs
this change

- converts ordered doxygen lists to enumerate
- also wraps the benchmark config names in texttt
2017-06-19 13:59:08 +10:00
Anna Lyons
1405cb33d9 SELFOUR-910: document debugging syscalls 2017-06-19 13:59:08 +10:00
Hesham Almatary
d84029305e [SELFOUR-911]: Document benchmarking system calls 2017-06-16 11:26:42 +10:00
Stephen Sherratt
5090a26474 manual: Add missing return doc for seL4_Poll 2017-06-06 13:52:48 +10:00
Stephen Sherratt
f39f925612 manual: Better inference of method manual labels
Manual labels for methods are inferred unless specified in the api
description. This change extends this inference to prevent slashes
appearing in method labels. It also refactors the logic for label
inference to be more readable.
2017-06-02 16:34:49 +10:00
Stephen Sherratt
e283e390d3 manual: In API docs, expand EPT* acronyms 2017-06-02 15:34:45 +10:00
Stephen Sherratt
161b841a9e manual: In api docs, rename "IO" to "I/O" 2017-06-02 15:34:45 +10:00
Stephen Sherratt
c206dda4c7 manual: Remove errorenumdesc docs from sel4 idl
Methods with no output params return an error. Previously each such
method had a line of documentation in its interface definition
explaining this. This commit removes this. The documentation is
for such cases is generated implicitly.
2017-06-02 15:34:45 +10:00
Stephen Sherratt
d8e6a00115 manual: Improve handling of return type docs
If no documentation is provided for the return value of a function, the
documentation generator will attempt to infer the documentation based on
the return type.
2017-06-02 15:34:45 +10:00
Stephen Sherratt
32af54221f manual: Docs for debugg and benchmark syscalls 2017-06-02 15:34:45 +10:00
Stephen Sherratt
447e924337 manual: Undocumented return defaults to error enum 2017-06-02 15:34:45 +10:00
Stephen Sherratt
c2ca76a3eb manual: Friendly names for arch-specific methods 2017-06-02 15:34:45 +10:00
Stephen Sherratt
c662c2effe manual: Tweak manual label inference 2017-06-02 15:34:45 +10:00
Stephen Sherratt
3498705f50 manual: Add basic names and labels to interfaces 2017-06-02 15:34:45 +10:00
Stephen Sherratt
ec3b640248 manual: Add label_prefix to method names 2017-06-02 15:34:45 +10:00
Stephen Sherratt
7af79c555a manual: Allow label_prefix to be set in idl 2017-06-02 15:34:45 +10:00
Stephen Sherratt
c7471db9b5 manual: Trivial whitespace 2017-06-02 15:34:45 +10:00
Anna Lyons
af1e8762d4 tk1: increase seL4_TCBBits in debug mode
Otherwise there is not enough space for tcbName
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
3230c90076 SELFOUR-708: fix priority docs on TCBConfigure 2017-05-25 10:57:55 +10:00
Stephen Sherratt
f739cc89eb manual: Python3-compatible relative imports 2017-05-24 16:02:39 +10:00
Kent McLeod
b9f2a7600c libsel4: Add constant for multiboot region type 2017-05-16 15:45:58 +10:00
Kent McLeod
56e9e28d49 libsel4: add comments to multiboot fields 2017-05-15 15:41:32 +10:00
Anna Lyons
f8f25d7fd0 trivial: fix #ifdef guard
it was duplicating another one
2017-05-09 11:35:52 +10:00
Anna Lyons
9ca253a3d0 SELFOUR-879: expose index and entry constants 2017-05-09 11:35:52 +10:00
Anna Lyons
fc0f1eec76 kernel entry tracking: track VMExit and VCPUfault 2017-05-08 10:10:37 +10:00
Kent McLeod
108c325b0f libsel4: Change PACKED to SEL4_PACKED 2017-05-05 14:49:46 +10:00
Anna Lyons
50d72007c6 SELFOUR-862: CONFIG_PRINTING --> seL4_DebugPutChar
seL4_DebugPutChar is only available when CONFIG_PRINTING is enabled
2017-05-04 16:07:16 +10:00
Kent McLeod
d13544c737 SELFOUR-865: Pass memory map information to user 2017-05-03 16:17:03 +10:00
Anna Lyons
beddca16cd libsel4: Add seL4_FastMessageRegisters
This allows benchmarks and utility code to only set registers in the ipc
buffer as required.
2017-05-02 11:08:11 +10:00
Anna Lyons
90b3e757bf libsel4: fix warning in seL4_BenchmarkSetLogBuffer 2017-04-11 14:14:10 +10:00
Anna Lyons
8c02bc1301 x64: implement seL4_BenchmarkFlushCaches
by moving the ia32 implementation up a level to x86
and implementing the syscall stub.
2017-04-11 14:14:10 +10:00
Adrian Danis
77616ac43d Check for CONFIG_ variables being 'defined' instead of 'true'
This is to conform with existing style of checking configuration options
2017-04-06 10:43:24 +10:00
Kofi Doku Atuah
4b491dcf0c SELFOUR-836: arm-hyp: Config option for saving/loading vs trapping debug state
Provides a configuration option for enabling HDCR.TD* traps, or saving and loading debug
state on VCPU switches. Currently verification only plans to support the trap setting.

As this option complicates all of the #ifdef's related to debug registers even further,
abstractions for enabling/disabling each individual piece of the debug code for different
configuration options are also implemented.

Part of these refactored #ifdef guards was to remove the guards completely from libsel4
around the definitions of the number of breakpoints and watchpoints.
2017-04-03 14:21:27 +10:00
Luke Mondy
eed691d5e5 Add comment explaining env var 2017-03-31 16:59:14 +11:00
Luke Mondy
13f1a00c74 Set environment var to force Python not generate cached bytecode (pyc) files 2017-03-31 16:59:14 +11:00
Kofi Doku Atuah
725d0dacfd SELFOUR-836: Disable debug context save/restore between VMs
This patch disables the debug register state save and restore on ARM-hyp,
such that Guest VMs can now interfere with one another and trigger
one another for certain limited scenarios. This will be undone later on.
2017-03-21 15:31:23 +11:00
Hesham Almatary
2cd909b2e9 ia32: remove unsued ia32KSGlobalPDPT and PDPT defines 2017-03-17 09:50:52 +11:00
Adrian Danis
099b45074f libsel4: Deprecate bootinfo management 2017-03-08 09:25:47 +11:00
Kofi Doku Atuah
469bdd6156 ARM-HYP: Add support for save/restore of debug registers
As things are now, the Guest VMs can modify the debug registers at will
from non-secure PL1, and the kernel does nothing to ensure that guest VM
debug coprocessor registers are preserved.

This is a preliminary patch that simply hooks into vcpu_save and saves the
CPU's debug coprocessor registers when saving VCPU state.

For restoring the debug registers on switching to a VCPU, we just re-use
restore_user_debug_context, which is already called in restore_user_context.
(Restore_user_context is called by c_handle_vcpu_fault()). Specifically,
we modify the used_breakpoints_bf so that restore_user_debug_context()
will always pop all the debug context.

This patch only covers the breakpoint and watchpoint registers,
and it doesn't cover the entire debug coprocessor, which is another
conversation.
2017-03-01 10:23:29 +11:00
Adrian Danis
256c30ae02 x86: Pass VBE information from multiboot through bootinfo 2017-02-28 16:35:50 +11:00
Kent McLeod
aa656604db Modify FinalizeLog syscall
There is no way to know how many entries the syscall log contains
otherwise.  One option was iterating through until finding a 0
terminator, however this requires the log to be zeroed before each
trial.  This changes the FinalizeLog syscall to return the number of
entries.
2017-02-24 15:55:34 +11:00
Kent McLeod
e937d96801 Change debug #ifdefs to be from autoconf.h
Previously the #ifdefs for some debug syscalls relied on definitions
from Makefile.flags in sel4_tools.  This changes them to use configs
defined in autoconf.h which makes them easier to import when building
projects that don't use sel4_tools.
2017-02-24 14:15:59 +11:00
Stephen Sherratt
cb952a2be4 Replace division with int division in py scripts 2017-02-22 12:20:15 +11:00
Stephen Sherratt
8c93b71c1c Import reduce from functools in python scripts 2017-02-22 12:19:58 +11:00
Stephen Sherratt
7337f9e8df Parens around print args in python scripts 2017-02-22 12:19:24 +11:00
Adrian Danis
eccaae51dc s/D61/DATA61/ in license headers for consistency 2017-02-21 16:38:51 +11:00
Hesham Almatary
bca46830e9 Merge pull request #420 in SEL4/sel4 from ~HALMATARY/sel4:x86RemovePAE to master
* commit '3e57e647e9a882fc7ba07329bcfe41ff87af5bdb':
  SELFOUR-501: x86 - Remove PAE support
2017-02-21 16:14:34 +11:00
Hesham Almatary
3e57e647e9 SELFOUR-501: x86 - Remove PAE support 2017-02-17 13:13:43 +11:00
Adrian Danis
7836f76cf9 Extend bootinfo to support potentially arbitrary additional structures
This provides a future proof interface for extending the bootinfo region with additional
kinds of optional architecture and platform specific information. The basic idea is to
report the size of a region directly following the bootinfo frame, which is made up of
a series of 'chunks'. Each chunk has an identifier (describing what it is) and a length,
allowing unknown chunks to be skipped in favor of examining the remaining of the chunks.
2017-02-16 14:34:52 +11:00
Adrian Danis
e3b39248f9 Explicitly pack bootinfo data structures
To prevent the kernel and root server having a different layout of these structs if they are
compiled with different flags etc they should be packed
2017-02-15 14:27:31 +11:00
amrzar
2e250fcce5 plat: add tx1 support 2017-02-15 12:35:13 +11:00
amrzar
c72bdc0cde trivial: fix typo 2017-02-13 08:27:52 +11:00
amrzar
6428e959b4 aarch64: Add aarch64 libsel4 implementation 2017-02-10 16:43:46 +11:00
Anna Lyons
2c98f49dc5 Add missing case to seL4_getFault 2017-02-08 17:16:06 +11:00
amrzar
efb28fec20 Unify arch_shared_types.bf from the libsel 2017-02-06 09:08:35 +11:00
Adrian Danis
8d8df93a9b Merge pull request #644 in SEL4/sel4 from ~ADANIS/sel4:github55 to master
* commit '31fe08263ca0c314163b0b88607955fd04f0b072':
  Fix typo
2017-02-03 11:36:03 +11:00
Adrian Danis
2e5ce5a257 arm: VCPU interface for manipulating banked registers
Adds extra fields to the Read/Write VCPU Register invocations to read and write
the banked the registers
2017-01-30 09:47:51 +11:00
Adrian Danis
191b44656a arm: Introduce constant for VCPU register 2017-01-30 09:47:51 +11:00
Berkus Decker
31fe08263c Fix typo 2017-01-25 19:13:47 +02:00
Hesham Almatary
ff8c48d651 Benchmark: ARM - Fix typos in syscalls.h 2017-01-11 12:30:39 +11:00
Stephen Sherratt
c05210f508 manual: Remove empty cap description attribute 2016-12-16 15:57:57 +11:00
Stephen Sherratt
1f1a5ad4dc manual: Removed default cap description 2016-12-16 15:57:57 +11:00
Adrian Danis
55d7a38641 libsel4: seL4_VMEnter syscall for x86-64 2016-12-16 10:39:40 +11:00
Adrian Danis
017d786317 x64: VT-x related cap and object definitions
* Adds object and cap definitions for VT-x structures (VCPU and EPT).
* Extends the asid_map implementation to support ASIDs in the EPT
* Adds size definitions for VCPU and EPT objects
2016-12-16 10:39:40 +11:00
Kent McLeod
e537ee1d67 libsel4: add void to function prototypes 2016-12-15 15:04:44 +11:00
Jeff Waugh
803dd5c2ae libsel4: Optional public symbols for external interfaces
CONFIG_LIB_SEL4_PUBLIC_SYMBOLS=y will disable inlining for external
interfaces (except deprecated functions), thereby providing public
symbols for easy linkage with other languages.
2016-12-06 18:08:39 +11:00
Adrian Danis
80ae3286dc ia32: Support larger XSAVE region sizes 2016-11-30 17:44:24 +11:00
Stephen Sherratt
b6cd9f1227 libsel4: Updated api xml dtd file with doc tags 2016-11-30 16:09:06 +11:00
Adrian Danis
f9f360a747 Merge pull request #552 in SEL4/sel4 from ~ADANIS/sel4:fault to master
* commit '0435985eca5117a9df272e991fd0f8c421515831':
  arm: Use new cap rights structures in iospace
  libsel4: Correct VGIC and VCPU fault types
  libsel4: Correct deprecated macro for in unknown syscall
2016-11-30 14:43:37 +11:00
Stephen Sherratt
a09089292d Merge pull request #551 in SEL4/sel4 from ~SSHERRATT/sel4:caprights to master
* commit '2e30ac481f212b3490fde8dbd13f496a50d70f49':
  libsel4: Add remaining combinations of cap rights
  libsel4: Removed stray semicolon from shared_types
2016-11-30 14:16:22 +11:00
Adrian Danis
78009dd245 SELFOUR-675: x64: Increase message registers from 2 to 4 2016-11-30 12:04:54 +11:00
Adrian Danis
8b0e63f09d libsel4: Correct VGIC and VCPU fault types 2016-11-30 11:59:48 +11:00
Adrian Danis
fe0f417789 libsel4: Correct deprecated macro for in unknown syscall 2016-11-30 11:57:47 +11:00
Stephen Sherratt
2e30ac481f libsel4: Add remaining combinations of cap rights 2016-11-30 10:36:31 +11:00
Stephen Sherratt
3fce021c8b libsel4: Removed stray semicolon from shared_types 2016-11-30 10:35:47 +11:00
Stephen Sherratt
cd8b5de27e manual: Add docs to arch-independent inv xml file
This also moves the description of TCBSetEPTRoot from the general object
invocation xml file to the x86-specific one to prevent the need for
documentation-generating scripts to distinguish between VTX (ie. x86)
invocations, and truly architecture independent invocations.

JIRA: SELFOUR-606
2016-11-29 14:30:41 +11:00
Stephen Sherratt
08bca15c5f manual: Obj inv stub gen generates doxy comments
This modifies the object invocations stub generator to generate doxygen
comments based on documentation in the xml files it parses.

JIRA: SELFOUR-606
2016-11-29 14:30:36 +11:00
Stephen Sherratt
818a8330b3 manual: Added libsel4 tools library to manual dir
JIRA: SELFOUR-606
2016-11-29 14:30:02 +11:00
Stephen Sherratt
891a5eb587 libsel4: Trivial whitespace 2016-11-29 14:06:30 +11:00
Stephen Sherratt
0197d63b6a Replace bools with ints in shared_types header
The motivation for this change is the fact that the types of `true` and
`false` are different between userland and the kernel. This was forcing
code including shared_types.h to first include the appropriate header
defining `true` and `false`. This change prevents this need.
2016-11-28 14:05:23 +11:00
Adrian Danis
db174884e9 libsel4: Add missing seL4_AllRights macro
Left out of commit 2fea9a0fe2
2016-11-25 15:23:45 +11:00
Anna Lyons
ed95f84a43 SELFOUR-413: changes for verification
Avoid using ptrs to arrays at all

Another macrofull change brought to your by verification. This should
avoid nasty proofs about const pointers.
2016-11-25 12:30:29 +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
e78cdf9b64 SELFOUR-553: Support alternate IPC buffer locations without globals frame
This commit adds support for using the ThreadID registers of the ARM MPCore
platforms for storing the address of the IPC buffer instead of the globals
frame. The choice of using the user readable/writeable ThreadID register
is chosen, even though it means the user cannot use it for its own
purposes, as it leaves room in the future for doing TLS support in the
user read only register, where compilers expect it.
2016-11-22 11:49:52 +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
Adrian Danis
05bf1ca44d libsel4: Reorder bootinfo struct
This reorders the bootinfo struct to place the untyped array as the
last element. Having the array at the end makes the layout of the
information in this struct easier to represent in other languages.
2016-11-14 08:58:18 +11:00
Anna Lyons
c86669df43 x86: export tsc freq in bootinfo
We read the frequency from the platform info MSR and export it to the
user for accurate timing (for platforms that support platform into)
2016-11-08 14:46:18 +11:00
Adrian Danis
8d0ed7029d Use correct seL4_MaxUntypedBits
This change uses the seL4_MaxUntypedBits constant in decodeUntypedInvocation
when checking the size of the requested allocation. This constant
is also changed to be the correct value. The verification team suspects
this check is probably unnecessary, but have also resolved not to waste more
time investigating.
2016-11-01 16:17:11 +11:00
Kent Mcleod
436b214ec6 Merge pull request #444 in SEL4/sel4 from ~KMCLEOD/sel4:pr to master
* commit '66dfc2e786614a34c18ad2d7c20c04c69e589a97':
  Change ia32 to use fs register for IPC buffer
2016-10-30 23:00:44 +00:00
Kent McLeod
66dfc2e786 Change ia32 to use fs register for IPC buffer
gs register is used by gcc for TLS and the IPC buffer gets in the way
2016-10-28 16:40:38 +11:00
Adrian Danis
8a49b94893 Merge pull request #446 in SEL4/sel4 from ~ADANIS/sel4:withmrs to master
* commit 'be68b0c0bde5bfa439376fac4c8be255dacaa958':
  libsel4: Allow invocations to not use IPC buffer
  Retain in-register error descriptions when not using IPC buffer
2016-10-28 04:35:09 +00:00
Adrian Danis
be68b0c0bd libsel4: Allow invocations to not use IPC buffer
Reintroduces Kconfig option removed in 5271925ba5
that allows invocations to use the WithMRs variants of syscalls instead of
using the IPC buffer
2016-10-28 15:25:27 +11:00
Anna Lyons
f0cb354755 Merge pull request #410 in SEL4/sel4 from ~ALYONS/sel4:cache to master
* commit '44ed6adb616590a0f6ae8b0ad8c442afed625457':
  add seL4_BenchmarkFlushCaches() for arm and ia32
2016-10-28 04:21:25 +00:00
Anna Lyons
44ed6adb61 add seL4_BenchmarkFlushCaches() for arm and ia32
Available when CONFIG_ENABLE_BENCHMARKS is set, flushes caches for
running cold-cache benchmarks
2016-10-28 15:09:03 +11:00
Jeff Waugh
dc3d53417e Retain in-register error descriptions when not using IPC buffer
- Fixes "lost" error descriptions when using *WithMRs system call
  variants [1].
- Only stores real registers to IPC buffer if there's an error.
- If there's an error in a struct-returning function, return
  early without setting any struct members.
- Passes the sabre/qemu test suite... with and without --buffer!

[1] https://sel4.systems/pipermail/devel/2016-October/001079.html
2016-10-28 14:57:39 +11:00
Adrian Danis
e77d4d48cc Merge pull request #443 in SEL4/sel4 from ~ADANIS/sel4:recvwithmrs to master
* commit '339096d39eee5f85362ff5bbd1fcce7b81bacd71':
  Also let aarch32 seL4_RecvWithMRs/ReplyRecvWithMRs
2016-10-28 03:33:30 +00:00
Adrian Danis
151e95d908 libsel4: Update VTX invocations to use condition= instead of config= 2016-10-28 14:09:28 +11:00
Adrian Danis
654e366f5e libsel4: Update condition for SetEPTRoot
Using `config=` for guarding invocations was changed to be
`condition=`, but `SetEPTRoot` was not updated
2016-10-28 13:58:51 +11:00
Adrian Danis
48f99701c3 libsel4: Move vt-x definitions into common x86 2016-10-28 12:16:41 +11:00
Jeff Waugh
339096d39e Also let aarch32 seL4_RecvWithMRs/ReplyRecvWithMRs 2016-10-28 12:04:15 +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
Adrian Danis
cb79c0dd97 Merge pull request #437 in SEL4/sel4 from ~ADANIS/sel4:stubgen to master
* commit '59d48b778b6daf50cc612f7bd4f64c9d1bdf2e21':
  Let x86_64 CallWithMRs
2016-10-27 02:54:57 +00:00
Jeff Waugh
59d48b778b Let x86_64 CallWithMRs
* `syscall_stub_gen.py` now works on x86_64 without passing `--buffer`
2016-10-27 12:09:00 +11:00
Jeff Waugh
df1f021cc6 Let aarch32 CallWithMRs
* Initialise the message variables (as per ia32 and x86_64)
* `libsel4` now builds when `syscall_stub_gen.py` is run without `--buffer`
* While simple things appear to work, `sel4test` with aarch32 in qemu is *not* happy:

```
Bootstrapping kernel

Warning: using printf before serial is set up. This only works as your
printf is backed by seL4_Debug_PutChar()
sel4utils_create_object_at_level@mapping.h:22 Should not be called
Ignoring call to sys_rt_sigprocmask
Ignoring call to sys_gettid
sys_tkill assuming self kill
```
2016-10-27 04:39:27 +11:00
Adrian Danis
b90238d089 Replace #pragma once with include guards 2016-10-21 12:05:02 +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
Hesham Almatary
3c01da7018 Trivial: correct x86_64 seL4_BenchmarkReset() return value 2016-10-20 12:14:35 +11:00
amrzar
2d462d4ad9 add basic api for setting affinity 2016-10-19 08:35:37 +11:00
Amirreza Zarrabi
5921a5308e Merge pull request #409 in SEL4/sel4 from ~AZARRABI/sel4:xml_config to master
* commit 'e0d2a83fa6291caa10b760ebe30b915c12ff6596':
  update xml format to replace config with condition
2016-10-17 02:38:39 +00:00
amrzar
e0d2a83fa6 update xml format to replace config with condition 2016-10-17 13:02:51 +11:00
Amirreza Zarrabi
b5804a698e Merge pull request #407 in SEL4/sel4 from ~AZARRABI/sel4:xml_config to master
* commit 'ee75f086f33f36d14f26523e005054a4d277c6de':
  update #ifdef to #if in auto generated files
2016-10-17 01:52:00 +00:00
amrzar
ee75f086f3 update #ifdef to #if in auto generated files 2016-10-17 12:18:58 +11:00
Adrian Danis
1a98a2a31f libsel4: Reorder bootinfo struct
This reorders the bootinfo struct to place the untyped array as the
last element. Having the array at the end makes the layout of the
information in this struct easier to represent in other languages.
2016-10-17 09:53:58 +11:00
Adrian Danis
f72d02f61e arm/libsel4: Update VCPU fault definitions
With the introduction of debug faults the numbers for VCPU faults
got changed, this commit updates them accordingly
2016-10-12 16:10:39 +11:00
Bamboo
f062dcdcf9 [STYLE_FIX] 2016-10-12 03:07:32 +00:00
Adrian Danis
7d50c439a8 Defined untyped size ranges in libsel4 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
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
Adrian Danis
45622671de x86: Define large frame types 2016-10-06 07:39:25 +11:00
Adrian Danis
4f625591ef arm/libsel4: Correct seL4_DebugRun
In a3e60fd025 seL4_DebugRun was refactored incorrectly. This
commit corrects the name and arguments of its function call
2016-10-05 15:36:09 +11:00
Bamboo
f56d1ec1be [STYLE_FIX] 2016-10-05 00:39:04 +00:00
Adrian Danis
1d5d8d4f8e Merge pull request #374 in SEL4/sel4 from ~ADANIS/sel4:syscall to master
* commit '8a0a781441d98abd630b3a8ae1cdc879c5479dc3':
  ia32/libsel4: Refactor syscall functions
  arm/libsel4: Refactor syscall functions
2016-10-05 00:20:35 +00: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
8a0a781441 ia32/libsel4: Refactor syscall functions
Refactors syscalls to use common base functions for assembly stubs.
These base functions are duplicated to create the PIC variants.
2016-10-04 17:22:48 +11:00
Adrian Danis
a3e60fd025 arm/libsel4: Refactor syscall functions
Refactors syscalls to use common base functions for assembly stubs.
As a result of this refactor the problem of low optimization levels
breaking the syscall stubs is also resolved.
2016-10-04 17:22:48 +11:00
Hesham Almatary
9c507cffd1 SELFOUR-603 - Benchmark: Add null syscall 2016-09-28 11:05:25 +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
Adrian Danis
8e77cdb5e9 SELFOUR-421: Add padding for untyped in bootinfo 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
Anna Lyons
8d32cc26fc trivial: fix typo in libsel4 Makefile 2016-09-22 08:24:27 +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
Stephen Sherratt
c464470d6c Syscalls docs in manual generated by doxygen
This adds a dummy header with syscall prototypes with doxygen comments.
The build process for the manual includes parsing these comments using
doxygen. Doxygen produces an xml file which is parsed by a script to
generate latex which is included in the manual. This approach was chosen
over doxygen's native latex output to gain greater control over the
formatting of the generated documentation, and to take advantage of
existing api-formatting support in the sel4 manual.

Related issue: SELFOUR-606
2016-09-16 10:09:36 +10:00
Hesham Almatary
8808ba7fa0 Benchmark: Implement per-thread reset syscall 2016-09-12 13:54:12 +10:00
Adrian Danis
0fb224b095 x86: Correct seL4_DebugRun syscall stub
This stub was messed up during the merge of
fbeb95edb9
this commit corrects
2016-08-31 10:48:21 +10:00
Bamboo
af77b451e5 [STYLE_FIX] 2016-08-30 14:42:20 +10:00
Adrian Danis
b114f6b9ea Merge pull request #346 in SEL4/sel4 from ~ADANIS/sel4:github34 to master
* commit '25f366817ff6dbceb9fb90429f73f0aa08f6ca87':
  x86: support position independent syscall bindings
2016-08-30 04:37:28 +00:00
Adrian Danis
25f366817f Merge branch 'issue_34' of ssh://github.com/alex-ab/seL4 into HEAD
Conflicts:
	libsel4/sel4_arch_include/ia32/sel4/sel4_arch/syscalls.h
2016-08-30 11:57:48 +10:00
Alexander Boettcher
fbeb95edb9 x86: support position independent syscall bindings
Fixes #34
2016-08-26 10:58:30 +02:00
Hesham Almatary
fb19c78e12 Benchmark: Share trace point log structure with the user 2016-08-26 11:13:05 +10:00
Anna Lyons
ef00e98689 SELFOUR-615: arm entry point stubs 2016-08-24 10:42:36 +10:00
Hesham Almatary
c3826e0efe SELFOUR-518: Benchmark - User-level log buffer, delete dump and size system calls
Given that the log buffer is now
(79291252a8) in user-level, the kernel doesn't have
to dump and send the size for users. Users have to take care of this.
2016-08-19 12:57:03 +10:00
Anna Lyons
f34f354a5d SELFOUR-617: one source of memory object sizes
Adds the following constants to libsel4
and uses them in the kernel.

seL4_SectionSize (arm)
seL4_SuperSectionSize (arm)
seL4_HugePageSize (x86 - pae)
seL4_LargePageSize (arm)
seL4_DataFault
seL4_InstructionFault
2016-08-17 12:42:38 +10:00
Stephen Sherratt
0a2a9842d2 libsel4: Explicitly casting cap rights 2016-08-16 17:05:34 +10:00
Stephen Sherratt
9c72698655 Merge pull request #327 in SEL4/sel4 from ~SSHERRATT/sel4:cap-rights-interface to master
* commit 'da0c39f473270a965d8ad73774a204290dd5b44b':
  libsel4: Tidied comments and moved compound rights
  libsel4: Use pragma once in cap rights header
  libsel4: Added cap rights interface wrapper
2016-08-16 03:41:10 +00:00
Stephen Sherratt
da0c39f473 libsel4: Tidied comments and moved compound rights 2016-08-15 15:43:53 +10:00
Hesham Almatary
16c3481109 SELFOUR-518: User-level log buffer
Remove global ksLog and use KS_LOG_PPTR instead

Benchmark - Log buffer: use global page table
2016-08-15 15:06:38 +10:00
Stephen Sherratt
cdf539de1e libsel4: Use pragma once in cap rights header 2016-08-15 11:29:16 +10:00
Stephen Sherratt
216ed97514 libsel4: Added cap rights interface wrapper 2016-08-15 11:22:01 +10:00
Adrian Danis
abaf3dfcfb Merge pull request #245 in SEL4/sel4 from ~CRICHARDSON/sel4:configurable-python to master
* commit '9f9bbc5b89fac99c0d5e132ad5ca3dcfa494e4dc':
  SELFOUR-418: Allow overriding python executable used with PYTHON env var
2016-07-22 04:35:24 +00:00