Commit Graph

790 Commits

Author SHA1 Message Date
Reto Buerki ecaad9ecce hw_x86_64: Add private _virt_idt_address member to Idt class
This function calculates the address of the IDT for a given virtual
mode transition base address.
2015-03-27 11:53:24 +01:00
Reto Buerki 89add00518 hw_x86_64: Create Idt instance in mtc region
Use the _mt_idt label and the placement new operator to create the Idt
instance in the mtc region.
2015-03-27 11:53:24 +01:00
Reto Buerki 9c8109c276 hw_x86_64: Reserve space for IDT on mode transition pages
On exception, the CPU first checks the IDT in order to find the
associated ISR. The IDT must therefore be placed in the mode transition
pages to make them available for non-core threads.
2015-03-27 11:53:24 +01:00
Reto Buerki d8a10448bb hw_x86_64: Make Idt member functions non-static
Add appropriate Idt object to Genode::Cpu class. Update the hard-coded
TSS base address.
2015-03-27 11:53:24 +01:00
Reto Buerki e3332c6c53 hw_x86_64: Drop obsolete isr.s assembly file 2015-03-27 11:53:24 +01:00
Reto Buerki a361fbd2bc hw_x86_64: Move ISR entries to mode transition page
This is needed to make them available for non-core threads which
initially only have the mode transition page mapped.
2015-03-27 11:53:23 +01:00
Reto Buerki d1a4eaed0d hw_x86_64: Add fake Timer::ms_to_tics implementation
This makes the scheduler happy and it starts scheduling threads.
2015-03-27 11:53:23 +01:00
Adrian-Ken Rueegsegger 4946f21302 hw_x86_64: Set base address and limit of TSS descriptor
The limit is set to match the TSS size - 1 and the base address is
hardcoded to the *current* address of the TSS instance (0x3a1100).

TODO: Set the base address using the 'tss' label. If the TSS descriptor
      format were not so utterly unusable this would be straightforward.
      Changes to the code that indirectly lead to a different location
      of the tss result in #GP since the base address will be invalid.
2015-03-27 11:53:23 +01:00
Adrian-Ken Rueegsegger 58e5f9b2fe hw_x86_64: Jump to actual kernel entry on interrupt 2015-03-27 11:53:23 +01:00
Adrian-Ken Rueegsegger 9f825ffb17 hw_x86_64: Setup and load Task State Segment 2015-03-27 11:53:23 +01:00
Adrian-Ken Rueegsegger 2af5aaa54d hw_x86_64: Add Tss class
The class Genode::Tss represents a 64-bit Task State Segment (TSS) as
specified by Intel SDM Vol. 3A, section 7.7.

The setup function sets the stack pointers for privilege levels 0-2 to
the kernel stack address. The load function loads the TSS segment
selector into the task register.
2015-03-27 11:53:23 +01:00
Adrian-Ken Rueegsegger 793b5264e3 hw_x86_64: Set dpl of syscall IDT entry to 3
Since this IDT entry is called from usermode the descriptor privilege
level must be 3.
2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger ed06c46233 hw_x86_64: Specify user argument to register mapping
Implement user argument setter and getter support functions. The mapping of
the state registers corresponds to the system call parameter passing
convention.
2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger 16a15237a4 hw_x86_64: Continue execution of the kernel
The instruction pointer is the first field of the master context and can
directly be used as a jump argument, which avoids additional register
copy operations.
2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger ecfb954eb9 hw_x86_64: Restore kernel stack pointer 2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger c62b4ea36a hw_x86_64: Restore kernel register values from master context
Set stack pointer to master context and restore kernel register by popping
the values from the master context.
2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger 7b051c0531 hw_x86_64: Restore kernel segment registers
The segment registers are set to reference the kernel data segments of
the GDT.
2015-03-27 11:53:22 +01:00
Adrian-Ken Rueegsegger fb5946b69c hw_x86_64: Save client register values to context
Point stack to client context region and save registers using push
instructions.

Note that since the push instruction first increments the stack pointer
and then stores the value on the stack, the RSP has to point one field
past RBP before pushing the first register value.
2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger 1035efcf3f hw_x86_64: Save info on interrupt stack to client context
As the kernel entry is called from the interrupt handler the stack
layout is as specified by Intel SDM Vol. 3A, figure 6-8. An additional
vector number is stored at the top of the stack.

