VirtualBox

儲存庫 vbox 的更動 46415


忽略:
時間撮記:
2013-6-6 下午02:07:35 (11 年 以前)
作者:
vboxsync
訊息:

VMM/HMVMXR0: Fix invalidating EPT-tagged TLB-entries when VPID+EPT is in use.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r46399 r46415  
    11601160     * We cannot flush a page by guest-physical address. invvpid takes only a linear address while invept only flushes
    11611161     * by EPT not individual addresses. We update the force flag here and flush before the next VM-entry in hmR0VmxFlushTLB*().
    1162      * This function might be called in a loop.
     1162     * This function might be called in a loop. This should cause a flush-by-EPT if EPT is in use. See @bugref{6568}.
    11631163     */
    11641164    VMCPU_FF_SET(pVCpu, VMCPU_FF_TLB_FLUSH);
     
    12241224     */
    12251225    bool fNewASID = false;
    1226     if (   pVCpu->hm.s.idLastCpu != pCpu->idCpu
     1226    if (   pVCpu->hm.s.idLastCpu   != pCpu->idCpu
    12271227        || pVCpu->hm.s.cTlbFlushes != pCpu->cTlbFlushes)
    12281228    {
     
    12601260        else
    12611261        {
    1262             if (pVM->hm.s.vmx.msr.vmx_ept_vpid_caps & MSR_IA32_VMX_EPT_VPID_CAP_INVVPID_SINGLE_CONTEXT)
    1263                 hmR0VmxFlushVpid(pVM, pVCpu, VMX_FLUSH_VPID_SINGLE_CONTEXT, 0 /* GCPtr */);
    1264             else
    1265                 hmR0VmxFlushEpt(pVM, pVCpu, pVM->hm.s.vmx.enmFlushEpt);
     1262            /*
     1263             * Changes to the EPT paging structure by VMM requires flushing by EPT as the CPU creates
     1264             * guest-physical (only EPT-tagged) mappings while traversing the EPT tables when EPT is in use.
     1265             * Flushing by VPID will only flush linear (only VPID-tagged) and combined (EPT+VPID tagged) mappings
     1266             * but not guest-physical mappings.
     1267             * See Intel spec. 28.3.2 "Creating and Using Cached Translation Information". See @bugref{6568}.
     1268             */
     1269            hmR0VmxFlushEpt(pVM, pVCpu, pVM->hm.s.vmx.enmFlushEpt);
    12661270        }
    12671271
     
    13381342     * A change in the TLB flush count implies the host CPU is online after a suspend/resume.
    13391343     */
    1340     if (   pVCpu->hm.s.idLastCpu != pCpu->idCpu
     1344    if (   pVCpu->hm.s.idLastCpu   != pCpu->idCpu
    13411345        || pVCpu->hm.s.cTlbFlushes != pCpu->cTlbFlushes)
    13421346    {
     
    14041408     * or the host CPU is online after a suspend/resume, so we cannot reuse the current ASID anymore.
    14051409     */
    1406     if (   pVCpu->hm.s.idLastCpu != pCpu->idCpu
     1410    if (   pVCpu->hm.s.idLastCpu   != pCpu->idCpu
    14071411        || pVCpu->hm.s.cTlbFlushes != pCpu->cTlbFlushes)
    14081412    {
     
    81748178    /* EFER also required for longmode checks in EMInterpretDisasCurrent(), but it's always up-to-date. */
    81758179    AssertRCReturn(rc, rc);
     8180
    81768181    Log4(("CS:RIP=%04x:%#RX64\n", pMixedCtx->cs.Sel, pMixedCtx->rip));
    81778182
     
    81968201        PDISCPUSTATE pDis = &pVCpu->hm.s.DisState;
    81978202        /** @todo for now manually disassemble later optimize by getting the fields from
    8198          *        the VMCS. */
    8199         /** @todo VMX_VMCS_RO_EXIT_GUEST_LINEAR_ADDR contains the flat pointer
     8203         *        the VMCS. VMX_VMCS_RO_EXIT_GUEST_LINEAR_ADDR contains the flat pointer
    82008204         *        operand of the instruction. VMX_VMCS32_RO_EXIT_INSTR_INFO contains
    82018205         *        segment prefix info. */
     
    83478351        {
    83488352            uint32_t uIntType = VMX_IDT_VECTORING_INFO_TYPE(pVmxTransient->uIdtVectoringInfo);
     8353
    83498354            /* Software interrupts and exceptions will be regenerated when the recompiler restarts the instruction. */
    83508355            if (   uIntType != VMX_IDT_VECTORING_INFO_TYPE_SW_INT
     
    83708375                    pVCpu->hm.s.Event.GCPtrFaultAddress = pMixedCtx->cr2;
    83718376                }
     8377
    83728378                Log4(("Pending event on TaskSwitch uIntType=%#x uVector=%#x\n", uIntType, uVector));
    83738379            }
    83748380        }
    83758381    }
     8382
    83768383    /** @todo Emulate task switch someday, currently just going back to ring-3 for
    83778384     *        emulation. */
     
    88648871        {
    88658872            case OP_CLI:
     8873            {
    88668874                pMixedCtx->eflags.Bits.u1IF = 0;
    88678875                pMixedCtx->rip += pDis->cbInstr;
     
    88698877                STAM_COUNTER_INC(&pVCpu->hm.s.StatExitCli);
    88708878                break;
     8879            }
    88718880
    88728881            case OP_STI:
     8882            {
    88738883                pMixedCtx->eflags.Bits.u1IF = 1;
    88748884                pMixedCtx->rip += pDis->cbInstr;
     
    88788888                STAM_COUNTER_INC(&pVCpu->hm.s.StatExitSti);
    88798889                break;
     8890            }
    88808891
    88818892            case OP_HLT:
     8893            {
    88828894                rc = VINF_EM_HALT;
    88838895                pMixedCtx->rip += pDis->cbInstr;
     
    88858897                STAM_COUNTER_INC(&pVCpu->hm.s.StatExitHlt);
    88868898                break;
     8899            }
    88878900
    88888901            case OP_POPF:
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette