VirtualBox

Changeset 44769 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Feb 20, 2013 5:20:27 PM (12 years ago)
Author:
vboxsync
Message:

VMM/VMMR0: bits.

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

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

    r44724 r44769  
    266266        PVMCPU pVCpu = &pVM->aCpus[i];
    267267
    268         pVCpu->hm.s.vmx.hMemObjVMCS = NIL_RTR0MEMOBJ;
     268        pVCpu->hm.s.vmx.hMemObjVmcs = NIL_RTR0MEMOBJ;
    269269
    270270        /* Allocate one page for the VM control structure (VMCS). */
    271         rc = RTR0MemObjAllocCont(&pVCpu->hm.s.vmx.hMemObjVMCS, PAGE_SIZE, false /* fExecutable */);
     271        rc = RTR0MemObjAllocCont(&pVCpu->hm.s.vmx.hMemObjVmcs, PAGE_SIZE, false /* fExecutable */);
    272272        AssertRC(rc);
    273273        if (RT_FAILURE(rc))
    274274            return rc;
    275275
    276         pVCpu->hm.s.vmx.pvVMCS     = RTR0MemObjAddress(pVCpu->hm.s.vmx.hMemObjVMCS);
    277         pVCpu->hm.s.vmx.HCPhysVMCS = RTR0MemObjGetPagePhysAddr(pVCpu->hm.s.vmx.hMemObjVMCS, 0);
    278         ASMMemZeroPage(pVCpu->hm.s.vmx.pvVMCS);
     276        pVCpu->hm.s.vmx.pvVmcs     = RTR0MemObjAddress(pVCpu->hm.s.vmx.hMemObjVmcs);
     277        pVCpu->hm.s.vmx.HCPhysVmcs = RTR0MemObjGetPagePhysAddr(pVCpu->hm.s.vmx.hMemObjVmcs, 0);
     278        ASMMemZeroPage(pVCpu->hm.s.vmx.pvVmcs);
    279279
    280280        pVCpu->hm.s.vmx.cr0_mask = 0;
     
    332332
    333333#ifdef LOG_ENABLED
    334         SUPR0Printf("VMXR0InitVM %x VMCS=%x (%x)\n", pVM, pVCpu->hm.s.vmx.pvVMCS, (uint32_t)pVCpu->hm.s.vmx.HCPhysVMCS);
     334        SUPR0Printf("VMXR0InitVM %x VMCS=%x (%x)\n", pVM, pVCpu->hm.s.vmx.pvVmcs, (uint32_t)pVCpu->hm.s.vmx.HCPhysVmcs);
    335335#endif
    336336    }
     
    352352        PVMCPU pVCpu = &pVM->aCpus[i];
    353353
    354         if (pVCpu->hm.s.vmx.hMemObjVMCS != NIL_RTR0MEMOBJ)
    355         {
    356             RTR0MemObjFree(pVCpu->hm.s.vmx.hMemObjVMCS, false);
    357             pVCpu->hm.s.vmx.hMemObjVMCS = NIL_RTR0MEMOBJ;
    358             pVCpu->hm.s.vmx.pvVMCS      = 0;
    359             pVCpu->hm.s.vmx.HCPhysVMCS  = 0;
     354        if (pVCpu->hm.s.vmx.hMemObjVmcs != NIL_RTR0MEMOBJ)
     355        {
     356            RTR0MemObjFree(pVCpu->hm.s.vmx.hMemObjVmcs, false);
     357            pVCpu->hm.s.vmx.hMemObjVmcs = NIL_RTR0MEMOBJ;
     358            pVCpu->hm.s.vmx.pvVmcs      = 0;
     359            pVCpu->hm.s.vmx.HCPhysVmcs  = 0;
    360360        }
    361361        if (pVCpu->hm.s.vmx.hMemObjVirtApic != NIL_RTR0MEMOBJ)
     
    496496        PVMCPU pVCpu = &pVM->aCpus[i];
    497497
    498         AssertPtr(pVCpu->hm.s.vmx.pvVMCS);
     498        AssertPtr(pVCpu->hm.s.vmx.pvVmcs);
    499499
    500500        /* Set revision dword at the beginning of the VMCS structure. */
    501         *(uint32_t *)pVCpu->hm.s.vmx.pvVMCS = MSR_IA32_VMX_BASIC_INFO_VMCS_ID(pVM->hm.s.vmx.msr.vmx_basic_info);
     501        *(uint32_t *)pVCpu->hm.s.vmx.pvVmcs = MSR_IA32_VMX_BASIC_INFO_VMCS_ID(pVM->hm.s.vmx.msr.vmx_basic_info);
    502502
    503503        /*
    504504         * Clear and activate the VMCS.
    505505         */
    506         Log(("HCPhysVMCS  = %RHp\n", pVCpu->hm.s.vmx.HCPhysVMCS));
    507         rc = VMXClearVMCS(pVCpu->hm.s.vmx.HCPhysVMCS);
     506        Log(("HCPhysVmcs  = %RHp\n", pVCpu->hm.s.vmx.HCPhysVmcs));
     507        rc = VMXClearVMCS(pVCpu->hm.s.vmx.HCPhysVmcs);
    508508        if (RT_FAILURE(rc))
    509509            goto vmx_end;
    510510
    511         rc = VMXActivateVMCS(pVCpu->hm.s.vmx.HCPhysVMCS);
     511        rc = VMXActivateVMCS(pVCpu->hm.s.vmx.HCPhysVmcs);
    512512        if (RT_FAILURE(rc))
    513513            goto vmx_end;
     
    722722         * VMCS data back to memory.
    723723         */
    724         rc = VMXClearVMCS(pVCpu->hm.s.vmx.HCPhysVMCS);
     724        rc = VMXClearVMCS(pVCpu->hm.s.vmx.HCPhysVmcs);
    725725        AssertRC(rc);
    726726
     
    49114911        /* Try to extract more information about what might have gone wrong here. */
    49124912        VMXGetActivateVMCS(&pVCpu->hm.s.vmx.lasterror.u64VMCSPhys);
    4913         pVCpu->hm.s.vmx.lasterror.u32VMCSRevision = *(uint32_t *)pVCpu->hm.s.vmx.pvVMCS;
     4913        pVCpu->hm.s.vmx.lasterror.u32VMCSRevision = *(uint32_t *)pVCpu->hm.s.vmx.pvVmcs;
    49144914        pVCpu->hm.s.vmx.lasterror.idEnteredCpu    = pVCpu->hm.s.idEnteredCpu;
    49154915        pVCpu->hm.s.vmx.lasterror.idCurrentCpu    = RTMpCpuId();
     
    49544954
    49554955    /* Activate the VMCS. */
    4956     int rc = VMXActivateVMCS(pVCpu->hm.s.vmx.HCPhysVMCS);
     4956    int rc = VMXActivateVMCS(pVCpu->hm.s.vmx.HCPhysVmcs);
    49574957    if (RT_FAILURE(rc))
    49584958        return rc;
     
    50065006     * VMCS data back to memory.
    50075007     */
    5008     int rc = VMXClearVMCS(pVCpu->hm.s.vmx.HCPhysVMCS);
     5008    int rc = VMXClearVMCS(pVCpu->hm.s.vmx.HCPhysVmcs);
    50095009    AssertRC(rc);
    50105010
     
    53305330#ifdef DEBUG
    53315331    pCache->TestIn.HCPhysCpuPage= 0;
    5332     pCache->TestIn.HCPhysVMCS   = 0;
     5332    pCache->TestIn.HCPhysVmcs   = 0;
    53335333    pCache->TestIn.pCache       = 0;
    5334     pCache->TestOut.HCPhysVMCS  = 0;
     5334    pCache->TestOut.HCPhysVmcs  = 0;
    53355335    pCache->TestOut.pCache      = 0;
    53365336    pCache->TestOut.pCtx        = 0;
     
    53405340    aParam[0] = (uint32_t)(HCPhysCpuPage);                                  /* Param 1: VMXON physical address - Lo. */
    53415341    aParam[1] = (uint32_t)(HCPhysCpuPage >> 32);                            /* Param 1: VMXON physical address - Hi. */
    5342     aParam[2] = (uint32_t)(pVCpu->hm.s.vmx.HCPhysVMCS);                 /* Param 2: VMCS physical address - Lo. */
    5343     aParam[3] = (uint32_t)(pVCpu->hm.s.vmx.HCPhysVMCS >> 32);           /* Param 2: VMCS physical address - Hi. */
     5342    aParam[2] = (uint32_t)(pVCpu->hm.s.vmx.HCPhysVmcs);                 /* Param 2: VMCS physical address - Lo. */
     5343    aParam[3] = (uint32_t)(pVCpu->hm.s.vmx.HCPhysVmcs >> 32);           /* Param 2: VMCS physical address - Hi. */
    53445344    aParam[4] = VM_RC_ADDR(pVM, &pVM->aCpus[pVCpu->idCpu].hm.s.vmx.VMCSCache);
    53455345    aParam[5] = 0;
     
    53595359#ifdef DEBUG
    53605360    AssertMsg(pCache->TestIn.HCPhysCpuPage== HCPhysCpuPage, ("%RHp vs %RHp\n", pCache->TestIn.HCPhysCpuPage, HCPhysCpuPage));
    5361     AssertMsg(pCache->TestIn.HCPhysVMCS   == pVCpu->hm.s.vmx.HCPhysVMCS, ("%RHp vs %RHp\n", pCache->TestIn.HCPhysVMCS,
    5362                                                                               pVCpu->hm.s.vmx.HCPhysVMCS));
    5363     AssertMsg(pCache->TestIn.HCPhysVMCS   == pCache->TestOut.HCPhysVMCS, ("%RHp vs %RHp\n", pCache->TestIn.HCPhysVMCS,
    5364                                                                           pCache->TestOut.HCPhysVMCS));
     5361    AssertMsg(pCache->TestIn.HCPhysVmcs   == pVCpu->hm.s.vmx.HCPhysVmcs, ("%RHp vs %RHp\n", pCache->TestIn.HCPhysVmcs,
     5362                                                                              pVCpu->hm.s.vmx.HCPhysVmcs));
     5363    AssertMsg(pCache->TestIn.HCPhysVmcs   == pCache->TestOut.HCPhysVmcs, ("%RHp vs %RHp\n", pCache->TestIn.HCPhysVmcs,
     5364                                                                          pCache->TestOut.HCPhysVmcs));
    53655365    AssertMsg(pCache->TestIn.pCache       == pCache->TestOut.pCache, ("%RGv vs %RGv\n", pCache->TestIn.pCache,
    53665366                                                                      pCache->TestOut.pCache));
     
    55185518
    55195519    /* Clear VMCS. Marking it inactive, clearing implementation-specific data and writing VMCS data back to memory. */
    5520     VMXClearVMCS(pVCpu->hm.s.vmx.HCPhysVMCS);
     5520    VMXClearVMCS(pVCpu->hm.s.vmx.HCPhysVmcs);
    55215521
    55225522    /* Leave VMX Root Mode. */
     
    55485548    }
    55495549
    5550     rc2 = VMXActivateVMCS(pVCpu->hm.s.vmx.HCPhysVMCS);
     5550    rc2 = VMXActivateVMCS(pVCpu->hm.s.vmx.HCPhysVmcs);
    55515551    AssertRC(rc2);
    55525552    Assert(!(ASMGetFlags() & X86_EFL_IF));
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r44724 r44769  
    11411141            {
    11421142                LogRel(("HM: VCPU%d: MSR bitmap physaddr    = %RHp\n", i, pVM->aCpus[i].hm.s.vmx.HCPhysMsrBitmap));
    1143                 LogRel(("HM: VCPU%d: VMCS physaddr          = %RHp\n", i, pVM->aCpus[i].hm.s.vmx.HCPhysVMCS));
     1143                LogRel(("HM: VCPU%d: VMCS physaddr          = %RHp\n", i, pVM->aCpus[i].hm.s.vmx.HCPhysVmcs));
    11441144            }
    11451145
     
    27312731
    27322732            case VERR_VMX_INVALID_VMCS_PTR:
    2733                 LogRel(("VERR_VMX_INVALID_VMCS_PTR: CPU%d Current pointer %RGp vs %RGp\n", i, pVM->aCpus[i].hm.s.vmx.lasterror.u64VMCSPhys, pVM->aCpus[i].hm.s.vmx.HCPhysVMCS));
     2733                LogRel(("VERR_VMX_INVALID_VMCS_PTR: CPU%d Current pointer %RGp vs %RGp\n", i, pVM->aCpus[i].hm.s.vmx.lasterror.u64VMCSPhys, pVM->aCpus[i].hm.s.vmx.HCPhysVmcs));
    27342734                LogRel(("VERR_VMX_INVALID_VMCS_PTR: CPU%d Current VMCS version %x\n", i, pVM->aCpus[i].hm.s.vmx.lasterror.u32VMCSRevision));
    27352735                LogRel(("VERR_VMX_INVALID_VMCS_PTR: CPU%d Entered Cpu %d\n", i, pVM->aCpus[i].hm.s.vmx.lasterror.idEnteredCpu));
  • trunk/src/VBox/VMM/include/HMInternal.h

    r44528 r44769  
    529529    {
    530530        /** Physical address of the VM control structure (VMCS). */
    531         RTHCPHYS                    HCPhysVMCS;
     531        RTHCPHYS                    HCPhysVmcs;
    532532        /** R0 memory object for the VM control structure (VMCS). */
    533         RTR0MEMOBJ                  hMemObjVMCS;
     533        RTR0MEMOBJ                  hMemObjVmcs;
    534534        /** Virtual address of the VM control structure (VMCS). */
    535         R0PTRTYPE(void *)           pvVMCS;
     535        R0PTRTYPE(void *)           pvVmcs;
    536536        /** Ring 0 handlers for VT-x. */
    537537        PFNHMVMXSTARTVM             pfnStartVM;
  • trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp

    r44528 r44769  
    400400    CHECK_MEMBER_ALIGNMENT(HM, StatTprPatchSuccess, 8);
    401401    CHECK_MEMBER_ALIGNMENT(HMCPU, StatEntry, 8);
    402     CHECK_MEMBER_ALIGNMENT(HMCPU, vmx.HCPhysVMCS, sizeof(RTHCPHYS));
     402    CHECK_MEMBER_ALIGNMENT(HMCPU, vmx.HCPhysVmcs, sizeof(RTHCPHYS));
    403403    CHECK_MEMBER_ALIGNMENT(HMCPU, vmx.u32ProcCtls, 8);
    404404    CHECK_MEMBER_ALIGNMENT(HMCPU, Event.u64IntrInfo, 8);
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