vbox: add config option to enforce use of IOAPIC

The virtual PCI model delivers IRQs to the PIC by default and to the
IOAPIC only if the guest operating system selected the IOAPIC with the
'_PIC' ACPI method and if it called the '_PRT' ACPI method afterwards.
When running a guest operating system which uses the IOAPIC, but does
not call these ACPI methods (for example Genode/NOVA), the new
configuration option

<config force_ioapic="yes">

enforces the delivery of PCI IRQs to the IOAPIC.

Fixes #2029
This commit is contained in:
Christian Prochaska 2016-06-27 14:38:43 +02:00 committed by Christian Helmuth
parent 761db4bc73
commit 22e908e801
5 changed files with 63 additions and 1 deletions

View File

@ -1 +1 @@
780be1d09ef36e1c287721473830c327cf2276a4
2ee908cb3d7d8e0189158b7b0b55bda5ba406654

View File

@ -8,3 +8,17 @@ The virtual XHCI controller can be enabled with the following
configuration option:
<config xhci="yes">
IOAPIC
======
The virtual PCI model delivers IRQs to the PIC by default and to the IOAPIC
only if the guest operating system selected the IOAPIC with the '_PIC' ACPI
method and if it called the '_PRT' ACPI method afterwards. When running a
guest operating system which uses the IOAPIC, but does not call these ACPI
methods (for example Genode/NOVA), the configuration option
<config force_ioapic="yes">
enforces the delivery of PCI IRQs to the IOAPIC.

View File

@ -13,6 +13,7 @@
/* Genode includes */
#include <base/printf.h>
#include <os/attached_rom_dataspace.h>
/* VirtualBox includes */
#include <VBoxDD.h>
@ -62,3 +63,25 @@ extern "C" int VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version)
return VINF_SUCCESS;
}
/*
* The virtual PCI model delivers IRQs to the PIC by default and to the IOAPIC
* only if the guest operating system selected the IOAPIC with the '_PIC' ACPI
* method and if it called the '_PRT' ACPI method afterwards. When running a
* guest operating system which uses the IOAPIC, but does not call these ACPI
* methods (for example Genode/NOVA), IRQ delivery to the IOAPIC can be
* enforced with the 'force_ioapic' configuration option.
*
* References:
* - 'pciSetIrqInternal()' in DevPCI.cpp
* - '_PIC' and '_PRT' ACPI methods in vbox.dsl
*/
bool force_ioapic()
{
try {
Genode::Attached_rom_dataspace config("config");
return config.xml().attribute_value("force_ioapic", false);
} catch (Genode::Rom_connection::Rom_connection_failed) {
return false;
}
}

View File

@ -0,0 +1,24 @@
Deliver PCI IRQs to the IOAPIC if the 'force_ioapic' configuration option is set.
From: Christian Prochaska <christian.prochaska@genode-labs.com>
Issue #2029
---
src/app/virtualbox/src/VBox/Devices/Bus/DevPCI.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/app/virtualbox/src/VBox/Devices/Bus/DevPCI.cpp b/src/app/virtualbox/src/VBox/Devices/Bus/DevPCI.cpp
index c454d8b..35061d5 100644
--- a/src/app/virtualbox/src/VBox/Devices/Bus/DevPCI.cpp
+++ b/src/app/virtualbox/src/VBox/Devices/Bus/DevPCI.cpp
@@ -663,7 +663,9 @@ static void pciSetIrqInternal(PPCIGLOBALS pGlobals, uint8_t uDevFn, PPCIDEVICE p
* is opened to route PCI interrupts directly to the I/O APIC and bypass the PIC.
* See the \_SB_.PCI0._PRT method in vbox.dsl.
*/
- const bool fIsApicEnabled = pGlobals->fUseIoApic && pbCfg[0xde] == 0xbe && pbCfg[0xad] == 0xef;
+ extern bool force_ioapic();
+ const bool fIsApicEnabled = pGlobals->fUseIoApic &&
+ (force_ioapic() || (pbCfg[0xde] == 0xbe && pbCfg[0xad] == 0xef));
int pic_irq, pic_level;
/* Check if the state changed. */

View File

@ -25,3 +25,4 @@ posix.patch
hostservice.patch
vbox_dd.patch
ide.patch
force_ioapic.patch