VirtualBox

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


Ignore:
Timestamp:
Jul 19, 2019 9:05:38 AM (6 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Nested VMX: bugref:9180 Add HMVMX_ALWAYS_SAVE_RO_GUEST_STATE and hmR0VmxReadAllRoFieldsVmcs.

File:
1 edited

Legend:

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

    r79871 r79872  
    4848#ifdef DEBUG_ramshankar
    4949# define HMVMX_ALWAYS_SAVE_GUEST_RFLAGS
     50# define HMVMX_ALWAYS_SAVE_RO_GUEST_STATE
    5051# define HMVMX_ALWAYS_SAVE_FULL_GUEST_STATE
    5152# define HMVMX_ALWAYS_SYNC_FULL_GUEST_STATE
     
    15681569}
    15691570
     1571#ifdef HMVMX_ALWAYS_SAVE_RO_GUEST_STATE
     1572/**
     1573 * Reads all relevant read-only VMCS fields into the VMX transient structure.
     1574 *
     1575 * @returns VBox status code.
     1576 * @param   pVCpu           The cross context virtual CPU structure of the
     1577 *                          calling EMT. (Required for the VMCS cache case.)
     1578 * @param   pVmxTransient   The VMX-transient structure.
     1579 */
     1580static int hmR0VmxReadAllRoFieldsVmcs(PVMCPU pVCpu, PVMXTRANSIENT pVmxTransient)
     1581{
     1582    NOREF(pVCpu); /* Used implicitly by VMXReadVmcsGstN on 32-bit hosts. */
     1583    int rc = VMXReadVmcsGstN(VMX_VMCS_RO_EXIT_QUALIFICATION,           &pVmxTransient->uExitQual);
     1584    rc    |= VMXReadVmcs32(VMX_VMCS32_RO_EXIT_INSTR_LENGTH,            &pVmxTransient->cbInstr);
     1585    rc    |= VMXReadVmcs32(VMX_VMCS32_RO_EXIT_INSTR_INFO,              &pVmxTransient->ExitInstrInfo.u);
     1586    rc    |= VMXReadVmcs32(VMX_VMCS32_RO_IDT_VECTORING_INFO,           &pVmxTransient->uIdtVectoringInfo);
     1587    rc    |= VMXReadVmcs32(VMX_VMCS32_RO_IDT_VECTORING_ERROR_CODE,     &pVmxTransient->uIdtVectoringErrorCode);
     1588    rc    |= VMXReadVmcs32(VMX_VMCS32_RO_EXIT_INTERRUPTION_INFO,       &pVmxTransient->uExitIntInfo);
     1589    rc    |= VMXReadVmcs32(VMX_VMCS32_RO_EXIT_INTERRUPTION_ERROR_CODE, &pVmxTransient->uExitIntErrorCode);
     1590    rc    |= VMXReadVmcsGstN(VMX_VMCS_RO_GUEST_LINEAR_ADDR,            &pVmxTransient->uGuestLinearAddr);
     1591    rc    |= VMXReadVmcsGstN(VMX_VMCS64_RO_GUEST_PHYS_ADDR_FULL,       &pVmxTransient->uGuestPhysicalAddr);
     1592    AssertRCReturn(rc, rc);
     1593    pVmxTransient->fVmcsFieldsRead |= HMVMX_READ_EXIT_QUALIFICATION
     1594                                   |  HMVMX_READ_EXIT_INSTR_LEN
     1595                                   |  HMVMX_READ_EXIT_INSTR_INFO
     1596                                   |  HMVMX_READ_IDT_VECTORING_INFO
     1597                                   |  HMVMX_READ_IDT_VECTORING_ERROR_CODE
     1598                                   |  HMVMX_READ_EXIT_INTERRUPTION_INFO
     1599                                   |  HMVMX_READ_EXIT_INTERRUPTION_ERROR_CODE
     1600                                   |  HMVMX_READ_GUEST_LINEAR_ADDR
     1601                                   |  HMVMX_READ_GUEST_PHYSICAL_ADDR;
     1602    return VINF_SUCCESS;
     1603}
     1604#endif
    15701605
    15711606/**
     
    1149411529            Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_HM_UPDATE_PAE_PDPES));
    1149511530
     11531#ifdef HMVMX_ALWAYS_SAVE_RO_GUEST_STATE
     11532            rc = hmR0VmxReadAllRoFieldsVmcs(pVCpu, pVmxTransient);
     11533            AssertRC(rc);
     11534#endif
    1149611535#if defined(HMVMX_ALWAYS_SYNC_FULL_GUEST_STATE) || defined(HMVMX_ALWAYS_SAVE_FULL_GUEST_STATE)
    1149711536            rc = hmR0VmxImportGuestState(pVCpu, pVmcsInfo, HMVMX_CPUMCTX_EXTRN_ALL);
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