VirtualBox

Changeset 46192 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
May 21, 2013 10:25:57 AM (12 years ago)
Author:
vboxsync
Message:

VMM/HM: CR0 and CR4 masks can be 32-bit. Plus hungarian naming fixes.

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r46191 r46192  
    21322132    Assert(!(uSelGS & X86_SEL_RPL)); Assert(!(uSelGS & X86_SEL_LDT));
    21332133    Assert(!(uSelTR & X86_SEL_RPL)); Assert(!(uSelTR & X86_SEL_LDT));
    2134     Assert(uSelCS != 0);
    2135     Assert(uSelTR != 0);
     2134    Assert(uSelCS);
     2135    Assert(uSelTR);
    21362136
    21372137    /* Assertion is right but we would not have updated u32ExitCtls yet. */
     
    28802880
    28812881        /* Write the CR0 mask into the VMCS and update the VCPU's copy of the current CR0 mask. */
    2882         pVCpu->hm.s.vmx.cr0_mask = u32CR0Mask;
     2882        pVCpu->hm.s.vmx.u32CR0Mask = u32CR0Mask;
    28832883        rc = VMXWriteVmcs32(VMX_VMCS_CTRL_CR0_MASK, u32CR0Mask);
    28842884        AssertRCReturn(rc, rc);
     
    30613061                    | X86_CR4_PSE
    30623062                    | X86_CR4_VMXE;
    3063         pVCpu->hm.s.vmx.cr4_mask = u32CR4Mask;
     3063        pVCpu->hm.s.vmx.u32CR4Mask = u32CR4Mask;
    30643064        rc = VMXWriteVmcs32(VMX_VMCS_CTRL_CR4_MASK, u32CR4Mask);
    30653065        AssertRCReturn(rc, rc);
     
    47754775        AssertRCReturn(rc, rc);
    47764776
    4777         uVal = (uShadow & pVCpu->hm.s.vmx.cr0_mask) | (uVal & ~pVCpu->hm.s.vmx.cr0_mask);
     4777        uVal = (uShadow & pVCpu->hm.s.vmx.u32CR0Mask) | (uVal & ~pVCpu->hm.s.vmx.u32CR0Mask);
    47784778        CPUMSetGuestCR0(pVCpu, uVal);
    47794779        pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_CR0;
     
    48064806        AssertRCReturn(rc, rc);
    48074807
    4808         uVal = (uShadow & pVCpu->hm.s.vmx.cr4_mask) | (uVal & ~pVCpu->hm.s.vmx.cr4_mask);
     4808        uVal = (uShadow & pVCpu->hm.s.vmx.u32CR4Mask) | (uVal & ~pVCpu->hm.s.vmx.u32CR4Mask);
    48094809        CPUMSetGuestCR4(pVCpu, uVal);
    48104810        pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_CR4;
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r45965 r46192  
    370370        ASMMemZeroPage(pVCpu->hm.s.vmx.pvVmcs);
    371371
    372         pVCpu->hm.s.vmx.cr0_mask = 0;
    373         pVCpu->hm.s.vmx.cr4_mask = 0;
     372        pVCpu->hm.s.vmx.u32CR0Mask = 0;
     373        pVCpu->hm.s.vmx.u32CR4Mask = 0;
    374374
    375375        /* Allocate one page for the virtual APIC page for TPR caching. */
     
    21192119            val |= X86_CR0_TS | X86_CR0_ET | X86_CR0_MP;
    21202120
    2121         pVCpu->hm.s.vmx.cr0_mask = val;
     2121        pVCpu->hm.s.vmx.u32CR0Mask = val;
    21222122
    21232123        rc |= VMXWriteVmcs(VMX_VMCS_CTRL_CR0_MASK, val);
     
    21922192              | X86_CR4_PSE
    21932193              | X86_CR4_VMXE;
    2194         pVCpu->hm.s.vmx.cr4_mask = val;
     2194        pVCpu->hm.s.vmx.u32CR4Mask = val;
    21952195
    21962196        rc |= VMXWriteVmcs(VMX_VMCS_CTRL_CR4_MASK, val);
     
    24672467    VMXReadCachedVmcs(VMX_VMCS_CTRL_CR0_READ_SHADOW,     &valShadow);
    24682468    VMXReadCachedVmcs(VMX_VMCS_GUEST_CR0,                &val);
    2469     val = (valShadow & pVCpu->hm.s.vmx.cr0_mask) | (val & ~pVCpu->hm.s.vmx.cr0_mask);
     2469    val = (valShadow & pVCpu->hm.s.vmx.u32CR0Mask) | (val & ~pVCpu->hm.s.vmx.u32CR0Mask);
    24702470    CPUMSetGuestCR0(pVCpu, val);
    24712471
    24722472    VMXReadCachedVmcs(VMX_VMCS_CTRL_CR4_READ_SHADOW,     &valShadow);
    24732473    VMXReadCachedVmcs(VMX_VMCS_GUEST_CR4,                &val);
    2474     val = (valShadow & pVCpu->hm.s.vmx.cr4_mask) | (val & ~pVCpu->hm.s.vmx.cr4_mask);
     2474    val = (valShadow & pVCpu->hm.s.vmx.u32CR4Mask) | (val & ~pVCpu->hm.s.vmx.u32CR4Mask);
    24752475    CPUMSetGuestCR4(pVCpu, val);
    24762476
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette