VirtualBox

Changeset 91098 in vbox


Ignore:
Timestamp:
Sep 2, 2021 3:22:54 PM (3 years ago)
Author:
vboxsync
Message:

VMM: Nested VMX: bugref:10092 Added new/missing EPT violation VM-exit qualification fields. Present bit in the error code should be determined by bits 5:3 (not just 3).

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/hm_vmx.h

    r91045 r91098  
    31583158 * @{
    31593159 */
    3160 /** Set if the violation was caused by a data read. */
    3161 #define VMX_EXIT_QUAL_EPT_DATA_READ                             RT_BIT(0)
    3162 /** Set if the violation was caused by a data write. */
    3163 #define VMX_EXIT_QUAL_EPT_DATA_WRITE                            RT_BIT(1)
     3160/** Set if acess causing the violation was a data read. */
     3161#define VMX_EXIT_QUAL_EPT_ACCESS_READ                           RT_BIT(0)
     3162/** Set if acess causing the violation was a data write. */
     3163#define VMX_EXIT_QUAL_EPT_ACCESS_WRITE                          RT_BIT(1)
    31643164/** Set if the violation was caused by an instruction fetch. */
    3165 #define VMX_EXIT_QUAL_EPT_INSTR_FETCH                           RT_BIT(2)
     3165#define VMX_EXIT_QUAL_EPT_ACCESS_INSTR_FETCH                    RT_BIT(2)
    31663166/** AND of the present bit of all EPT structures. */
    3167 #define VMX_EXIT_QUAL_EPT_ENTRY_PRESENT                         RT_BIT(3)
     3167#define VMX_EXIT_QUAL_EPT_ENTRY_READ                            RT_BIT(3)
    31683168/** AND of the write bit of all EPT structures. */
    31693169#define VMX_EXIT_QUAL_EPT_ENTRY_WRITE                           RT_BIT(4)
    31703170/** AND of the execute bit of all EPT structures. */
    31713171#define VMX_EXIT_QUAL_EPT_ENTRY_EXECUTE                         RT_BIT(5)
    3172 /** Set if the guest linear address field contains the faulting address. */
    3173 #define VMX_EXIT_QUAL_EPT_GUEST_ADDR_VALID                      RT_BIT(7)
     3172/** And of the execute bit of all EPT structures for user-mode addresses
     3173 *  (requires mode-based execute control). */
     3174#define VMX_EXIT_QUAL_EPT_ENTRY_EXECUTE_USER                    RT_BIT(6)
     3175/** Set if the guest linear address field is valid. */
     3176#define VMX_EXIT_QUAL_EPT_GST_LINEAR_ADDR_VALID                 RT_BIT(7)
    31743177/** If bit 7 is one: (reserved otherwise)
    31753178 *  1 - violation due to physical address access.
     
    31773180 */
    31783181#define VMX_EXIT_QUAL_EPT_TRANSLATED_ACCESS                     RT_BIT(8)
     3182/** If bit 7, 8 and advanced VM-exit info. for EPT is one: (reserved otherwise)
     3183 *  1 - linear address is user-mode address.
     3184 *  0 - linear address is supervisor-mode address.
     3185 */
     3186#define VMX_EXIT_QUAL_EPT_LINEAR_ADDR_USER                      RT_BIT(9)
     3187/** If bit 7, 8 and advanced VM-exit info. for EPT is one: (reserved otherwise)
     3188 *  1 - linear address translates to read-only page.
     3189 *  0 - linear address translates to read-write page.
     3190 */
     3191#define VMX_EXIT_QUAL_EPT_LINEAR_ADDR_RO                        RT_BIT(10)
     3192/** If bit 7, 8 and advanced VM-exit info. for EPT is one: (reserved otherwise)
     3193 *  1 - linear address translates to executable-disabled page.
     3194 *  0 - linear address translates to executable page.
     3195 */
     3196#define VMX_EXIT_QUAL_EPT_LINEAR_ADDR_XD                        RT_BIT(11)
    31793197/** NMI unblocking due to IRET. */
     3198#define VMX_EXIT_QUAL_EPT_NMI_UNBLOCK_IRET                      RT_BIT(12)
     3199/** Set if acess causing the violation was a shadow-stack access. */
     3200#define VMX_EXIT_QUAL_EPT_ACCESS_SUPERVISOR_SHW_STACK           RT_BIT(13)
     3201/** If supervisor-shadow stack is enabled: (reserved otherwise)
     3202 *  1 - supervisor shadow-stack access allowed.
     3203 *  0 - supervisor shadow-stack access disallowed.
     3204 */
     3205#define VMX_EXIT_QUAL_EPT_ENTRY_SHW_STACK_ALLOWED               RT_BIT(14)
     3206/** Set if access is related to trace output by Intel PT (reserved otherwise). */
     3207#define VMX_EXIT_QUAL_EPT_ACCESS_PT_TRACE                       RT_BIT(16)
     3208
     3209/** Checks whether NMI unblocking due to IRET. */
    31803210#define VMX_EXIT_QUAL_EPT_IS_NMI_UNBLOCK_IRET(a)                (((a) >> 12) & 1)
    31813211/** @} */
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r91037 r91098  
    1639816398
    1639916399    RTGCUINT uErrorCode = 0;
    16400     if (uExitQual & VMX_EXIT_QUAL_EPT_INSTR_FETCH)
     16400    if (uExitQual & VMX_EXIT_QUAL_EPT_ACCESS_INSTR_FETCH)
    1640116401        uErrorCode |= X86_TRAP_PF_ID;
    16402     if (uExitQual & VMX_EXIT_QUAL_EPT_DATA_WRITE)
     16402    if (uExitQual & VMX_EXIT_QUAL_EPT_ACCESS_WRITE)
    1640316403        uErrorCode |= X86_TRAP_PF_RW;
    16404     if (uExitQual & VMX_EXIT_QUAL_EPT_ENTRY_PRESENT)
     16404    if (uExitQual & (VMX_EXIT_QUAL_EPT_ENTRY_READ | VMX_EXIT_QUAL_EPT_ENTRY_WRITE | VMX_EXIT_QUAL_EPT_ENTRY_EXECUTE))
    1640516405        uErrorCode |= X86_TRAP_PF_P;
    1640616406
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