VirtualBox

Changeset 75997 in vbox


Ignore:
Timestamp:
Dec 6, 2018 6:45:19 AM (6 years ago)
Author:
vboxsync
Message:

VMM/EM: Nested VMX: bugref:9180 Include APIC-write FF in the high-priority post-execution FF mask. Add VMCPU_FF_INTERRUPT_NESTED_GUEST among the flags we check to reschedule from a MWAIT keeping in mind when virtual posted-interrupts may be implemented.

Location:
trunk
Files:
2 edited

Legend:

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

    r75830 r75997  
    592592#define VM_FF_HIGH_PRIORITY_POST_MASK           (  VM_FF_PGM_NO_MEMORY )
    593593/** High priority post-execution actions. */
    594 #define VMCPU_FF_HIGH_PRIORITY_POST_MASK        (  VMCPU_FF_PDM_CRITSECT  | VM_WHEN_RAW_MODE(VMCPU_FF_CSAM_PENDING_ACTION, 0) \
    595                                                  | VMCPU_FF_HM_UPDATE_CR3 | VMCPU_FF_HM_UPDATE_PAE_PDPES \
    596                                                  | VMCPU_FF_IEM          | VMCPU_FF_IOM )
     594#define VMCPU_FF_HIGH_PRIORITY_POST_MASK        (  VMCPU_FF_PDM_CRITSECT   | VM_WHEN_RAW_MODE(VMCPU_FF_CSAM_PENDING_ACTION, 0) \
     595                                                 | VMCPU_FF_HM_UPDATE_CR3  | VMCPU_FF_HM_UPDATE_PAE_PDPES \
     596                                                 | VMCPU_FF_VMX_APIC_WRITE | VMCPU_FF_IEM | VMCPU_FF_IOM )
    597597
    598598/** Normal priority VM post-execution actions. */
     
    631631                                                 | VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_UPDATE_APIC   | VMCPU_FF_INTERRUPT_PIC \
    632632                                                 | VMCPU_FF_INTERRUPT_NMI  | VMCPU_FF_INTERRUPT_SMI | VMCPU_FF_PDM_CRITSECT \
    633                                                  | VMCPU_FF_TIMER          | VMCPU_FF_REQUEST )
     633                                                 | VMCPU_FF_TIMER          | VMCPU_FF_REQUEST       \
     634                                                 | VMCPU_FF_INTERRUPT_NESTED_GUEST )
    634635/** VMCPU flags that cause the REP[|NE|E] STRINS loops to yield, interrupts
    635636 *  disabled. */
    636637#define VMCPU_FF_YIELD_REPSTR_NOINT_MASK        (  VMCPU_FF_YIELD_REPSTR_MASK \
    637                                                  & ~(VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_UPDATE_APIC   | VMCPU_FF_INTERRUPT_PIC) )
     638                                                 & ~(  VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_UPDATE_APIC | VMCPU_FF_INTERRUPT_PIC \
     639                                                     | VMCPU_FF_INTERRUPT_NESTED_GUEST) )
    638640
    639641/** VM Flags that cause the HM loops to go back to ring-3. */
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r75960 r75997  
    16951695    }
    16961696
     1697#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     1698        /*
     1699         * VMX Nested-guest APIC-write pending (can cause VM-exits).
     1700         * Takes priority over even SMI and INIT signals.
     1701         * See Intel spec. 29.4.3.2 "APIC-Write Emulation".
     1702         */
     1703        if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_APIC_WRITE))
     1704        {
     1705            rc = VBOXSTRICTRC_VAL(IEMExecVmxVmexitApicWrite(pVCpu));
     1706            Assert(rc != VINF_VMX_INTERCEPT_NOT_ACTIVE);
     1707        }
     1708#endif
     1709
    16971710#ifdef VBOX_WITH_RAW_MODE
    16981711    if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_CSAM_PENDING_ACTION))
     
    21112124        }
    21122125
    2113 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX
    2114         /*
    2115          * VMX Nested-guest APIC-write VM-exit.
    2116          * Takes priority over SMI, INIT signals.
    2117          * See Intel spec. 29.4.3.2 "APIC-Write Emulation".
    2118          */
    2119         if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_VMX_APIC_WRITE))
    2120         {
    2121             rc2 = VBOXSTRICTRC_VAL(IEMExecVmxVmexitApicWrite(pVCpu));
    2122             if (rc2 == VINF_VMX_INTERCEPT_NOT_ACTIVE)
    2123                 rc2 = VINF_SUCCESS;
    2124             UPDATE_RC();
    2125         }
    2126 #endif
    2127 
    21282126        /** @todo SMIs. If we implement SMIs, this is where they will have to be
    21292127         *        delivered. */
     
    21952193            if (fGif)
    21962194            {
    2197                 /* In VMX, virtual interrupt takes priority over physical interrupts. */
     2195                /*
     2196                 * With VMX, virtual interrupts takes priority over physical interrupts.
     2197                 * With SVM, physical interrupts takes priority over virtual interrupts.
     2198                 */
    21982199                if (   VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INTERRUPT_NESTED_GUEST)
    21992200                    && CPUMIsGuestInVmxNonRootMode(&pVCpu->cpum.GstCtx)
     
    22032204                    rc2 = VINF_NO_CHANGE;
    22042205                }
    2205                 /* In SVM, physical interrupts take priority over virtual interrupts. */
    22062206                else if (   VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC)
    22072207                         && CPUMIsGuestPhysIntrEnabled(pVCpu))
     
    29182918
    29192919                            if (VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC
     2920                                                         | VMCPU_FF_INTERRUPT_NESTED_GUEST
    29202921                                                         | VMCPU_FF_INTERRUPT_NMI  | VMCPU_FF_INTERRUPT_SMI | VMCPU_FF_UNHALT))
    29212922                            {
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