VirtualBox

Ignore:
Timestamp:
Apr 19, 2013 12:30:57 PM (12 years ago)
Author:
vboxsync
Message:

VMMR0/HMVMXR0: bits.

File:
1 edited

Legend:

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

    r45639 r45641  
    6868 * Updated-guest-state flags.
    6969 */
    70 #define HMVMX_UPDATED_GUEST_FPU                   RT_BIT(0)
    71 #define HMVMX_UPDATED_GUEST_RIP                   RT_BIT(1)
    72 #define HMVMX_UPDATED_GUEST_RSP                   RT_BIT(2)
    73 #define HMVMX_UPDATED_GUEST_RFLAGS                RT_BIT(3)
    74 #define HMVMX_UPDATED_GUEST_CR0                   RT_BIT(4)
    75 #define HMVMX_UPDATED_GUEST_CR3                   RT_BIT(5)
    76 #define HMVMX_UPDATED_GUEST_CR4                   RT_BIT(6)
    77 #define HMVMX_UPDATED_GUEST_GDTR                  RT_BIT(7)
    78 #define HMVMX_UPDATED_GUEST_IDTR                  RT_BIT(8)
    79 #define HMVMX_UPDATED_GUEST_LDTR                  RT_BIT(9)
    80 #define HMVMX_UPDATED_GUEST_TR                    RT_BIT(10)
    81 #define HMVMX_UPDATED_GUEST_SEGMENT_REGS          RT_BIT(11)
    82 #define HMVMX_UPDATED_GUEST_DEBUG                 RT_BIT(12)
    83 #define HMVMX_UPDATED_GUEST_FS_BASE_MSR           RT_BIT(13)
    84 #define HMVMX_UPDATED_GUEST_GS_BASE_MSR           RT_BIT(14)
    85 #define HMVMX_UPDATED_GUEST_SYSENTER_CS_MSR       RT_BIT(15)
    86 #define HMVMX_UPDATED_GUEST_SYSENTER_EIP_MSR      RT_BIT(16)
    87 #define HMVMX_UPDATED_GUEST_SYSENTER_ESP_MSR      RT_BIT(17)
    88 #define HMVMX_UPDATED_GUEST_AUTO_LOAD_STORE_MSRS  RT_BIT(18)
    89 #define HMVMX_UPDATED_GUEST_ACTIVITY_STATE        RT_BIT(19)
    90 #define HMVMX_UPDATED_GUEST_APIC_STATE            RT_BIT(20)
    91 #define HMVMX_UPDATED_GUEST_ALL                   (  HMVMX_UPDATED_GUEST_FPU                   \
    92                                                    | HMVMX_UPDATED_GUEST_RIP                   \
     70#define HMVMX_UPDATED_GUEST_RIP                   RT_BIT(0)
     71#define HMVMX_UPDATED_GUEST_RSP                   RT_BIT(1)
     72#define HMVMX_UPDATED_GUEST_RFLAGS                RT_BIT(2)
     73#define HMVMX_UPDATED_GUEST_CR0                   RT_BIT(3)
     74#define HMVMX_UPDATED_GUEST_CR3                   RT_BIT(4)
     75#define HMVMX_UPDATED_GUEST_CR4                   RT_BIT(5)
     76#define HMVMX_UPDATED_GUEST_GDTR                  RT_BIT(6)
     77#define HMVMX_UPDATED_GUEST_IDTR                  RT_BIT(7)
     78#define HMVMX_UPDATED_GUEST_LDTR                  RT_BIT(8)
     79#define HMVMX_UPDATED_GUEST_TR                    RT_BIT(9)
     80#define HMVMX_UPDATED_GUEST_SEGMENT_REGS          RT_BIT(10)
     81#define HMVMX_UPDATED_GUEST_DEBUG                 RT_BIT(11)
     82#define HMVMX_UPDATED_GUEST_FS_BASE_MSR           RT_BIT(12)
     83#define HMVMX_UPDATED_GUEST_GS_BASE_MSR           RT_BIT(13)
     84#define HMVMX_UPDATED_GUEST_SYSENTER_CS_MSR       RT_BIT(14)
     85#define HMVMX_UPDATED_GUEST_SYSENTER_EIP_MSR      RT_BIT(15)
     86#define HMVMX_UPDATED_GUEST_SYSENTER_ESP_MSR      RT_BIT(16)
     87#define HMVMX_UPDATED_GUEST_AUTO_LOAD_STORE_MSRS  RT_BIT(17)
     88#define HMVMX_UPDATED_GUEST_ACTIVITY_STATE        RT_BIT(18)
     89#define HMVMX_UPDATED_GUEST_APIC_STATE            RT_BIT(19)
     90#define HMVMX_UPDATED_GUEST_ALL                   (  HMVMX_UPDATED_GUEST_RIP                   \
    9391                                                   | HMVMX_UPDATED_GUEST_RSP                   \
    9492                                                   | HMVMX_UPDATED_GUEST_RFLAGS                \
     
    370368 /* 59  VMX_EXIT_VMFUNC                  */  hmR0VmxExitSetPendingXcptUD
    371369};
    372 
    373370#endif /* HMVMX_USE_FUNCTION_TABLE */
    374371
     
    45734570/**
    45744571 * Determines if an exception is a contributory exception. Contributory
    4575  * exceptions are ones which can cause double-faults.
     4572 * exceptions are ones which can cause double-faults. Page-fault is
     4573 * intentionally not included here as it's a conditional contributory exception.
    45764574 *
    45774575 * @returns true if the exception is contributory, false otherwise.
     
    45964594
    45974595/**
    4598  * Determines if an exception is a benign exception. Benign exceptions
    4599  * are ones which cannot cause double-faults.
    4600  *
    4601  * @returns true if the exception is benign, false otherwise.
    4602  * @param   uVector     The exception vector.
    4603  */
    4604 DECLINLINE(bool) hmR0VmxIsBenignXcpt(const uint32_t uVector)
    4605 {
    4606     if (   uVector == X86_XCPT_PF
    4607         || uVector == X86_XCPT_DF)
    4608     {
    4609         return false;
    4610     }
    4611 
    4612     bool fIsBenignXcpt = !hmR0VmxIsContributoryXcpt(uVector);
    4613 #ifdef VBOX_STRICT
    4614     switch (uVector)
    4615     {
    4616         case X86_XCPT_DB:
    4617         case X86_XCPT_NMI:
    4618         case X86_XCPT_BP:
    4619         case X86_XCPT_OF:
    4620         case X86_XCPT_BR:
    4621         case X86_XCPT_UD:
    4622         case X86_XCPT_NM:
    4623         case X86_XCPT_CO_SEG_OVERRUN:
    4624         case X86_XCPT_MF:
    4625         case X86_XCPT_AC:
    4626         case X86_XCPT_MC:
    4627         case X86_XCPT_XF:
    4628             AssertMsg(fIsBenignXcpt, ("%#x\n", uVector));
    4629             break;
    4630         default:
    4631             AssertMsg(!fIsBenignXcpt, ("%#x\n", uVector));
    4632             break;
    4633     }
    4634 #endif
    4635     return fIsBenignXcpt;
    4636 }
    4637 
    4638 
    4639 /**
    46404596 * Sets an event as a pending event to be injected into the guest.
    46414597 *
     
    47264682            enmReflect = VMXREFLECTXCPT_XCPT;
    47274683            if (   hmR0VmxIsContributoryXcpt(uIdtVector)
    4728                      && uExitVector == X86_XCPT_PF)
     4684                && uExitVector == X86_XCPT_PF)
    47294685            {
    47304686                GCPtrFaultAddress = pMixedCtx->cr2;
     
    48174773{
    48184774    int rc = VINF_SUCCESS;
    4819     if (   !(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_CR0)
    4820         || !(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_FPU))
     4775    if (!(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_CR0))
    48214776    {
    48224777        RTGCUINTREG uVal    = 0;
     
    48274782        uVal = (uShadow & pVCpu->hm.s.vmx.cr0_mask) | (uVal & ~pVCpu->hm.s.vmx.cr0_mask);
    48284783        CPUMSetGuestCR0(pVCpu, uVal);
    4829         pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_CR0 | HMVMX_UPDATED_GUEST_FPU;
     4784        pVCpu->hm.s.vmx.fUpdatedGuestState |= HMVMX_UPDATED_GUEST_CR0;
    48304785    }
    48314786    return rc;
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