vbox: fix interrupt injection in recompiler mode

Fixes #1365
This commit is contained in:
Alexander Boettcher 2015-01-13 22:10:40 +01:00 committed by Christian Helmuth
parent 50950ec248
commit 9262629a86
3 changed files with 29 additions and 2 deletions

View File

@ -1 +1 @@
2f00ccc22f68eb6aa656e721e4bc82a9c5e25093
6fdf666cabbc6926ccc8c54dc00ac471e26a0eac

View File

@ -11,7 +11,7 @@ SHA(virtualbox) := e4c23b713e8715b8e0172fa066f2197756e901fe
PATCHES_LIST := acpi_drv dev_e1000 eminternal fake_pci_vendor iconv mouse
PATCHES_LIST += pdm_driver poke sharedfolder_pagelist
PATCHES_LIST += time-log-deadlock vbox_inc vbox_main network
PATCHES_LIST += vga_fb vga_vbva vmdk vmmdev avoid_yield serial
PATCHES_LIST += vga_fb vga_vbva vmdk vmmdev avoid_yield serial rem_irq
PATCHES := $(addsuffix .patch, $(PATCHES_LIST))
PATCHES := $(addprefix src/virtualbox/patches/, $(PATCHES))

View File

@ -0,0 +1,27 @@
+++ src/app/virtualbox/src/VBox/VMM/VMMR3/TRPM.cpp
@@ -1561,6 +1561,17 @@
return HMR3IsActive(pVCpu) ? VINF_EM_RESCHEDULE_HM : VINF_EM_RESCHEDULE_REM; /* (Heed the halted state if this is changed!) */
}
#else /* !TRPM_FORWARD_TRAPS_IN_GC */
+ /* Restore behaviour as used in 4.2.24 Virtualbox. The PDMGetInterrupt call
+ * and TRPMAssertTrap call in 4.2.24 is solely performed when HM mode is
+ * active.
+ * With 4.3 the TRPMAssertTrap is also performed when running solely (as
+ * done on Genode/Virtualbox for realmode code) in the recompiler. Calling
+ * TRPMAssertTrap in this case leads to the effect, that the Irq isn't
+ * pending anymore for the recompiler and therefore it will not inject it.
+ *
+ * Restoring the original behaviour as of 4.2.24 mitigates the issue.
+ */
+ if (HMR3IsActive(pVCpu)) {
uint8_t u8Interrupt;
int rc = PDMGetInterrupt(pVCpu, &u8Interrupt);
Log(("TRPMR3InjectEvent: u8Interrupt=%d (%#x) rc=%Rrc\n", u8Interrupt, u8Interrupt, rc));
@@ -1571,6 +1582,7 @@
STAM_COUNTER_INC(&pVM->trpm.s.paStatForwardedIRQR3[u8Interrupt]);
return HMR3IsActive(pVCpu) ? VINF_EM_RESCHEDULE_HM : VINF_EM_RESCHEDULE_REM;
}
+ }
#endif /* !TRPM_FORWARD_TRAPS_IN_GC */
}
/** @todo check if it's safe to translate the patch address to the original guest address.