VirtualBox

Changeset 78237 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 22, 2019 4:35:20 AM (6 years ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:9180 Remove some superfluous VM-exit handlers that can be handled by merely passing the VM-exit reason. Preparation of ring-0 VM-exit handling.

Location:
trunk/src/VBox/VMM
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r77898 r78237  
    986986IEM_STATIC VBOXSTRICTRC     iemVmxVmexitNmi(PVMCPU pVCpu);
    987987IEM_STATIC VBOXSTRICTRC     iemVmxVmexitStartupIpi(PVMCPU pVCpu, uint8_t uVector);
    988 IEM_STATIC VBOXSTRICTRC     iemVmxVmexitInitIpi(PVMCPU pVCpu);
    989 IEM_STATIC VBOXSTRICTRC     iemVmxVmexitIntWindow(PVMCPU pVCpu);
    990 IEM_STATIC VBOXSTRICTRC     iemVmxVmexitNmiWindow(PVMCPU pVCpu);
    991 IEM_STATIC VBOXSTRICTRC     iemVmxVmexitMtf(PVMCPU pVCpu);
     988IEM_STATIC VBOXSTRICTRC     iemVmxVmexit(PVMCPU pVCpu, uint32_t uExitReason);
    992989IEM_STATIC VBOXSTRICTRC     iemVmxVirtApicAccessMem(PVMCPU pVCpu, uint16_t offAccess, size_t cbAccess, void *pvData, uint32_t fAccess);
    993990IEM_STATIC VBOXSTRICTRC     iemVmxVmexitApicAccess(PVMCPU pVCpu, uint16_t offAccess, uint32_t fAccess);
     
    1406614063        else if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_MTF))
    1406714064        {
    14068             rcStrict = iemVmxVmexitMtf(pVCpu);
     14065            rcStrict = iemVmxVmexit(pVCpu, VMX_EXIT_MTF);
    1406914066            Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS));
    1407014067            Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_MTF));
     
    1408514082        else if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW))
    1408614083        {
    14087             rcStrict = iemVmxVmexitNmiWindow(pVCpu);
     14084            rcStrict = iemVmxVmexit(pVCpu, VMX_EXIT_NMI_WINDOW);
    1408814085            Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW));
    1408914086        }
     
    1591315910
    1591415911/**
    15915  * Interface for HM and EM to emulate VM-exit due to init-IPI (INIT).
     15912 * Interface for HM and EM to emulate a VM-exit.
     15913 *
     15914 * If a specialized version of a VM-exit handler exists, that must be used instead.
    1591615915 *
    1591715916 * @returns Strict VBox status code.
    1591815917 * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
     15918 * @param   uExitReason     The VM-exit reason.
    1591915919 * @thread  EMT(pVCpu)
    15920  */
    15921 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitInitIpi(PVMCPU pVCpu)
    15922 {
    15923     VBOXSTRICTRC rcStrict = iemVmxVmexitInitIpi(pVCpu);
    15924     if (pVCpu->iem.s.cActiveMappings)
    15925         iemMemRollback(pVCpu);
    15926     return iemExecStatusCodeFiddling(pVCpu, rcStrict);
    15927 }
    15928 
    15929 
    15930 /**
    15931  * Interface for HM and EM to emulate VM-exits for interrupt-windows.
    15932  *
    15933  * @returns Strict VBox status code.
    15934  * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
    15935  * @thread  EMT(pVCpu)
    15936  */
    15937 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitIntWindow(PVMCPU pVCpu)
    15938 {
    15939     VBOXSTRICTRC rcStrict = iemVmxVmexitIntWindow(pVCpu);
    15940     if (pVCpu->iem.s.cActiveMappings)
    15941         iemMemRollback(pVCpu);
    15942     return iemExecStatusCodeFiddling(pVCpu, rcStrict);
    15943 }
    15944 
    15945 
    15946 /**
    15947  * Interface for HM and EM to emulate VM-exits for NMI-windows.
    15948  *
    15949  * @returns Strict VBox status code.
    15950  * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
    15951  * @thread  EMT(pVCpu)
    15952  */
    15953 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitNmiWindow(PVMCPU pVCpu)
    15954 {
    15955     VBOXSTRICTRC rcStrict = iemVmxVmexitNmiWindow(pVCpu);
    15956     if (pVCpu->iem.s.cActiveMappings)
    15957         iemMemRollback(pVCpu);
    15958     return iemExecStatusCodeFiddling(pVCpu, rcStrict);
    15959 }
    15960 
    15961 
    15962 /**
    15963  * Interface for HM and EM to emulate VM-exits Monitor-Trap Flag (MTF).
    15964  *
    15965  * @returns Strict VBox status code.
    15966  * @param   pVCpu           The cross context virtual CPU structure of the calling EMT.
    15967  * @thread  EMT(pVCpu)
    15968  */
    15969 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitMtf(PVMCPU pVCpu)
    15970 {
    15971     VBOXSTRICTRC rcStrict = iemVmxVmexitMtf(pVCpu);
     15920 *
     15921 * @remarks It is the responsibility of the caller to ensure VM-exit qualification
     15922 *          is updated prior to calling this function!
     15923 */
     15924VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexit(PVMCPU pVCpu, uint32_t uExitReason)
     15925{
     15926    VBOXSTRICTRC rcStrict = iemVmxVmexit(pVCpu, uExitReason);
    1597215927    if (pVCpu->iem.s.cActiveMappings)
    1597315928        iemMemRollback(pVCpu);
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r78220 r78237  
    30723072
    30733073/**
    3074  * VMX VM-exit handler for VM-exits due to Monitor-Trap Flag (MTF).
    3075  *
    3076  * @returns Strict VBox status code.
    3077  * @param   pVCpu   The cross context virtual CPU structure.
    3078  */
    3079 IEM_STATIC VBOXSTRICTRC iemVmxVmexitMtf(PVMCPU pVCpu)
    3080 {
    3081     /*
    3082      * The MTF VM-exit can occur even when the MTF VM-execution control is
    3083      * not set (e.g. when VM-entry injects an MTF pending event), so do not
    3084      * check for the intercept here.
    3085      */
    3086     return iemVmxVmexit(pVCpu, VMX_EXIT_MTF);
    3087 }
    3088 
    3089 
    3090 /**
    30913074 * VMX VM-exit handler for VM-exits due to INVLPG.
    30923075 *
     
    39213904    iemVmxVmcsSetExitQual(pVCpu, uVector);
    39223905    return iemVmxVmexit(pVCpu, VMX_EXIT_SIPI);
    3923 }
    3924 
    3925 
    3926 /**
    3927  * VMX VM-exit handler for VM-exits due to init-IPIs (INIT).
    3928  *
    3929  * @returns VBox strict status code.
    3930  * @param   pVCpu       The cross context virtual CPU structure.
    3931  */
    3932 IEM_STATIC VBOXSTRICTRC iemVmxVmexitInitIpi(PVMCPU pVCpu)
    3933 {
    3934     return iemVmxVmexit(pVCpu, VMX_EXIT_INIT_SIGNAL);
    3935 }
    3936 
    3937 
    3938 /**
    3939  * VMX VM-exit handler for interrupt-window VM-exits.
    3940  *
    3941  * @returns VBox strict status code.
    3942  * @param   pVCpu           The cross context virtual CPU structure.
    3943  */
    3944 IEM_STATIC VBOXSTRICTRC iemVmxVmexitIntWindow(PVMCPU pVCpu)
    3945 {
    3946     return iemVmxVmexit(pVCpu, VMX_EXIT_INT_WINDOW);
    3947 }
    3948 
    3949 
    3950 /**
    3951  * VMX VM-exit handler for NMI-window VM-exits.
    3952  *
    3953  * @returns VBox strict status code.
    3954  * @param   pVCpu           The cross context virtual CPU structure.
    3955  */
    3956 IEM_STATIC VBOXSTRICTRC iemVmxVmexitNmiWindow(PVMCPU pVCpu)
    3957 {
    3958     return iemVmxVmexit(pVCpu, VMX_EXIT_NMI_WINDOW);
    39593906}
    39603907
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r78220 r78237  
    17291729        && CPUMIsGuestVmxProcCtlsSet(pVCpu, &pVCpu->cpum.GstCtx, VMX_PROC_CTLS_INT_WINDOW_EXIT))
    17301730    {
    1731         VBOXSTRICTRC rcStrict = IEMExecVmxVmexitIntWindow(pVCpu);
     1731        VBOXSTRICTRC rcStrict = IEMExecVmxVmexit(pVCpu, VMX_EXIT_INT_WINDOW);
    17321732        if (RT_SUCCESS(rcStrict))
    17331733        {
     
    21572157        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_MTF))
    21582158        {
    2159             rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexitMtf(pVCpu));
     2159            rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexit(pVCpu, VMX_EXIT_MTF));
    21602160            Assert(rc2 != VINF_VMX_INTERCEPT_NOT_ACTIVE);
    21612161            UPDATE_RC();
     
    21792179        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_NMI_WINDOW))
    21802180        {
    2181             rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexitNmiWindow(pVCpu));
     2181            rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexit(pVCpu, VMX_EXIT_NMI_WINDOW));
    21822182            Assert(rc2 != VINF_VMX_INTERCEPT_NOT_ACTIVE);
    21832183            UPDATE_RC();
  • trunk/src/VBox/VMM/VMMR3/VMM.cpp

    r76553 r78237  
    16471647    PCCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu);
    16481648    if (CPUMIsGuestInVmxNonRootMode(pCtx))
    1649         return VBOXSTRICTRC_TODO(IEMExecVmxVmexitInitIpi(pVCpu));
     1649        return VBOXSTRICTRC_TODO(IEMExecVmxVmexit(pVCpu, VMX_EXIT_INIT_SIGNAL));
    16501650#endif
    16511651
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