Changeset 29737 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- May 21, 2010 2:07:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r29250 r29737 755 755 #endif 756 756 757 #ifdef HWACCM_VMX_EMULATE_REALMODE758 757 if ( CPUMIsGuestInRealModeEx(pCtx) 759 758 && pVM->hwaccm.s.vmx.pRealModeTSS) … … 826 825 return VINF_SUCCESS; 827 826 } 828 #endif /* HWACCM_VMX_EMULATE_REALMODE */829 827 830 828 /* Set event injection state. */ … … 1282 1280 #endif 1283 1281 1284 # ifdef HWACCM_VMX_EMULATE_REALMODE1285 1282 /* Intercept all exceptions in real mode as none of them can be injected directly (#GP otherwise). */ 1286 1283 if ( CPUMIsGuestInRealModeEx(pCtx) 1287 1284 && pVM->hwaccm.s.vmx.pRealModeTSS) 1288 1285 u32TrapMask |= HWACCM_VMX_TRAP_MASK_REALMODE; 1289 # endif /* HWACCM_VMX_EMULATE_REALMODE */1290 1286 1291 1287 int rc = VMXWriteVMCS(VMX_VMCS_CTRL_EXCEPTION_BITMAP, u32TrapMask); … … 1351 1347 if (pVCpu->hwaccm.s.fContextUseFlags & HWACCM_CHANGED_GUEST_SEGMENT_REGS) 1352 1348 { 1353 #ifdef HWACCM_VMX_EMULATE_REALMODE1354 1349 if (pVM->hwaccm.s.vmx.pRealModeTSS) 1355 1350 { … … 1421 1416 } 1422 1417 } 1423 #endif /* HWACCM_VMX_EMULATE_REALMODE */1424 1418 1425 1419 VMX_WRITE_SELREG(ES, es); … … 1465 1459 if (pVCpu->hwaccm.s.fContextUseFlags & HWACCM_CHANGED_GUEST_TR) 1466 1460 { 1467 #ifdef HWACCM_VMX_EMULATE_REALMODE1468 1461 /* Real mode emulation using v86 mode with CR4.VME (interrupt redirection using the int bitmap in the TSS) */ 1469 1462 if ( CPUMIsGuestInRealModeEx(pCtx) … … 1488 1481 } 1489 1482 else 1490 #endif /* HWACCM_VMX_EMULATE_REALMODE */1491 1483 { 1492 1484 rc = VMXWriteVMCS(VMX_VMCS16_GUEST_FIELD_TR, pCtx->tr); … … 1646 1638 } 1647 1639 1648 #ifdef HWACCM_VMX_EMULATE_REALMODE1649 1640 /* Turn off VME if we're in emulated real mode. */ 1650 1641 if ( CPUMIsGuestInRealModeEx(pCtx) 1651 1642 && pVM->hwaccm.s.vmx.pRealModeTSS) 1652 1643 val &= ~X86_CR4_VME; 1653 #endif /* HWACCM_VMX_EMULATE_REALMODE */1654 1644 1655 1645 rc |= VMXWriteVMCS64(VMX_VMCS64_GUEST_CR4, val); … … 1787 1777 eflags.u32 |= VMX_EFLAGS_RESERVED_1; 1788 1778 1789 #ifdef HWACCM_VMX_EMULATE_REALMODE1790 1779 /* Real mode emulation using v86 mode. */ 1791 1780 if ( CPUMIsGuestInRealModeEx(pCtx) … … 1797 1786 eflags.Bits.u2IOPL = 0; /* must always be 0 or else certain instructions won't cause faults. */ 1798 1787 } 1799 #endif /* HWACCM_VMX_EMULATE_REALMODE */1800 1788 rc = VMXWriteVMCS(VMX_VMCS_GUEST_RFLAGS, eflags.u32); 1801 1789 AssertRC(rc); … … 2018 2006 pCtx->idtr.pIdt = val; 2019 2007 2020 #ifdef HWACCM_VMX_EMULATE_REALMODE2021 2008 /* Real mode emulation using v86 mode. */ 2022 2009 if ( CPUMIsGuestInRealModeEx(pCtx) … … 2033 2020 } 2034 2021 else 2035 #endif /* HWACCM_VMX_EMULATE_REALMODE */2036 2022 { 2037 2023 /* In real mode we have a fake TSS, so only sync it back when it's supposed to be valid. */ … … 3320 3306 #endif 3321 3307 default: 3322 #ifdef HWACCM_VMX_EMULATE_REALMODE3323 3308 if ( CPUMIsGuestInRealModeEx(pCtx) 3324 3309 && pVM->hwaccm.s.vmx.pRealModeTSS) … … 3336 3321 goto ResumeExecution; 3337 3322 } 3338 #endif3339 3323 AssertMsgFailed(("Unexpected vm-exit caused by exception %x\n", vector)); 3340 3324 rc = VERR_VMX_UNEXPECTED_EXCEPTION;
Note:
See TracChangeset
for help on using the changeset viewer.