VirtualBox

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


Ignore:
Timestamp:
Aug 6, 2012 1:43:53 PM (12 years ago)
Author:
vboxsync
Message:

VMM/HWVMXR0: Flush VPIDs on 32-bit hosts.

File:
1 edited

Legend:

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

    r42407 r42622  
    22622262
    22632263    /* First sync back EIP, ESP, and EFLAGS. */
    2264     rc = VMXReadCachedVMCS(VMX_VMCS64_GUEST_RIP,              &val);
     2264    rc = VMXReadCachedVMCS(VMX_VMCS64_GUEST_RIP,            &val);
    22652265    AssertRC(rc);
    22662266    pCtx->rip               = val;
    2267     rc = VMXReadCachedVMCS(VMX_VMCS64_GUEST_RSP,              &val);
     2267    rc = VMXReadCachedVMCS(VMX_VMCS64_GUEST_RSP,            &val);
    22682268    AssertRC(rc);
    22692269    pCtx->rsp               = val;
     
    23312331
    23322332    /* System MSRs */
    2333     VMXReadCachedVMCS(VMX_VMCS32_GUEST_SYSENTER_CS,    &val);
     2333    VMXReadCachedVMCS(VMX_VMCS32_GUEST_SYSENTER_CS,      &val);
    23342334    pCtx->SysEnter.cs       = val;
    23352335    VMXReadCachedVMCS(VMX_VMCS64_GUEST_SYSENTER_EIP,     &val);
     
    23412341    VMX_READ_SELREG(LDTR, ldtr);
    23422342
    2343     VMXReadCachedVMCS(VMX_VMCS32_GUEST_GDTR_LIMIT,     &val);
     2343    VMXReadCachedVMCS(VMX_VMCS32_GUEST_GDTR_LIMIT,       &val);
    23442344    pCtx->gdtr.cbGdt        = val;
    23452345    VMXReadCachedVMCS(VMX_VMCS64_GUEST_GDTR_BASE,        &val);
    23462346    pCtx->gdtr.pGdt         = val;
    23472347
    2348     VMXReadCachedVMCS(VMX_VMCS32_GUEST_IDTR_LIMIT,     &val);
     2348    VMXReadCachedVMCS(VMX_VMCS32_GUEST_IDTR_LIMIT,       &val);
    23492349    pCtx->idtr.cbIdt        = val;
    23502350    VMXReadCachedVMCS(VMX_VMCS64_GUEST_IDTR_BASE,        &val);
     
    23902390                pCtx->msrSFMASK = pMsr->u64Value;
    23912391                break;
    2392 
    23932392            /* The KERNEL_GS_BASE MSR doesn't work reliably with auto load/store. See @bugref{6208}  */
    23942393#if 0
     
    24002399                CPUMSetGuestMsr(pVCpu, MSR_K8_TSC_AUX, pMsr->u64Value);
    24012400                break;
    2402 
    24032401            case MSR_K6_EFER:
    24042402                /* EFER can't be changed without causing a VM-exit. */
     
    49904988static void hmR0VmxFlushVPID(PVM pVM, PVMCPU pVCpu, VMX_FLUSH_VPID enmFlush, RTGCPTR GCPtr)
    49914989{
    4992 #if HC_ARCH_BITS == 32
    4993     /*
    4994      * If we get a flush in 64-bit guest mode, then force a full TLB flush. invvpid probably takes only 32-bit addresses.
    4995      */
    4996     if (   CPUMIsGuestInLongMode(pVCpu)
    4997         && !VMX_IS_64BIT_HOST_MODE())
    4998     {
    4999         VMCPU_FF_SET(pVCpu, VMCPU_FF_TLB_FLUSH);
     4990    uint64_t descriptor[2];
     4991
     4992    Assert(pVM->hwaccm.s.vmx.fVPID);
     4993    if (enmFlush == VMX_FLUSH_VPID_ALL_CONTEXTS)
     4994    {
     4995        descriptor[0] = 0;
     4996        descriptor[1] = 0;
    50004997    }
    50014998    else
    5002 #endif
    5003     {
    5004         uint64_t descriptor[2];
    5005 
    5006         Assert(pVM->hwaccm.s.vmx.fVPID);
    5007         if (enmFlush == VMX_FLUSH_VPID_ALL_CONTEXTS)
    5008         {
    5009             descriptor[0] = 0;
    5010             descriptor[1] = 0;
    5011         }
    5012         else
    5013         {
    5014             AssertPtr(pVCpu);
    5015             Assert(pVCpu->hwaccm.s.uCurrentASID != 0);
    5016             descriptor[0] = pVCpu->hwaccm.s.uCurrentASID;
    5017             descriptor[1] = GCPtr;
    5018         }
    5019         int rc = VMXR0InvVPID(enmFlush, &descriptor[0]); NOREF(rc);
    5020         AssertMsg(rc == VINF_SUCCESS,
    5021                   ("VMXR0InvVPID %x %x %RGv failed with %d\n", enmFlush, pVCpu ? pVCpu->hwaccm.s.uCurrentASID : 0, GCPtr, rc));
    5022     }
     4999    {
     5000        AssertPtr(pVCpu);
     5001        Assert(pVCpu->hwaccm.s.uCurrentASID != 0);
     5002        descriptor[0] = pVCpu->hwaccm.s.uCurrentASID;
     5003        descriptor[1] = GCPtr;
     5004    }
     5005    int rc = VMXR0InvVPID(enmFlush, &descriptor[0]); NOREF(rc);
     5006    AssertMsg(rc == VINF_SUCCESS,
     5007              ("VMXR0InvVPID %x %x %RGv failed with %d\n", enmFlush, pVCpu ? pVCpu->hwaccm.s.uCurrentASID : 0, GCPtr, rc));
    50235008}
    50245009
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