VirtualBox

Changeset 79871 in vbox


Ignore:
Timestamp:
Jul 19, 2019 9:02:42 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132273
Message:

VMM/HMVMXR0: Nested VMX: bugref:9180 Add hmR0VmxReadGuestPhysicalAddrVmcs for upcoming changes.

File:
1 edited

Legend:

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

    r79870 r79871  
    8383#define HMVMX_READ_EXIT_INSTR_INFO                  RT_BIT_32(6)
    8484#define HMVMX_READ_GUEST_LINEAR_ADDR                RT_BIT_32(7)
     85#define HMVMX_READ_GUEST_PHYSICAL_ADDR              RT_BIT_32(8)
    8586
    8687/** All the VMCS fields required for processing of exception/NMI VM-exits. */
     
    214215    /** The Guest-linear address. */
    215216    uint64_t            uGuestLinearAddr;
     217    /** The Guest-physical address. */
     218    uint64_t            uGuestPhysicalAddr;
    216219
    217220    /** The VM-exit interruption-information field. */
     
    15011504        AssertRCReturn(rc, rc);
    15021505        pVmxTransient->fVmcsFieldsRead |= HMVMX_READ_GUEST_LINEAR_ADDR;
     1506    }
     1507    return VINF_SUCCESS;
     1508}
     1509
     1510
     1511/**
     1512 * Reads the Guest-physical address from the VMCS into the VMX transient structure.
     1513 *
     1514 * @returns VBox status code.
     1515 * @param   pVCpu           The cross context virtual CPU structure of the
     1516 *                          calling EMT. (Required for the VMCS cache case.)
     1517 * @param   pVmxTransient   The VMX-transient structure.
     1518 */
     1519DECLINLINE(int) hmR0VmxReadGuestPhysicalAddrVmcs(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)
     1520{
     1521    if (!(pVmxTransient->fVmcsFieldsRead & HMVMX_READ_GUEST_PHYSICAL_ADDR))
     1522    {
     1523        int rc = VMXReadVmcs64(VMX_VMCS64_RO_GUEST_PHYS_ADDR_FULL, &pVmxTransient->uGuestPhysicalAddr); NOREF(pVCpu);
     1524        AssertRCReturn(rc, rc);
     1525        pVmxTransient->fVmcsFieldsRead |= HMVMX_READ_GUEST_PHYSICAL_ADDR;
    15031526    }
    15041527    return VINF_SUCCESS;
     
    1635316376     * Get sufficent state and update the exit history entry.
    1635416377     */
    16355     RTGCPHYS GCPhys;
    1635616378    PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo;
    16357     rc  = VMXReadVmcs64(VMX_VMCS64_RO_GUEST_PHYS_ADDR_FULL, &GCPhys);
     16379    rc  = hmR0VmxReadGuestPhysicalAddrVmcs(pVCpu, pVmxTransient);
    1635816380    rc |= hmR0VmxImportGuestState(pVCpu, pVmcsInfo, IEM_CPUMCTX_EXTRN_MUST_MASK);
    1635916381    AssertRCReturn(rc, rc);
    1636016382
     16383    RTGCPHYS const GCPhys = pVmxTransient->uGuestPhysicalAddr;
    1636116384    PCEMEXITREC pExitRec = EMHistoryUpdateFlagsAndTypeAndPC(pVCpu,
    1636216385                                                            EMEXIT_MAKE_FT(EMEXIT_F_KIND_EM | EMEXIT_F_HM, EMEXITTYPE_MMIO),
     
    1644016463    }
    1644116464
    16442     RTGCPHYS GCPhys;
    1644316465    PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo;
    16444     rc  = VMXReadVmcs64(VMX_VMCS64_RO_GUEST_PHYS_ADDR_FULL, &GCPhys);
     16466    rc  = hmR0VmxReadGuestPhysicalAddrVmcs(pVCpu, pVmxTransient);
    1644516467    rc |= hmR0VmxImportGuestState(pVCpu, pVmcsInfo, IEM_CPUMCTX_EXTRN_MUST_MASK);
    1644616468    AssertRCReturn(rc, rc);
    1644716469
     16470    RTGCPHYS const GCPhys    = pVmxTransient->uGuestPhysicalAddr;
    1644816471    uint64_t const uExitQual = pVmxTransient->uExitQual;
    1644916472    AssertMsg(((pVmxTransient->uExitQual >> 7) & 3) != 2, ("%#RX64", uExitQual));
Note: See TracChangeset for help on using the changeset viewer.

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