VirtualBox

Changeset 50918 in vbox


Ignore:
Timestamp:
Mar 28, 2014 2:37:18 PM (11 years ago)
Author:
vboxsync
Message:

VMM/HM: Fix some selector limit checks, comments.

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

Legend:

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

    r50880 r50918  
    29552955     * is effectively what the CPU does for "scaling by 8". TI is always 0 and RPL should be too in most cases.
    29562956     */
    2957     if ((uSelTR & X86_SEL_MASK) > Gdtr.cbGdt)
     2957    if ((uSelTR | X86_SEL_RPL_LDT) > Gdtr.cbGdt)
    29582958    {
    29592959        AssertMsgFailed(("hmR0VmxSaveHostSegmentRegs: TR selector exceeds limit. TR=%RTsel cbGdt=%#x\n", uSelTR, Gdtr.cbGdt));
     
    70437043            hmR0VmxSetIntWindowExitVmcs(pVCpu);
    70447044    }
     7045    /*
     7046     * Check if the guest can receive external interrupts (PIC/APIC). Once we do PDMGetInterrupt() we -must- deliver
     7047     * the interrupt ASAP. We must not execute any guest code until we inject the interrupt.
     7048     */
    70457049    else if (   VMCPU_FF_IS_PENDING(pVCpu, (VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC))
    70467050             && !pVCpu->hm.s.fSingleInstruction)
    70477051    {
    7048         /*
    7049          * Check if the guest can receive external interrupts (PIC/APIC). Once we do PDMGetInterrupt() we -must- deliver
    7050          * the interrupt ASAP. We must not execute any guest code until we inject the interrupt which is why it is
    7051          * evaluated here and not set as pending, solely based on the force-flags.
    7052          */
    70537052        int rc = hmR0VmxSaveGuestRflags(pVCpu, pMixedCtx);
    70547053        AssertRC(rc);
     
    76267625    rc = VMXWriteVmcs32(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, 0);
    76277626    AssertRC(rc);
     7627
     7628    /* We deliberately don't clear "hm.s.Event.fPending" here, it's taken
     7629       care of in hmR0VmxExitToRing3() converting the pending event to TRPM. */
    76287630}
    76297631
     
    81218123        return VINF_EM_RAW_TO_R3;
    81228124    }
     8125
    81238126    if (RTThreadPreemptIsPending(NIL_RTTHREAD))
    81248127    {
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r50713 r50918  
    25232523                if (pCtx->gdtr.cbGdt)
    25242524                {
    2525                     if (pCtx->tr.Sel > pCtx->gdtr.cbGdt)
     2525                    if ((pCtx->tr.Sel | X86_SEL_RPL_LDT) > pCtx->gdtr.cbGdt)
    25262526                    {
    25272527                        STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadTr);
    25282528                        return false;
    25292529                    }
    2530                     else if (pCtx->ldtr.Sel > pCtx->gdtr.cbGdt)
     2530                    else if ((pCtx->ldtr.Sel | X86_SEL_RPL_LDT) > pCtx->gdtr.cbGdt)
    25312531                    {
    25322532                        STAM_COUNTER_INC(&pVCpu->hm.s.StatVmxCheckBadLdt);
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