VirtualBox

Changeset 69801 in vbox for trunk/src/VBox/VMM/VMMR0


Ignore:
Timestamp:
Nov 22, 2017 8:39:16 AM (7 years ago)
Author:
vboxsync
Message:

VMM/HMSVMR0: Don't look at VMCB cache after we've restored the VMCB fields.

File:
1 edited

Legend:

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

    r69787 r69801  
    46214621    Assert(pSvmTransient->u64ExitCode <= SVM_EXIT_MAX);
    46224622
    4623 #define HM_SVM_RET_VMEXIT_NESTED(a_pVCpu, a_uExitCode, a_uExitInfo1, a_uExitInfo2) \
    4624     do \
    4625     { \
    4626         return VBOXSTRICTRC_TODO(IEMExecSvmVmexit(a_pVCpu, a_uExitCode, a_uExitInfo1, a_uExitInfo2)); \
    4627     } while (0) \
     4623#define HM_SVM_VMEXIT_NESTED(a_pVCpu, a_uExitCode, a_uExitInfo1, a_uExitInfo2) \
     4624            VBOXSTRICTRC_TODO(IEMExecSvmVmexit(a_pVCpu, a_uExitCode, a_uExitInfo1, a_uExitInfo2))
     4625#define HM_SVM_IS_CTRL_INTERCEPT_SET(a_pCtx, a_Intercept)       CPUMIsGuestSvmCtrlInterceptSet(a_pCtx, (a_Intercept))
     4626#define HM_SVM_IS_XCPT_INTERCEPT_SET(a_pCtx, a_Xcpt)            CPUMIsGuestSvmXcptInterceptSet(a_pCtx, (a_Xcpt))
     4627#define HM_SVM_IS_READ_CR_INTERCEPT_SET(a_pCtx, a_uCr)          CPUMIsGuestSvmReadCRxInterceptSet(a_pCtx, (a_uCr))
     4628#define HM_SVM_IS_READ_DR_INTERCEPT_SET(a_pCtx, a_uDr)          CPUMIsGuestSvmReadDRxInterceptSet(a_pCtx, (a_uDr))
     4629#define HM_SVM_IS_WRITE_CR_INTERCEPT_SET(a_pCtx, a_uCr)         CPUMIsGuestSvmWriteCRxInterceptSet(a_pCtx, (a_uCr))
     4630#define HM_SVM_IS_WRITE_DR_INTERCEPT_SET(a_pCtx, a_uDr)         CPUMIsGuestSvmWriteDRxInterceptSet(a_pCtx, (a_uDr))
    46284631
    46294632    /*
     
    46334636    PSVMVMCB            pVmcbNstGst      = pCtx->hwvirt.svm.CTX_SUFF(pVmcb);
    46344637    PSVMVMCBCTRL        pVmcbNstGstCtrl  = &pVmcbNstGst->ctrl;
    4635     PSVMNESTEDVMCBCACHE pVmcbNstGstCache = &pVCpu->hm.s.svm.NstGstVmcbCache;
    46364638    uint64_t const      uExitCode        = pVmcbNstGstCtrl->u64ExitCode;
    46374639    uint64_t const      uExitInfo1       = pVmcbNstGstCtrl->u64ExitInfo1;
     
    46434645        case SVM_EXIT_CPUID:
    46444646        {
    4645             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_CPUID)
    4646                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4647            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_CPUID))
     4648                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    46474649            return hmR0SvmExitCpuid(pVCpu, pCtx, pSvmTransient);
    46484650        }
     
    46504652        case SVM_EXIT_RDTSC:
    46514653        {
    4652             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_RDTSC)
    4653                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4654            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_RDTSC))
     4655                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    46544656            return hmR0SvmExitRdtsc(pVCpu, pCtx, pSvmTransient);
    46554657        }
     
    46574659        case SVM_EXIT_RDTSCP:
    46584660        {
    4659             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_RDTSCP)
    4660                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4661            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_RDTSCP))
     4662                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    46614663            return hmR0SvmExitRdtscp(pVCpu, pCtx, pSvmTransient);
    46624664        }
     
    46654667        case SVM_EXIT_MONITOR:
    46664668        {
    4667             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_MONITOR)
    4668                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4669            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_MONITOR))
     4670                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    46694671            return hmR0SvmExitMonitor(pVCpu, pCtx, pSvmTransient);
    46704672        }
     
    46724674        case SVM_EXIT_MWAIT:
    46734675        {
    4674             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_MWAIT)
    4675                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4676            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_MWAIT))
     4677                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    46764678            return hmR0SvmExitMwait(pVCpu, pCtx, pSvmTransient);
    46774679        }
     
    46794681        case SVM_EXIT_HLT:
    46804682        {
    4681             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_HLT)
    4682                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4683            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_HLT))
     4684                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    46834685            return hmR0SvmExitHlt(pVCpu, pCtx, pSvmTransient);
    46844686        }
     
    46864688        case SVM_EXIT_MSR:
    46874689        {
    4688             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_MSR_PROT)
     4690            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_MSR_PROT))
    46894691            {
    46904692                uint32_t const idMsr = pCtx->ecx;
     
    47014703                        || (fInterceptRead  && pVmcbNstGstCtrl->u64ExitInfo1 == SVM_EXIT1_MSR_READ))
    47024704                    {
    4703                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4705                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    47044706                    }
    47054707                }
     
    47114713                     */
    47124714                    Assert(rc == VERR_OUT_OF_RANGE);
    4713                     HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4715                    return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    47144716                }
    47154717            }
     
    47224724             * Figure out if the IO port access is intercepted by the nested-guest.
    47234725             */
    4724             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_IOIO_PROT)
     4726            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_IOIO_PROT))
    47254727            {
    47264728                void *pvIoBitmap = pCtx->hwvirt.svm.CTX_SUFF(pvIoBitmap);
     
    47294731                bool const fIntercept = hmR0SvmIsIoInterceptActive(pvIoBitmap, &IoExitInfo);
    47304732                if (fIntercept)
    4731                     HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4733                    return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    47324734            }
    47334735            return hmR0SvmExitIOInstr(pVCpu, pCtx, pSvmTransient);
     
    47434745
    47444746                /* If the nested-guest is intercepting #PFs, cause a #PF #VMEXIT. */
    4745                 if (pVmcbNstGstCache->u32InterceptXcpt & RT_BIT(X86_XCPT_PF))
    4746                     HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, u32ErrCode, uFaultAddress);
     4747                if (HM_SVM_IS_XCPT_INTERCEPT_SET(pCtx, X86_XCPT_PF))
     4748                    return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, u32ErrCode, uFaultAddress);
    47474749
    47484750                /* If the nested-guest is not intercepting #PFs, forward the #PF to the nested-guest. */
     
    47554757        case SVM_EXIT_EXCEPTION_7:   /* X86_XCPT_NM */
    47564758        {
    4757             if (pVmcbNstGstCache->u32InterceptXcpt & RT_BIT(X86_XCPT_NM))
    4758                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4759            if (HM_SVM_IS_XCPT_INTERCEPT_SET(pCtx, X86_XCPT_NM))
     4760                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    47594761            hmR0SvmSetPendingXcptNM(pVCpu);
    47604762            return VINF_SUCCESS;
     
    47634765        case SVM_EXIT_EXCEPTION_6:   /* X86_XCPT_UD */
    47644766        {
    4765             if (pVmcbNstGstCache->u32InterceptXcpt & RT_BIT(X86_XCPT_UD))
    4766                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4767            if (HM_SVM_IS_XCPT_INTERCEPT_SET(pCtx, X86_XCPT_UD))
     4768                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    47674769            hmR0SvmSetPendingXcptUD(pVCpu);
    47684770            return VINF_SUCCESS;
     
    47714773        case SVM_EXIT_EXCEPTION_16:  /* X86_XCPT_MF */
    47724774        {
    4773             if (pVmcbNstGstCache->u32InterceptXcpt & RT_BIT(X86_XCPT_MF))
    4774                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4775            if (HM_SVM_IS_XCPT_INTERCEPT_SET(pCtx, X86_XCPT_MF))
     4776                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    47754777            hmR0SvmSetPendingXcptMF(pVCpu);
    47764778            return VINF_SUCCESS;
     
    47794781        case SVM_EXIT_EXCEPTION_1:   /* X86_XCPT_DB */
    47804782        {
    4781             if (pVmcbNstGstCache->u32InterceptXcpt & RT_BIT(X86_XCPT_DB))
    4782                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4783            if (HM_SVM_IS_XCPT_INTERCEPT_SET(pCtx, X86_XCPT_DB))
     4784                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    47834785            return hmR0SvmNestedExitXcptDB(pVCpu, pCtx, pSvmTransient);
    47844786        }
     
    47864788        case SVM_EXIT_EXCEPTION_17:  /* X86_XCPT_AC */
    47874789        {
    4788             if (pVmcbNstGstCache->u32InterceptXcpt & RT_BIT(X86_XCPT_AC))
    4789                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4790            if (HM_SVM_IS_XCPT_INTERCEPT_SET(pCtx, X86_XCPT_AC))
     4791                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    47904792            return hmR0SvmExitXcptAC(pVCpu, pCtx, pSvmTransient);
    47914793        }
     
    47934795        case SVM_EXIT_EXCEPTION_3:   /* X86_XCPT_BP */
    47944796        {
    4795             if (pVmcbNstGstCache->u32InterceptXcpt & RT_BIT(X86_XCPT_BP))
    4796                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4797            if (HM_SVM_IS_XCPT_INTERCEPT_SET(pCtx, X86_XCPT_BP))
     4798                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    47974799            return hmR0SvmNestedExitXcptBP(pVCpu, pCtx, pSvmTransient);
    47984800        }
     
    48024804        case SVM_EXIT_READ_CR4:
    48034805        {
    4804             if (pVmcbNstGstCache->u16InterceptRdCRx & (1U << (uint16_t)(pSvmTransient->u64ExitCode - SVM_EXIT_READ_CR0)))
    4805                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4806            if (HM_SVM_IS_READ_CR_INTERCEPT_SET(pCtx, (1U << (uint16_t)(pSvmTransient->u64ExitCode - SVM_EXIT_READ_CR0))))
     4807                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    48064808            return hmR0SvmExitReadCRx(pVCpu, pCtx, pSvmTransient);
    48074809        }
     
    48134815        {
    48144816            Log4(("hmR0SvmHandleExitNested: Write CRx: u16InterceptWrCRx=%#x u64ExitCode=%#RX64 %#x\n",
    4815                   pVmcbNstGstCache->u16InterceptWrCRx, pSvmTransient->u64ExitCode,
     4817                  pVmcbNstGstCtrl->u16InterceptWrCRx, pSvmTransient->u64ExitCode,
    48164818                  (1U << (uint16_t)(pSvmTransient->u64ExitCode - SVM_EXIT_WRITE_CR0))));
    4817             if (pVmcbNstGstCache->u16InterceptWrCRx & (1U << (uint16_t)(pSvmTransient->u64ExitCode - SVM_EXIT_WRITE_CR0)))
    4818                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4819
     4820            if (HM_SVM_IS_WRITE_CR_INTERCEPT_SET(pCtx, (1U << (uint16_t)(pSvmTransient->u64ExitCode - SVM_EXIT_WRITE_CR0))))
     4821                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    48194822            return hmR0SvmExitWriteCRx(pVCpu, pCtx, pSvmTransient);
    48204823        }
     
    48224825        case SVM_EXIT_PAUSE:
    48234826        {
    4824             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_PAUSE)
    4825                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4827            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_PAUSE))
     4828                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    48264829            return hmR0SvmExitPause(pVCpu, pCtx, pSvmTransient);
    48274830        }
     
    48294832        case SVM_EXIT_VINTR:
    48304833        {
    4831             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_VINTR)
    4832                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4834            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_VINTR))
     4835                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    48334836            return hmR0SvmExitUnexpected(pVCpu, pCtx, pSvmTransient);
    48344837        }
     
    48424845        case SVM_EXIT_FERR_FREEZE:
    48434846        {
    4844             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_FERR_FREEZE)
    4845                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4847            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_FERR_FREEZE))
     4848                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    48464849            return hmR0SvmExitIntr(pVCpu, pCtx, pSvmTransient);
    48474850        }
     
    48494852        case SVM_EXIT_NMI:
    48504853        {
    4851             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_NMI)
    4852                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4854            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_NMI))
     4855                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    48534856            return hmR0SvmExitIntr(pVCpu, pCtx, pSvmTransient);
    48544857        }
     
    48564859        case SVM_EXIT_INVLPG:
    48574860        {
    4858             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_INVLPG)
    4859                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4861            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_INVLPG))
     4862                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    48604863            return hmR0SvmExitInvlpg(pVCpu, pCtx, pSvmTransient);
    48614864        }
     
    48634866        case SVM_EXIT_WBINVD:
    48644867        {
    4865             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_WBINVD)
    4866                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4868            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_WBINVD))
     4869                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    48674870            return hmR0SvmExitWbinvd(pVCpu, pCtx, pSvmTransient);
    48684871        }
     
    48704873        case SVM_EXIT_INVD:
    48714874        {
    4872             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_INVD)
    4873                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4875            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_INVD))
     4876                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    48744877            return hmR0SvmExitInvd(pVCpu, pCtx, pSvmTransient);
    48754878        }
     
    48774880        case SVM_EXIT_RDPMC:
    48784881        {
    4879             if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_RDPMC)
    4880                 HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4882            if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_RDPMC))
     4883                return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    48814884            return hmR0SvmExitRdpmc(pVCpu, pCtx, pSvmTransient);
    48824885        }
     
    48914894                case SVM_EXIT_READ_DR14:    case SVM_EXIT_READ_DR15:
    48924895                {
    4893                     if (pVmcbNstGstCache->u16InterceptRdDRx & (1U << (uint16_t)(pSvmTransient->u64ExitCode - SVM_EXIT_READ_DR0)))
    4894                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4896                    if (HM_SVM_IS_READ_DR_INTERCEPT_SET(pCtx, (1U << (uint16_t)(pSvmTransient->u64ExitCode - SVM_EXIT_READ_DR0))))
     4897                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    48954898                    return hmR0SvmExitReadDRx(pVCpu, pCtx, pSvmTransient);
    48964899                }
     
    49014904                case SVM_EXIT_WRITE_DR14:   case SVM_EXIT_WRITE_DR15:
    49024905                {
    4903                     if (pVmcbNstGstCache->u16InterceptWrDRx & (1U << (uint16_t)(pSvmTransient->u64ExitCode - SVM_EXIT_WRITE_DR0)))
    4904                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4906                    if (HM_SVM_IS_WRITE_DR_INTERCEPT_SET(pCtx, (1U << (uint16_t)(pSvmTransient->u64ExitCode - SVM_EXIT_WRITE_DR0))))
     4907                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49054908                    return hmR0SvmExitWriteDRx(pVCpu, pCtx, pSvmTransient);
    49064909                }
     
    49194922                case SVM_EXIT_EXCEPTION_30:      case SVM_EXIT_EXCEPTION_31:
    49204923                {
    4921                     if (pVmcbNstGstCache->u32InterceptXcpt & (1U << (uint32_t)(pSvmTransient->u64ExitCode - SVM_EXIT_EXCEPTION_0)))
    4922                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4924                    if (HM_SVM_IS_XCPT_INTERCEPT_SET(pCtx, (uint32_t)(pSvmTransient->u64ExitCode - SVM_EXIT_EXCEPTION_0)))
     4925                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49234926                    /** @todo Write hmR0SvmExitXcptGeneric! */
    49244927                    return VERR_NOT_IMPLEMENTED;
     
    49274930                case SVM_EXIT_XSETBV:
    49284931                {
    4929                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_XSETBV)
    4930                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4932                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_XSETBV))
     4933                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49314934                    return hmR0SvmExitXsetbv(pVCpu, pCtx, pSvmTransient);
    49324935                }
     
    49344937                case SVM_EXIT_TASK_SWITCH:
    49354938                {
    4936                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_TASK_SWITCH)
    4937                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4939                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_TASK_SWITCH))
     4940                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49384941                    return hmR0SvmExitTaskSwitch(pVCpu, pCtx, pSvmTransient);
    49394942                }
     
    49414944                case SVM_EXIT_IRET:
    49424945                {
    4943                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_IRET)
    4944                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4946                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_IRET))
     4947                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49454948                    return hmR0SvmNestedExitIret(pVCpu, pCtx, pSvmTransient);
    49464949                }
     
    49484951                case SVM_EXIT_SHUTDOWN:
    49494952                {
    4950                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_SHUTDOWN)
    4951                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4953                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_SHUTDOWN))
     4954                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49524955                    return hmR0SvmExitShutdown(pVCpu, pCtx, pSvmTransient);
    49534956                }
     
    49554958                case SVM_EXIT_SMI:
    49564959                {
    4957                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_SMI)
    4958                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4960                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_SMI))
     4961                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49594962                    return hmR0SvmExitUnexpected(pVCpu, pCtx, pSvmTransient);
    49604963                }
     
    49624965                case SVM_EXIT_INIT:
    49634966                {
    4964                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_INIT)
    4965                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4967                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_INIT))
     4968                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49664969                    return hmR0SvmExitUnexpected(pVCpu, pCtx, pSvmTransient);
    49674970                }
     
    49694972                case SVM_EXIT_VMMCALL:
    49704973                {
    4971                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_VMMCALL)
    4972                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4974                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_VMMCALL))
     4975                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49734976                    return hmR0SvmExitVmmCall(pVCpu, pCtx, pSvmTransient);
    49744977                }
     
    49764979                case SVM_EXIT_CLGI:
    49774980                {
    4978                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_CLGI)
    4979                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4981                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_CLGI))
     4982                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49804983                     return hmR0SvmExitClgi(pVCpu, pCtx, pSvmTransient);
    49814984                }
     
    49834986                case SVM_EXIT_STGI:
    49844987                {
    4985                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_STGI)
    4986                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4988                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_STGI))
     4989                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49874990                     return hmR0SvmExitStgi(pVCpu, pCtx, pSvmTransient);
    49884991                }
     
    49904993                case SVM_EXIT_VMLOAD:
    49914994                {
    4992                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_VMLOAD)
    4993                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     4995                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_VMLOAD))
     4996                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    49944997                    return hmR0SvmExitVmload(pVCpu, pCtx, pSvmTransient);
    49954998                }
     
    49975000                case SVM_EXIT_VMSAVE:
    49985001                {
    4999                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_VMSAVE)
    5000                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     5002                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_VMSAVE))
     5003                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    50015004                    return hmR0SvmExitVmsave(pVCpu, pCtx, pSvmTransient);
    50025005                }
     
    50045007                case SVM_EXIT_INVLPGA:
    50055008                {
    5006                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_INVLPGA)
    5007                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     5009                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_INVLPGA))
     5010                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    50085011                    return hmR0SvmExitInvlpga(pVCpu, pCtx, pSvmTransient);
    50095012                }
     
    50115014                case SVM_EXIT_VMRUN:
    50125015                {
    5013                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_VMRUN)
    5014                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     5016                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_VMRUN))
     5017                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    50155018                    return hmR0SvmExitVmrun(pVCpu, pCtx, pSvmTransient);
    50165019                }
     
    50185021                case SVM_EXIT_RSM:
    50195022                {
    5020                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_RSM)
    5021                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     5023                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_RSM))
     5024                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    50225025                    hmR0SvmSetPendingXcptUD(pVCpu);
    50235026                    return VINF_SUCCESS;
     
    50265029                case SVM_EXIT_SKINIT:
    50275030                {
    5028                     if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_SKINIT)
    5029                         HM_SVM_RET_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
     5031                    if (HM_SVM_IS_CTRL_INTERCEPT_SET(pCtx, SVM_CTRL_INTERCEPT_SKINIT))
     5032                        return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);
    50305033                    hmR0SvmSetPendingXcptUD(pVCpu);
    50315034                    return VINF_SUCCESS;
     
    50505053    /* not reached */
    50515054
    5052 #undef HM_SVM_RET_VMEXIT_NESTED
     5055#undef HM_SVM_VMEXIT_NESTED
     5056#undef HM_SVM_IS_CTRL_INTERCEPT_SET
     5057#undef HM_SVM_IS_XCPT_INTERCEPT_SET
     5058#undef HM_SVM_IS_READ_CR_INTERCEPT_SET
     5059#undef HM_SVM_IS_READ_DR_INTERCEPT_SET
     5060#undef HM_SVM_IS_WRITE_CR_INTERCEPT_SET
     5061#undef HM_SVM_IS_WRITE_DR_INTERCEPT_SET
    50535062}
    50545063#endif
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