VirtualBox

Changeset 75916 in vbox


Ignore:
Timestamp:
Dec 3, 2018 4:53:18 PM (6 years ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:9180 Pending debug exceptions bits.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/x86.h

    r74648 r75916  
    936936#define X86_DR6_RTM                         RT_BIT_32(16)
    937937/** Value of DR6 after powerup/reset. */
    938 #define X86_DR6_INIT_VAL                    UINT64_C(0xFFFF0FF0)
     938#define X86_DR6_INIT_VAL                    UINT64_C(0xffff0ff0)
    939939/** Bits which must be 1s in DR6. */
    940940#define X86_DR6_RA1_MASK                    UINT64_C(0xffff0ff0)
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r75884 r75916  
    18261826    /* Nothing to do for SMI/enclave. We don't support enclaves or SMM yet. */
    18271827
    1828     /* Pending debug exceptions. */
     1828    /*
     1829     * Pending debug exceptions.
     1830     */
    18291831    if (    uExitReason != VMX_EXIT_INIT_SIGNAL
    18301832        &&  uExitReason != VMX_EXIT_SMI
     
    18351837         *        block-by-MovSS is in effect. */
    18361838        pVmcs->u64GuestPendingDbgXcpt.u = 0;
     1839    }
     1840    else
     1841    {
     1842        /*
     1843         * Pending debug exception field is identical to DR6 except the RTM bit (16) which needs to be flipped.
     1844         * The "enabled breakpoint" bit (12) is not present in DR6, so we need to update it here.
     1845         *
     1846         * See Intel spec. 24.4.2 "Guest Non-Register State".
     1847         */
     1848        uint64_t       fPendingDbgMask = pVCpu->cpum.GstCtx.dr[6];
     1849        uint64_t const fBpHitMask = VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_BP0 | VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_BP1
     1850                                  | VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_BP2 | VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_BP3;
     1851        if (fPendingDbgMask & fBpHitMask)
     1852            fPendingDbgMask |= VMX_VMCS_GUEST_PENDING_DEBUG_XCPT_EN_BP;
     1853        fPendingDbgMask ^= VMX_VMCS_GUEST_PENDING_DEBUG_RTM;
     1854        pVmcs->u64GuestPendingDbgXcpt.u = fPendingDbgMask;
    18371855    }
    18381856
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