Commit graph

107 commits

Author SHA1 Message Date
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
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
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
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
Adrian Danis
099b45074f libsel4: Deprecate bootinfo management 2017-03-08 09:25:47 +11:00
Adrian Danis
256c30ae02 x86: Pass VBE information from multiboot through bootinfo 2017-02-28 16:35:50 +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
Adrian Danis
eccaae51dc s/D61/DATA61/ in license headers for consistency 2017-02-21 16:38:51 +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
Anna Lyons
2c98f49dc5 Add missing case to seL4_getFault 2017-02-08 17:16:06 +11:00
Berkus Decker
31fe08263c Fix typo 2017-01-25 19:13:47 +02:00
Stephen Sherratt
c05210f508 manual: Remove empty cap description attribute 2016-12-16 15:57:57 +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
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
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
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
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
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
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
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
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
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
amrzar
2d462d4ad9 add basic api for setting affinity 2016-10-19 08:35:37 +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
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
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
Hesham Almatary
9c507cffd1 SELFOUR-603 - Benchmark: Add null syscall 2016-09-28 11:05:25 +10: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
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