Gather the necessary client information from the interrupt stack frame
and store it in the client context.
2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger 3d782282db hw_x86_64: Switch to kernel page tables
After switching to the kernel address space the client context region is
accessible to store the client register values.
2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger 16496af371 hw_x86_64: Create temporary copy of client RAX in kernel entry
Copy client context RAX value to buffer to enable use of RAX as scratch
register.
2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger 43bd925c7f hw_x86_64: Add offset constant for Cpu_state.trapno field 2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger 408cec32f5 base: Add errcode to x86_64 Cpu_state
The new errcode field is used to store the error code that some
interrupts provide (e.g. #PF). Rework mode transition reserved space and
offset constants to match the new CPU_state layout.
2015-03-27 11:53:21 +01:00
Adrian-Ken Rueegsegger 1d762ca254 hw_x86_64: Implement syscall with one to six arguments 2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger 04ad1340d5 hw_x86_64: Add syscall helper macros
The macros are used to assign syscall arguments to specific registers.
Using the AMD64 parameter passing convention avoids additional copying of
variables since the C++ function parameters are already in the right
registers.
2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger 3e779e3ca1 hw_x86_64: Perform the user entry mode transition
The interrupt return instruction in IA-32e mode applies the prepared
interrupt stack frame to set the RFLAGS, CS and SS segment as well as
the RIP and RSP registers. It then continues execution of the user code.

For detailed information refer to Intel SDM Vol. 3A, section 6.14.3.
2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger ab9d7afa45 hw_x86_64: Finally restore RAX client register value
Set the stack to the mode transition buffer and pop the temporary copy
of the RAX client value into the register.
2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger 1fc867f1d7 hw_x86_64: Switch to client page tables
After activating the client page tables the client context cannot be
accessed any longer. The mode transition buffer however is globally
mapped and can be used to restore the remaining register values.
2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger 172dec209b hw_x86_64: Restore registers to client context values
Set the stack pointer to the R8 field in the client context to enable
restoring registers by popping values of the stack.

After this step the only remaining registers that do not contain client
values are RAX, RSP and RIP.

Note that the client value of RAX is pop'd to the global buffer region as
the register will still be used by subsequent steps. It will be restored to
the value in the buffer area just prior to resuming client code execution.
2015-03-27 11:53:20 +01:00
Adrian-Ken Rueegsegger 60e799f7b4 hw_x86_64: Set segment registers prior to mode transition
The registers for the ds, es, fs and gs segments are hardcoded to GDT
index 4 with requested privilege level set to 3.
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger fe22858550 hw_x86_64: Adjust EFLAGS of prepared interrupt stack frame
Set I/O privilege level to 3 to allow core to perform port I/O from
userspace. Also make sure the IF flag is cleared for now until interrupt
handling is implemented.
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger 40862a81eb hw_x86_64: Prepare interrupt stack frame in mode transition buffer
Setup an IA-32e interrupt stack frame in the mode transition buffer region.
It will be used to perform the mode switch to userspace using the iret
instruction.

For detailed information about the IA-32e interrupt stack frame refer to
Intel SDM Vol. 3A, figure 6-8.
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger 4b7a5ced3b hw_x86_64: Declare CPU context offset constants
The constants specify offset values of CPU context member variables as
specified by Genode::Cpu_state [1] and Genode::Cpu::Context [2].

[1] - repos/base/include/x86_64/cpu/cpu_state.h
[2] - repos/base-hw/src/core/include/spec/x86/cpu.h
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger e3f10b5ce2 hw_x86_64: Reserve space for mode transition buffer
Since the buffer stores an IA-32e interrupt stack frame, its size must
be 6 * 8 bytes.
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger 03929b3cc9 hw_x86_64: Add 64-bit user code and data segments to GDT
The new entries specify a 64-bit code segment with DPL 3 at index 3 and a
64-bit data segment with DPL 3 at index 4.

These segments are needed for transitioning to user mode.
2015-03-27 11:53:19 +01:00
Adrian-Ken Rueegsegger 51d515c77f hw_x86_64: Explicitly set up segment selectors during boot 2015-03-27 11:53:18 +01:00
Adrian-Ken Rueegsegger 65de09c7a6 hw_x86_64: Reserve space for client context pointer
A pointer to the client context is placed in the mt_client_context_ptr area.
It is used to pass the current client context to the lowlevel mode-switching
assembly code.
2015-03-27 11:53:18 +01:00
Adrian-Ken Rueegsegger 4417fe6201 hw_x86_64: Implementation of IA-32e paging
IA-32e paging translates 48-bit linear addresses to 52-bit physical
addresses. Translation structures are hierarchical and four levels deep.
The current implementation supports regular 4KB and 1 GB and 2 MB large
page mappings.

Memory typing is not yet implemented since the encoded type bits depend
on the active page attribute table (PAT)*.

For detailed information refer to Intel SDM Vol. 3A, section 4.5.

* The default PAT after power up does not allow the encoding of the
  write-combining memory type, see Intel SDM Vol. 3A, section 11.12.4.
* Add common IA-32e paging descriptor type:
    The type represents a table entry and encompasses all fields shared by
    paging structure entries of all four levels (PML4, PDPT, PD and PT).
* Simplify PT entry type by using common descriptor:
    Differing fields are the physical address, the global flag and the memory
    type flags.
* Simplify directory entry type by using common descriptor:
    Page directory entries (PDPT and PD) have an additional 'page size' field
    that specifies if the entry references a next level paging structure or
    represents a large page mapping.
* Simplify PML4 entry type by using common descriptor
    Top-level paging structure entries (PML4) do not have a 'pat' flag and the
    memory type is specified by the 'pwt' and 'pcd' fields only.
* Implement access right merging for directory paging entries
    The access rights for translations are determined by the U/S, R/W and XD
    flags. Paging structure entries that reference other tables must provide
    the superset of rights required for all entries of the referenced table.
    Thus merge access rights of new mappings into existing directory entries to
    grant additional rights if needed.
* Add cr3 register definition:
    The control register 3 is used to set the current page-directory base
    register.
* Add cr3 variable to x86_64 Cpu Context
    The variable designates the address of the top-level paging structure.
* Return current cr3 value as translation table base
* Set context cr3 value on translation table assignment
* Implement switch to virtual mode in kernel
    Activate translation table in init_virt_kernel function by updating the
    cr3 register.
* Ignore accessed and dirty flags when comparing existing table entries
    These flags can be set by the MMU and must be disregarded.
2015-03-27 11:53:18 +01:00
Reto Buerki c7cadf52a6 hw_x86_64: setup ISR and IDT
* Add isr.s assembler file:
    The file declares an array of Interrupt Service Routines (ISR) to handle
    the exception vectors from 0 to 19, see Intel SDM Vol. 3A, section
    6.3.1.
* Add Idt class:
  * The class Genode::Idt represents an Interrupt Descriptor Table as
    specified by Intel SDM Vol. 3A, section 6.10.
  * The setup function initializes the IDT with 20 entries using the ISR
    array defined in the isr.s assembly file.
* Setup and load IDT in Genode::Cpu ctor:
    The Idt::setup function is only executed once on the BSP.
* Declare ISRs for interrupts 20-255
* Set IDT size to 256
2015-03-27 11:53:18 +01:00
Reto Buerki 6e0f1a4466 hw_x86_64: Adjust size of _mt_master_context
The CPU state in IA-32e mode consists of 20 64-bit registers.
2015-03-27 11:53:18 +01:00
Reto Buerki 0f624cdde7 hw_x86_64: Perform indirect long jump to 64-bit code 2015-03-27 11:53:18 +01:00
Reto Buerki 15d0e86592 hw_x86_64: Load Global Descriptor Table register 2015-03-27 11:53:17 +01:00
Reto Buerki 27191b17ce hw_x86_64: Declare Global Descriptor Table (GDT) in .data
The table specifies a 64-bit code segment descriptor at index 1, a
64-bit data segment descriptor at index 2 and a task segment descriptor
at index 3.
2015-03-27 11:53:17 +01:00
Reto Buerki 59bba7624f hw_x86_64: Set system control flags of cr0 register
Enable paging, write protection, caching and native FPU error reporting,
see Intel SDM Vol. 3A, section 2.5.
2015-03-27 11:53:17 +01:00
Reto Buerki 032fc3b190 hw_x86_64: Enable IA-32e mode and execute-disable
Set bits 8 (LME) and 11 (NXE) in the IA32_EFER MSR to enable IA-32e mode
and execute-disable.
2015-03-27 11:53:17 +01:00
Reto Buerki d23cd7e5ff hw_x86_64: Load initial pagetable address into cr3 2015-03-27 11:53:17 +01:00
Reto Buerki bafb893a70 hw_x86_64: Declare initial pagetables in .data segment
The table specifies the initial identity mapping for the memory region
from 2 MiB to 4 MiB using one 2 MiB mapping.
2015-03-27 11:53:17 +01:00
Reto Buerki be430b9648 hw_x86_64: Enable Physical Address Extension (PAE)
This is a prerequisite for IA-32e mode.
2015-03-27 11:53:16 +01:00
Adrian-Ken Rueegsegger 3ad0f06b06 hw: Drop unnecessary include in pd.h 2015-03-27 11:53:16 +01:00
Norman Feske a974726e26 hw: skeleton for building on x86_64
This patch contains the initial code needed to build and bootstrap the
base-hw kernel on x86 64-bit platforms. It gets stuck earlier
because the binary contains 64-bit instructions, but it is started in
32-bit mode. The initial setup of page tables and switch to long mode is
still missing from the crt0 code.
2015-03-27 11:53:16 +01:00
Alexander Boettcher 97758f8468 libc: use correct type for dummy libc functions
as far as possible. Some functions are internal to libc and no public
header are available.

Fixes #1466
2015-03-27 11:53:16 +01:00
Josef Söntgen e53e6b0c5c vbox: rework network backend
* Handle signals and thereby work asynchronously
* Forward link-state changes to the attached AboveNetwork

Fixes #1465.
2015-03-27 11:53:15 +01:00
Josef Söntgen 19f8666170 vbox_auto_win7_share: adapt to new DHCP behavior
Issue #1327.
2015-03-27 11:53:15 +01:00
Josef Söntgen be6d8db491 noux_net_netcat: adapt to new DHCP behavior
Issue #1327.
2015-03-27 11:53:15 +01:00
Josef Söntgen 88c1ca8e9c lwip: adapt run script to new DHCP behavior
We will always get an IP after the server was started. Therefore, we
have to wait until we see the "got IP" message.

Issue #1327.
2015-03-27 11:53:14 +01:00
Josef Söntgen c6f33fc0d2 netperf: adapt to link-state change changes
Change the matching mechanism because the IP address message may appear
at any time after starting the netserver when using lwip.

Issue #1327.
2015-03-27 11:53:14 +01:00
Josef Söntgen 2d469cb35c lwip: packet-stream/link-state signals in recv thread
Issue #1327
2015-03-27 11:53:14 +01:00
Josef Söntgen 6c6375aa83 lwip: use netifapi
The netifapi makes sure, that all operations are done in the context of
the tcpip-thread.

Issue #1327.
2015-03-27 11:53:14 +01:00
Josef Söntgen 5518a21692 lwip: clean up patches
Issue #1327.
2015-03-27 11:53:13 +01:00
Josef Söntgen dd47129bef nic session: link-state change handling
A Nic::Session client can install a signal handler that is used to
propagate changes of the link-state by calling 'link_state_sigh()'.
The actual link state is queried via 'link_state()'.

The nic-driver interface now provides a Driver_notification callback,
which is used to forward link-state changes from the driver to the
Nic::Session_component.

The following drivers now provide real link state: dde_ipxe, nic_bridge,
and usb_drv. Currently, OpenVPN, Linux nic_drv, and lan9118 do not
support link state and always report link up.

Fixes #1327
2015-03-27 11:53:13 +01:00
Josef Söntgen e4f6fca355 packet_allocator: catch expection when calling free()
If a client acknowledges the same packet more than once, the packet also
gets freed more than once. At the second attempt the underlaying
Bit_array will throw an 'Invalid_clear' exception, which results in an
uncaught exception that leads to an abort() call in the freeing
component.

Fixes #1462.
2015-03-27 11:53:13 +01:00
Stefan Kalkowski 381711dbea hw: extend warning messages to ease debugging
To ease debugging without the need to tweak the kernel every time, and to
support userland developers with useful information this commit extends several
warnings and errors printed by the kernel/core by which thread/application
caused the problem, and what exactly failed.

Fix #1382
Fix #1406
2015-03-27 11:53:13 +01:00
Martin Stein ff6595f150 hw: enable destruction of IRQ sessions
Implement the missing Irq_session_component destructor.

Fix #1460
2015-03-27 11:53:13 +01:00
Martin Stein 98616a1812 i.MX53: SD-card driver and bench
The driver for the Freescale eSDHCv2 doesn't support the highest
available bus frequency by now and also the bus width may be set to a
higher value but that needs further checks on the capabilities of the
inserted card.

The commits provide a benchmark as it exists for the OMAP4 SDHC driver.

Fix #1458
2015-03-27 11:53:12 +01:00
Martin Stein c52bf757f0 register: make bitfield-mask methods constexpr
Ref #1458
2015-03-27 11:53:12 +01:00
Alexander Boettcher 7f0460c6a5 launchpad: handle case running out of threads
Fixes #111
2015-03-27 11:53:12 +01:00
Alexander Boettcher 30094ecd48 okl4: check result of bind_thread
Related to #1418
Issue #111
2015-03-27 11:53:12 +01:00
Alexander Boettcher 096d72de90 base: check result of bind_thread
Related to #1418
Issue #111
2015-03-27 11:53:12 +01:00
Alexander Boettcher c76de84f0a gems: let run decorator-stress on 64bit
Fixes #1247
2015-03-27 11:53:12 +01:00
Alexander Boettcher b50d707d5b nova: leverage kernel to implement Genode signals
Fixes #1446
2015-03-27 11:53:11 +01:00
Alexander Boettcher f5329c23b7 nova: update to kernel branch introducing signals
+ adjust syscall headers accordingly

Issue #1446
2015-03-27 11:53:11 +01:00
Alexander Boettcher 1f8fad8fa1 base: refactor signal_transmitter::submit
Move it to platform specific .cc file, so that it may get re-implemented
platform specifically if needed.

Issue #1446
2015-03-19 09:32:52 +01:00
Christian Prochaska dac3efcc02 vbox: replace too strict assertion with debug message
The 'continue_hw_accelerated' assertion at the end of the recall handler
can fail in situations which are not problematic, for example if the
'Timer' thread has set the 'VMCPU_FF_TIMER' flag in the meantime and
requested a recall afterwards. Since we don't know for sure if a recall is
requested for the other flags as well, the assertion gets replaced by a
debug message, which gets printed if any of the 'not yet verified as safe'
flags is set.

Fixes #1426
2015-03-19 09:25:04 +01:00
Josef Söntgen 9b7e0ce0a5 part_blk: add GPT support
The GUID partition table (GPT) is primarily used by systems using
(U)EFI and is a replacement for the legacy MBR. For now, the current
implementation is able to address up to 128 GUID partition entries
(GPE).

To enable the GPT support in 'part_blk' it has to be configured
accrodingly:

! <start name="part_blk">
! [...]
!   <config use_gpt="yes">
! [...]
! </start>

If 'part_blk' is not able to find a valid GPT header it falls back
to using the MBR.

Current limitations:

Since no endian conversion takes place it only works on LE platforms
and of all characters in the UTF-16 encoded name field of an entry
only the ones included in the ASCII encoding are printed. It also
ignores all GPE attributes.

Issue #1429.
2015-03-19 09:22:37 +01:00
Christian Helmuth 2694b5f9c6 nitpicker: fix refresh of pointer view on stacking
Fixes #1441
2015-03-19 09:17:54 +01:00
Christian Helmuth d8e50dd366 nitpicker: add hover report
The hover reports provides information about the session currently
pointed-to, i.e., hovered session. It can be enabled by the 'hover'
attribute of nitpicker's 'report' configuration element

  <report hover="yes" />

Fixes #1442
2015-03-19 09:17:36 +01:00
Alexander Boettcher 2a4b67f90b nova: fix syscall bindings for 32bit
The bindings for 32bit did not consider that in the syscall_3 function
edx changes due to the assembly instructions and that in the syscall_4
function edx and ecx change. So, the compiler wrongly assumed that the
content of these registers stayed unchanged.

Fixes #1447
2015-03-19 09:13:32 +01:00
Alexander Boettcher e664c979b2 base: adjust 'affinity.run' time for vea9x4
remove imx53 since it has a single CPU
2015-03-19 08:57:22 +01:00
Sebastian Sumpf 36e01b720e ldso: Refactor dynamic linker
Issue #1349
2015-03-19 08:57:22 +01:00
Alexander Boettcher c94145f74d base: run mp_server also on single core setups 2015-03-19 08:57:22 +01:00
Christian Helmuth 5c728cf0c4 linux: log diagnostic message on exceptions
Log the fact that a software exception will terminate the process and
hint about more information available from the Linux kernel log.

Fixes #1457
2015-03-19 08:57:22 +01:00
Norman Feske 560a58e5c6 Move packet stream to Genode namespace, fix #1455 2015-03-19 08:57:22 +01:00
Norman Feske 001b069509 Simplify base/semaphore.h, fix #1453 2015-03-19 08:57:21 +01:00
Norman Feske d841fbb82e Add missing header in base/signal.h 2015-03-19 08:57:20 +01:00
Norman Feske 45c9739fe7 Remove repos/qt4, fix #1451 2015-03-19 08:57:20 +01:00
Norman Feske 99e7f26b99 Remove base/include/base/errno.h, fix #1450 2015-03-19 08:57:20 +01:00
Norman Feske 2ddf941660 Abandon Init::Traditional_child_policy, fix #1449 2015-03-19 08:57:20 +01:00
Martin Stein d312f840bd hw: error message on unmap on broken RM clients
In the past, unmap sometimes occured on RM clients that have no thread,
PD, or translation table assigned. However, this shouldn't be the
case anymore.

Fixes #504
2015-03-19 08:57:20 +01:00
Stefan Kalkowski 657646e76e hw: adjust core bootstrap to fit generic process
* Introduce hw-specific crt0 for core that calls e.g.: init_main_thread
* re-map core's main thread UTCB to fit the right context area location
* switch core's main thread's stack to fit the right context area location

Fix #1440
2015-03-19 08:57:19 +01:00
Alexander Boettcher 2ad6a3b934 vbox: support multi touch input events
Fixes #1444
2015-03-19 08:57:19 +01:00
Alexander Boettcher c745f9b48c nitpicker: forward touch events
Issue #1444
2015-03-19 08:57:19 +01:00
Alexander Boettcher cd764a6aa6 usb: support multi touch devices
Issue #1444
2015-03-19 08:57:18 +01:00
Alexander Boettcher 71c3fa53da os: add input touch event type
Issue #1444
2015-03-19 08:57:18 +01:00
Reto Buerki ebfe3d8ff0 hw: Use mtc_size from Cpu class for mtc::SIZE
This decouples the size of the mode transition control region from the
minimal mapping size of the page tables implementation. Rather, the CPU
architecture is able to specify the actual size.

Rationale: For x86_64, we need the mtc region to span two pages in order
to store all the tables required to perform the mode switch.
2015-03-13 12:17:28 +01:00
Reto Buerki 32521cfd71 hw: Declare mtc_size constant in arm/cpu_support.h
This constant specifies the size of the mode transition control region.
2015-03-13 12:17:28 +01:00
Josef Söntgen 47b0aea30d wifi_drv: use report mechanism in wifi.run
Update the wifi run script to reflect the current configuration
mechanism used by the wifi driver.

Issue #1439.
2015-03-13 12:17:28 +01:00
Josef Söntgen 9d5b119186 wifi_drv: add dummy member to empty structs
The size of empty structs differs in C (0 byte) and C++ (1 byte), which
leads to different offsets in compound structures. This fixes the driver
on 32Bit platforms.

Issue #1439.
2015-03-13 12:17:27 +01:00
Josef Söntgen 36bcc69faf wifi_drv: on timeout return correct remaining time
Issue #1439.
2015-03-13 12:17:27 +01:00
Josef Söntgen 7e69013e0c wifi_drv: store timeout also in timer_list.expires
The wireless stack calls timer_before(foo, timer.expires) and up to now
it was always 0. Let's be save and set this field when scheduling the
timer, although it worked fine so far.

Issue #1439.
2015-03-13 12:17:27 +01:00
Josef Söntgen 88fc1eee61 wifi_drv: add verbose attribute in config node
Among others, the driver will now print the MAC address of the wireless
device when 'verbose="yes"' is added to <config>.

Issue #1439.
2015-03-13 12:17:27 +01:00
Josef Söntgen c46e3db4d5 wifi_drv: silence 'Slab too large' error
We will always see this error message when the driver is started. It
is expected and not an actual error. When the driver is running it will
not allocate larger chunks than the Slab provides. Therefore, we can
safely ignore this message.

Issue #1439.
2015-03-13 12:17:27 +01:00
Christian Prochaska c11b02dfd4 gdb: save generated files in the build directory
Fixes #1435
2015-03-13 12:17:26 +01:00
Christian Prochaska 1f7fd647da vbox: wait longer for stable timer state
Some functions in the time manager, for example 'TMTimerSet()' and
'TMTimerStop()' let VirtualBox abort with a failed assertion if the timer
does not change to a 'stable' state after 1000 calls of a mixture of
'yield' and 'sleep'. On Genode, this happens sometimes when the 'EMT'
thread is executing 'TMTimerSet()' and gets interrupted by the 'TAP'
thread, which calls 'TMTimerStop()' and waits for the 'EMT' thread to
finish setting the timer. Since the 'EMT' thread has the lowest priority,
1000 retries can be too few. Without the assertion, these functions would
return an error code, which is often ignored by the caller, so it seems
safer to keep retrying until the function can return successfully.

Fixes #1437
2015-03-13 12:17:26 +01:00
Christian Helmuth 143c703669 vbox: prevent warning 2015-03-13 12:17:26 +01:00
Christian Helmuth 86c0656de0 vbox: cleanup device registration
Patch got lost on win8 merge ;-)
2015-03-13 12:17:25 +01:00
Martin Stein a5d043443d run/signal: abort "many contexts" if manage fails
Previously, in the manage-many-contexts test we didn't test wether the manage
operations succeed.

