Changeset 2897 in vbox for trunk/src/VBox
- Timestamp:
- May 28, 2007 2:06:00 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r2892 r2897 547 547 int rc = VINF_SUCCESS; 548 548 RTGCUINTPTR val; 549 X86EFLAGS eflags; 549 550 550 551 /* Guest CPU context: ES, CS, SS, DS, FS, GS. */ … … 776 777 777 778 /* Bits 22-31, 15, 5 & 3 must be zero. Bit 1 must be 1. */ 778 val = pCtx->eflags.u32;779 val&= VMX_EFLAGS_RESERVED_0;780 val|= VMX_EFLAGS_RESERVED_1;779 eflags = pCtx->eflags; 780 eflags.u32 &= VMX_EFLAGS_RESERVED_0; 781 eflags.u32 |= VMX_EFLAGS_RESERVED_1; 781 782 782 783 /* Real mode emulation using v86 mode with CR4.VME (interrupt redirection using the int bitmap in the TSS) */ 783 784 if (!(pCtx->cr0 & X86_CR0_PROTECTION_ENABLE)) 784 785 { 785 val |= X86_EFL_VM; 786 if (pCtx->eflags.Bits.u1IF) 787 val |= X86_EFL_VIF; 788 else 789 val &= ~X86_EFL_VIF; 790 } 791 792 rc = VMXWriteVMCS(VMX_VMCS_GUEST_RFLAGS, val); 786 eflags.Bits.u1VM = 1; 787 eflags.Bits.u1VIF = pCtx->eflags.Bits.u1IF; 788 eflags.Bits.u2IOPL = 3; 789 } 790 791 rc = VMXWriteVMCS(VMX_VMCS_GUEST_RFLAGS, eflags.u32); 793 792 AssertRC(rc); 794 793 … … 1209 1208 { 1210 1209 /* Hide our emulation flags */ 1211 pCtx->eflags.Bits.u1VM = 0; 1212 pCtx->eflags.Bits.u1IF = pCtx->eflags.Bits.u1VIF; 1213 pCtx->eflags.Bits.u1VIF = 0; 1210 pCtx->eflags.Bits.u1VM = 0; 1211 pCtx->eflags.Bits.u1IF = pCtx->eflags.Bits.u1VIF; 1212 pCtx->eflags.Bits.u1VIF = 0; 1213 pCtx->eflags.Bits.u2IOPL = 0; 1214 1214 } 1215 1215
Note:
See TracChangeset
for help on using the changeset viewer.