VirtualBox

Changeset 95352 in vbox for trunk/src


Ignore:
Timestamp:
Jun 23, 2022 6:34:43 AM (3 years ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:10092 APIC-access page related cleanup for nested EPT.

File:
1 edited

Legend:

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

    r95161 r95352  
    41714171    Assert(!pVCpu->iem.s.cActiveMappings);
    41724172    return iemExecStatusCodeFiddling(pVCpu, rcStrict);
    4173 
    41744173}
    41754174
     
    71347133        {
    71357134            PVMCC pVM = pVCpu->CTX_SUFF(pVM);
    7136             int rc = PGMHandlerPhysicalRegister(pVM, GCPhysApicAccess, GCPhysApicAccess + X86_PAGE_4K_SIZE - 1,
     7135            int rc = PGMHandlerPhysicalRegister(pVM, GCPhysApicAccess, GCPhysApicAccess | X86_PAGE_4K_OFFSET_MASK,
    71377136                                                pVM->iem.s.hVmxApicAccessPage, 0 /*uUser*/, NULL /*pszDesc*/);
    71387137            if (RT_SUCCESS(rc))
    7139             { /* likely */ }
     7138            {
     7139                /*
     7140                 * This to make double sure we trigger EPT violations (rather than EPT misconfigs)
     7141                 * in case we somehow managed to sync the page when CPUMIsGuestVmxApicAccessPageAddr
     7142                 * returned false while sycing its PTE in (SyncHandlerPte).
     7143                 */
     7144                PGMShwMakePageNotPresent(pVCpu, GCPhysApicAccess, 0 /* fOpFlags */);
     7145            }
    71407146            else
    71417147                IEM_VMX_VMENTRY_FAILED_RET(pVCpu, pszInstr, pszFailure, kVmxVDiag_Vmentry_AddrApicAccessHandlerReg);
     
    99309936             * within the APIC-access page. Currently only HM is supported.
    99319937             */
    9932             AssertMsgReturn(VM_IS_HM_ENABLED(pVM),
    9933                             ("VM-exit auxiliary info. fetching not supported for execution engine %d\n",
    9934                              pVM->bMainExecutionEngine), VERR_IEM_ASPECT_NOT_IMPLEMENTED);
     9938            AssertMsg(VM_IS_HM_ENABLED(pVM), ("VM-exit auxiliary info. fetching not supported for execution engine %d\n",
     9939                                              pVM->bMainExecutionEngine));
    99359940            HMEXITAUX HmExitAux;
    99369941            RT_ZERO(HmExitAux);
     
    99399944                                                               | HMVMX_READ_IDT_VECTORING_INFO
    99409945                                                               | HMVMX_READ_IDT_VECTORING_ERROR_CODE);
    9941             AssertRCReturn(rc, rc);
     9946            AssertRC(rc);
    99429947
    99439948            /*
    99449949             * Verify the VM-exit reason must be an EPT violation.
    99459950             * Other accesses should go through the other handler (iemVmxApicAccessPageHandler).
     9951             * Refer to @bugref{10092#c33s} for a more detailed explanation.
    99469952             */
    9947             AssertLogRelMsgReturn(HmExitAux.Vmx.uReason == VMX_EXIT_EPT_VIOLATION,
    9948                                   ("Unexpected call to the VMX APIC-access page #PF handler for %#RGp (Nested=%#RGp, GCPhysAddr%#RGp) off=%u uReason=%u\n",
    9949                                    GCPhysPage, GCPhysNestedFault, HmExitAux.Vmx.u64GuestPhysAddr, offAccess, HmExitAux.Vmx.uReason), VERR_IEM_IPE_9);
     9953            AssertMsg(HmExitAux.Vmx.uReason == VMX_EXIT_EPT_VIOLATION,
     9954                      ("Unexpected call to APIC-access page #PF handler for %#RGp off=%u uErr=%#RGx uReason=%u\n",
     9955                       GCPhysPage, offAccess, uErr, HmExitAux.Vmx.uReason));
    99509956
    99519957            /*
     
    1000010006         * This requires emulating the instruction because we need the bytes being
    1000110007         * read/written by the instruction not just the offset being accessed within
    10002          * the APIC-access (which we derive from the faulting address).
     10008         * the APIC-access page (which we derive from the faulting address).
    1000310009         */
    1000410010        return VINF_EM_RAW_EMULATE_INSTR;
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