Ref #1433
2015-03-13 12:17:25 +01:00
Martin Stein 726e6b3e5d signal: fix infinite loop
Fixes #1433
2015-03-13 12:17:25 +01:00
Josef Söntgen 7923b287d9 wifi_drv: fix find_next_bit function
Among others, this function is used in the for_each_set_big() macro,
which is used when configuring the data rate tables. Therefore, this
fixes observed performance issues.

Fixes #1439.
2015-03-13 12:17:25 +01:00
Josef Söntgen f94176af3f wifi_drv: handle invalid config_rom and psk
* Only attach the config_rom dataspace if it is valid.
* Check if PSK has a valid length.

Issue #1439.
2015-03-13 12:17:25 +01:00
Josef Söntgen d443c136ed wpa_supplicant: report quality value
Issue #1439.
2015-03-13 12:17:25 +01:00
Alexander Boettcher 3279346f80 nova: update kernel (fixes endless loop)
If running multiple VBox VMMs with Windows as guest concurrently then it may
happen that the system seem to hang. It turned out that actually
a VM-exit storm (vmx_exception->handle_exc_nm) causes a endless loop between
kernel and vCPU. Nothing gets scheduled nor interrupts are received anymore.
The referenced kernel commit fixes this issue.

Issue #1343
2015-03-13 12:17:24 +01:00
Christian Helmuth d6f9725548 libc: fix compiler warning (issue #1434) 2015-03-13 12:17:24 +01:00
Emery Hemingway f2d6e38cb4 fb_sdl: set size from config
Issue #1414
2015-03-13 12:17:24 +01:00
Christian Prochaska c68828519e vbox: revert 'PGMR3Phys{Read,Write}External'
Fixes #1417
2015-03-13 12:17:24 +01:00
Alexander Boettcher d303a25489 foc: increase maximal supported threads
Fixes #1418
2015-03-13 12:17:24 +01:00
Alexander Boettcher 75ab803ea2 foc: check result of bind_thread
Issue #1418
2015-03-13 12:17:24 +01:00
Alexander Boettcher d7b88afb68 base: propagate bind_thread result of pd_session
Issue #1418
2015-03-13 12:17:23 +01:00
Stefan Kalkowski 679f66667c l4lx: don't request framebuffer dataspace twice
Fixes #1427
2015-03-13 12:17:23 +01:00
Alexander Boettcher e5b187ce16 vbox: support wheel input events
Issue #1438
2015-03-13 12:17:23 +01:00
Alexander Boettcher c8a9b1802e vbox: enable usb support for guests
Fixes #1438
2015-03-13 12:17:23 +01:00
Christian Prochaska d76220d6a9 qt5: save generated source files in the contrib directory
Fixes #1436
2015-03-13 12:17:23 +01:00
Norman Feske e8336acafc base,os: Coding-style unification
Fixes #1432
2015-03-13 12:17:23 +01:00
Norman Feske 56ed7addbc base: fix misleading ROM-connection error message 2015-03-04 17:32:20 +01:00
Norman Feske f9269f5cb1 Adapt base-codezero to new ports mechanism
Fixes #1425
2015-03-02 12:19:12 +01:00
Sebastian Sumpf e866bf3fa3 l4linux: Adapt netperf run script to new run tool
With the new run tool, we net to use the 'serial_id' when using the 'send'
command.
2015-02-27 11:48:36 +01:00
Alexander Boettcher d68c7d1d10 usb: rename coordinates to width/height for touch 2015-02-27 11:48:36 +01:00
Sebastian Sumpf 89dbc10334 L4Linux: Update hash and revision (eager FPU)
The corresponding L4Linux fix:

25aa4a5f25
2015-02-27 11:48:36 +01:00
Martin Stein c78efd4428 odroid_xu: prevent tests with sd/platform/ahci/fb
Drivers like SD-Card, platform, AHCI, and framebuffer are specified as Exynos5
compliant. But they are at least not compliant with Odroid-XU although this is
Exynos5. Thus, prevent tests that rely on such drivers when building for
hw_odoid_xu. Furthermore, make previous Arndale regulator/consts.h,
uart_defs.h, and some Board_base enums available to all Exynos5 builds to
enable at least building the drivers.

Fixes #1419
2015-02-27 11:48:36 +01:00
Martin Stein 9737b5d966 tz_vmm: support USB-Armory board
For the USB-Armory, we use a newer version of Linux (3.18) as for the
i.MX53-QSB. The main difference is, that the newer Linux uses a DTB instead of
ATAGs.

Fixes #1422
2015-02-27 11:48:35 +01:00
Martin Stein be392b3bf9 hw: support USB-Armory board
The USB Armory is almost the same as the i.MX53-QSB but it uses only
one of the two RAM banks available in i.MX53. Furthermore we use the USB
Armory only with Trustzone enabled.

Ref #1422
2015-02-27 11:48:35 +01:00
Sebastian Sumpf 2b87628b3c base-foc: Update hash/revision for cli patch.
Issue #1420
2015-02-27 11:48:08 +01:00
Sebastian Sumpf 76d38a8c76 L4Linux: Update hash and revision (SMEP patch)
The corresponding L4Linux fix:

  7f2ab08eb6
2015-02-27 11:48:08 +01:00
Stefan Kalkowski c176fc24a1 tz_vmm: make script success detection more robust 2015-02-27 11:48:08 +01:00
Christian Prochaska 70540e6f8e Improve 'Timed_semaphore' accuracy
Fixes #1421
2015-02-27 11:48:07 +01:00
Martin Stein d2b82274db run scripts: don't use is_qemu_available anymore
With the new run tool, there is no more is_qemu_available function. However,
some scripts still try to use it because only frequently used scripts were
updated by now. The commit replaces the function calls with the new
'have_include power_on/qemu' check.

Ref #1419
2015-02-27 11:48:07 +01:00
Josef Söntgen 8d9561595c netperf: add wifi test
Enables testing of the wifi_drv with netperf.

Fixes #1415.
2015-02-27 11:48:07 +01:00
Josef Söntgen 894974f73b wifi_drv: copy firmware images to build directory
Always copy the firmware images to the bin directory within the
build directyry when building the wifi_drv binary.

Issue #1415.
2015-02-27 11:48:06 +01:00
Josef Söntgen 818dad72d0 dde_linux: download firmware for iwlwifi driver
Also download firmware images needed by the wifi_drv when preparing
the dde_linux port. The images are placed in 'firmware' directory.

Issue #1415.
2015-02-27 11:48:06 +01:00
Josef Söntgen 85031f1c1a wifi: report wlan networks
The wifi_drv now provides two reports. The first one contains all
accesspoints that were found while scanning the supported frequencies.
The second one reports the state of the driver, i.e., if it is
conntected to an accesspoint or not. In addition to that, the driver
now gets its configuration via a ROM session.

More detailed information are available in 'repos/dde_linux/README'.

Issue #1415.
2015-02-27 11:48:06 +01:00
Alexander Boettcher c578a455ba vbox: adapt auto run scripts for win8
Issue #1413
2015-02-27 11:48:06 +01:00
Christian Helmuth 417199ea64 vbox: enable support for Windows 8
Fixes #1413
2015-02-27 11:48:05 +01:00
Alexander Boettcher d86380d744 nova: provide assessors in utcb for efer register
Issue #1413
2015-02-27 11:48:05 +01:00
Stefan Kalkowski 7582396e9c hw_arndale: enable ARM virtualization extensions
* enables world-switch using ARM virtualization extensions
* split TrustZone and virtualization extensions hardly from platforms,
  where it is not used
* extend 'Vm_session' interface to enable configuration of guest-physical memory
* introduce VM destruction syscall
* add virtual machine monitor for hw_arndale that emulates a simplified version
  of ARM's Versatile Express Cortex A15 board for a Linux guest OS

Fixes #1405
2015-02-27 11:48:05 +01:00
Stefan Kalkowski 07c8d1652e hw_arndale: setup ARM hypervisor mode
To enable support of hardware virtualization for ARM on the Arndale board,
the cpu needs to be prepared to enter the non-secure mode, as long as it does
not already run in it. Therefore, especially the interrupt controller and
some TrustZone specific system registers need to be prepared. Moreover,
the exception vector for the hypervisor needs to be set up properly, before
booting normally in the supervisor mode of the non-secure world.

Ref #1405
2015-02-27 11:48:05 +01:00
Stefan Kalkowski e7dad39016 uart_drv: enable RX channel for exynos5 driver
This is useful for automated tests on this platform, where the run script
wants to interact with some component via terminal

Ref #1405
2015-02-27 11:48:05 +01:00
Stefan Kalkowski 1e3c80ff5b arm: enable cpu cortex_a15 compiler flag
To enable the usage of virtualization extension related instructions
there is the need to enable the '-mcpu=cortex_a15' compiler flag on
those cpus. To not conflict with other compiler flags (Ref #810) we've
to disable the '-march=arm_v7a' flag.

Ref #1405
2015-02-27 11:48:04 +01:00
Stefan Kalkowski 8e2b4d6f45 hw: extend kernel interrupt class
The generalization of interrupt objects in the kernel and the use of
C++ polymorphism instead of explicitely checking for special interrupts
within generic code (Cpu_job::_interrupt) enables the registration of
additional interrupts used by the kernel, which are needed for specific
aspects added to the kernel, like ARM hardware virtualization interrupts.

* Introduce generic base class for interrupt objects handled by the kernel
* Derive an interrupt class for those handled by the user-land
* Implement IPI-specific interrupt class
* Implement timer interrupts using the new generic base class

Ref #1405
2015-02-27 11:43:56 +01:00
Stefan Kalkowski 0836726df2 hw: use one IRQ for all cpus to send IPIs
Until now, one distinct software generated IRQ per cpu was used to
send signals between cpus. As ARM's GIC has 16 software generated
IRQs only, and they need to be partitioned between secure/non-secure
TrustZone world as well as virtual and non-virtual worlds, we should
save them.

Ref #1405
2015-02-27 11:43:56 +01:00
Stefan Kalkowski a40932a324 hw: refactor irq controllers
* name irq controller memory mapped I/O regions consistently
  in board descriptions
* move irq controller and timer memory mapped I/O region descriptions
  from cpu class to board class
* eliminate artificial distinction between flavors of ARM's GIC
* factor cpu local initialization out of ARM's GIC interface description,
  which is needed if the GIC is initialized differently e.g. for TrustZone

Ref #1405
2015-02-27 11:43:56 +01:00
Sebastian Sumpf c13fbff8c1 rump: Silence build process
The 'dest' target is renamed in the updated rump version  to 'dest.stage'. This
triggered some building steps, even when the targets already existed.

Issue #1409
2015-02-27 11:43:56 +01:00
Sebastian Sumpf 47b0b9b689 rump: Enable single CPU lock semantics
* Compile in single CPU support only
* Fix 'try_enter' semtantic for mutexes
* Unschedule when entering RW locks

Issue #1409
2015-02-27 11:43:56 +01:00
Sebastian Sumpf 422923cc95 rump: Add 'get_random_backend' function
A rump server may now implement its own random number generator, the default
impelementation will not generate random number.

Issue #1409
2015-02-27 11:43:55 +01:00
Alexander Boettcher a594ae703d base: fix location_of_index affinity calculation
Take care that ypos parameter is smaller than height().
If it is not - wrap around.

Issue #1412.
2015-02-27 11:43:55 +01:00
Alexander Boettcher babe1d1026 acpi: amend handling MMIO regions for ACPI tables
The handling of MMIO regions now supports more pathological cases with
weird cross references. Also, MMIO regions are releases after the
parsing is done.

Fixes #998
2015-02-27 11:40:59 +01:00
Christian Prochaska 679ae1dd14 vbox: improve virtual time accuracy
Fixes #1411
2015-02-27 11:40:58 +01:00
Alexander Boettcher a31378476d nova: use in core one pager per CPU
Fixes #1394
2015-02-27 11:40:58 +01:00
Alexander Boettcher 6329395026 run: remove upgrade messages in mp_server script 2015-02-17 14:18:16 +01:00
Martin Stein 3a40c27c26 hw_vea9x4: quickfix slow RAM access
Setting the ACTLR.SMP bit also without SMP support fastens RAM access
significantly. A proper solution would implement SMP support which must enable
the bit anyway.

Fixes #1353
2015-02-17 14:18:16 +01:00
Alexander Boettcher 2b69310adf nova: detect overlapping module regions
Detect overlapping regions which should not overlap and print some meaningful
message instead of dying with some mysterious page fault.

Issue #1402
2015-02-16 14:01:45 +01:00
Alexander Boettcher 2e1686558c run: constrain physical memory for pci/acpi driver
Permit pci/acpi driver to constrain physical memory allocation to needs of
the driver it serves.

Fixes #1045
2015-02-16 13:40:38 +01:00
Alexander Boettcher 34719c4589 pci: allocate below 3G physical for 32bit & iommu
Related to #696.

Issue #1045
2015-02-16 13:40:38 +01:00
Alexander Boettcher 8c66a4b1be base: support phys range specifier in ram_session
Fixes #696
2015-02-16 13:40:38 +01:00
Alexander Boettcher 95ff5ba11d base: support range restriction in allocator
Issue #696
2015-02-16 13:40:38 +01:00
Alexander Boettcher 57c4678aa1 gdb: adapt gdb_monitor run scripts
Adjustment are required due to changes of the new run tool and the new shared
library implementation.

Issue #1192
2015-02-16 13:40:37 +01:00
Stefan Kalkowski 322be1b4fb hw: LPAE for Cortex a15 (fix #1387) 2015-02-16 13:40:37 +01:00
Stefan Kalkowski 21fd2fc582 hw: introduce ARM LPAE extension (ref #1387)
This patch adds support for the Large Physical Address Space Extension
for ARM v7.
2015-02-16 13:40:37 +01:00
Stefan Kalkowski 102444b82b hw: remove pointless, wasted memory in pd object
(ref #1387)
2015-02-16 13:40:37 +01:00
Stefan Kalkowski 34f169293f hw: fix page table handling of core (ref #1387)
There might be more then one nested slab allocation.
2015-02-16 13:40:37 +01:00
Josef Söntgen 4ca1284e0e vfs: do not return early on directory operations
When returning early on directory operations, file systems that might
be able to handle the request but come after the current one are not
tried.

Fixes #1400.
2015-02-16 13:40:36 +01:00
Sebastian Sumpf c2c8483293 usb_drv: Fix controller initialization on RPI
Execute high priority tasklets immediately, these tasklets need to be processed
before any other work.

Issue #1401
2015-02-16 13:40:36 +01:00
Martin Stein 5dea0b40aa hw: don't use ARM CPU-state stuff in generic code
Fixes #1404
2015-02-16 13:40:36 +01:00
Martin Stein 63f8a38b5a hw: default boot-modules vpath is generic
Ref #1404
2015-02-16 13:40:36 +01:00
Norman Feske cb579ec8d7 hw: minor 64-bit fixes 2015-02-16 13:40:36 +01:00
Stefan Kalkowski a3abf74d1e hw: remove code duplication related to Exynos5 SoC
Fixes #1396
2015-02-16 13:40:36 +01:00
Josef Söntgen a838b6a657 noux: add local nanosleep(2) and sleep(3)
Up to now Noux used the libc sleep functions, which actually is not
possible because the _nanosleep() function implemented by our libc
creates a new thread to handle the timeout. Noux childs may have
only one thread, e.g., the main thread, though. To fix this issue
sleeping is now handled directly by Noux. It is implemented by calling
select(2) with a timeout. This fix is needed for mutt(1), which calls
sleep when it prints a notification for the user.

Fixes #1374.
2015-02-16 13:40:35 +01:00
Sebastian Sumpf 7ecd83373c rump: Reduce startup latency
Since rump now requires large buffers of random numbers (>= 512 bytes), use the
jitterentropy library instead of the slow timer pseudo random number generation.

Fixes #1393
2015-02-16 13:40:35 +01:00
Sebastian Sumpf ab0fd6510f jitterentropy: Fix foreign import
Make the jitterentropy library accessible from other repositories.

Noticed while working on issue #1393
2015-02-16 13:40:35 +01:00
Stefan Kalkowski b69deec067 autopilot: adapt runscripts to run new tool
Related to #1372.
2015-02-16 13:40:35 +01:00
Stefan Kalkowski 0ac039fad7 L4Linux: make ballooning driver configureable
To circumvent compilation errors with the older L4Android Linux kernel
version, the ballooning driver is included in the more recent L4Linux
kernel only. Moreover, to be able to maintain L4Android / L4Linux in a more
convenient way, e.g. to apply patches valid for both versions, we use
the same git clone that is used for L4Linux instead of using the upstream
L4Android version by applying patches.

Fixes #1390
2015-02-16 13:40:35 +01:00
Josef Söntgen 863b6fef80 noux: prevent override in SYSCALL_STAT
Fixes #1386.
2015-02-16 13:40:34 +01:00
Josef Söntgen 0a835e4ce9 os: structured timestamp in Rtc session
Instead of returning an uint64_t value, return a structured time stamp.
This change is only visible to components using Rtc_session directly.

Fixes #1381.
2015-02-16 13:40:34 +01:00
Sebastian Sumpf 6d2c697da1 lxip: Fix timeout handling for 'schedule_timeout'
Up until now 'schedule_timeout' did only wait for the next signal to occur.
However, we might run into situations where there won't occur signals for longer
periods of time. Therefore, we took care of the respective timeout handling.

This commit also adds Genode's tracing support

Issue #1310
2015-02-16 13:40:34 +01:00
Sebastian Sumpf 8843564850 usb_drv: USB terminal driver
Issue #1329
2015-02-16 13:40:34 +01:00
Sebastian Sumpf 3fd561aab6 terminal_echo: Add line feed end carriage return
Issue #1329
2015-02-16 13:40:33 +01:00
Sebastian Sumpf 0c2bdf9edd usb_drv: Remote USB driver interface
Issue #1329
2015-02-16 13:40:33 +01:00
Christian Helmuth e479b9e8e8 ports: also hash patches with absolute path names
Fixes #1305
2015-01-27 12:17:53 +01:00
Sebastian Sumpf 15a379894a lxip: Fix on OKL4
This has been broken for a while now. Use correct (global) signal transmission,
do not use local signal transmission, as signals seems to get lost.

Issue #1310
2015-01-26 12:28:42 +01:00
Wolfgang Faust b2947d2187 Add filenames to code snippets in hello_tutorial
Fixes #1369
2015-01-26 12:28:42 +01:00
Norman Feske 671682cb6a base: use reinterpret_cast for symbol lookup
This patch changes the Shared_object::lookup function to use a
reinterpret_cast instead of a static_cast to allow the conversion
from symbol addresses to arbitrary pointers.
2015-01-26 12:28:42 +01:00
Norman Feske f68889ea0a arora: fix domain config in plugin demo
Fixes #1375
2015-01-26 12:28:42 +01:00
Norman Feske cb4302d06a loader: make CPU session upgradable
Fixes #1379
2015-01-26 12:28:42 +01:00
Norman Feske 623bc82e07 fs_rom: realloc only when dataspace grew
Fixes #1377
2015-01-26 12:28:42 +01:00
Norman Feske ff422ccc6e backdrop: respond to config changes
Fixes #1376
2015-01-26 12:28:42 +01:00
Norman Feske db56946ba9 rom_prefetcher: Yield CPU after each request
By blocking on a timeout, we yield the CPU in order to give a
concurrently running sporadic process a chance to obtain ROM modules.
Otherwise, such requests would be deferred until the ROM prefetcher
completes its operation or in the unlikely event that the prefetcher
gets preempted.

Fixes #1378
2015-01-26 12:28:41 +01:00
Christian Helmuth 86eb3f4a0d rtc: rename get_current_time() to current_time()
Issue #1344
2015-01-26 12:28:41 +01:00
Josef Söntgen 88f62b0988 autopilot: adapt runscripts to new run tool
Related to #1372.
2015-01-26 12:28:41 +01:00
Josef Söntgen c706b1c0a7 run: modularize run tool 2015-01-26 12:28:40 +01:00
Christian Helmuth febca1b827 rtc: pseudo driver for linux + server framework
The commit also includes a test program incl. run script.

Fixes #1344.
2015-01-26 12:28:40 +01:00
Josef Söntgen a36d0ec83a lxip: provide struct file pointer for udp_poll
Lxip may deference the file pointer in 'udp_poll()'. So we provide a
valid dummy object.

Fixes #1371.
2015-01-20 12:05:54 +01:00
Norman Feske 363fd6065d Init: support for aliases for child names
Fixes #1373
2015-01-20 11:25:59 +01:00