VirtualBox

Changeset 19985 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
May 25, 2009 9:21:58 AM (16 years ago)
Author:
vboxsync
Message:

Some APIC access updates (disabled)

File:
1 edited

Legend:

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

    r19957 r19985  
    29082908        LogFlow(("EPT Page fault %x at %RGp error code %x\n", (uint32_t)exitQualification, GCPhys, errCode));
    29092909
     2910        /* Shortcut for APIC TPR reads and writes. */
     2911        if ((GCPhys & 0xfff) == 0x080)
     2912        {
     2913            RTGCPHYS GCPhysApicBase;
     2914            PDMApicGetBase(pVM, &GCPhysApicBase);
     2915            if (GCPhys == GCPhysApicBase + 0x80)
     2916            {
     2917                DISCPUSTATE Cpu;
     2918                uint32_t    cbOp;
     2919                Cpu.mode = SELMGetCpuModeFromSelector(pVM, pCtx->eflags, pCtx->cs, &pCtx->csHid);
     2920
     2921                rc = EMInterpretDisasOne(pVM, pVCpu, CPUMCTX2CORE(pCtx), &Cpu, &cbOp);
     2922                if (    rc == VINF_SUCCESS
     2923                    &&  Cpu.pCurInstr->opcode == OP_MOV)
     2924                {
     2925                    if (    (errCode & X86_TRAP_PF_RW)
     2926                        &&  (Cpu.param2.flags == USE_REG_GEN32))
     2927                    {
     2928                        uint32_t val;
     2929
     2930                        DISFetchReg32(CPUMCTX2CORE(pCtx), Cpu.param2.base.reg_gen, &val);
     2931
     2932                        rc = PDMApicSetTPR(pVM, val >> 4);
     2933                        goto ResumeExecution;
     2934                    }
     2935                    else
     2936                    if (Cpu.param1.flags == USE_REG_GEN32)
     2937                    {
     2938                        uint8_t u8TPR;
     2939                        bool    fPending;
     2940
     2941                        rc = PDMApicGetTPR(pVM, &u8TPR, &fPending);
     2942                        AssertRC(rc);
     2943                       
     2944                        DISWriteReg32(CPUMCTX2CORE(pCtx), Cpu.param1.base.reg_gen, u8TPR << 4);
     2945                        goto ResumeExecution;
     2946                    }
     2947                }
     2948            }
     2949        }
     2950
    29102951        /* GCPhys contains the guest physical address of the page fault. */
    29112952        TRPMAssertTrap(pVCpu, X86_XCPT_PF, TRPM_TRAP);
     
    33643405        goto ResumeExecution;
    33653406
     3407    case VMX_EXIT_APIC_ACCESS:          /* 44 APIC access. Guest software attempted to access memory at a physical address on the APIC-access page. */
     3408    {
     3409        LogFlow(("VMX_EXIT_APIC_ACCESS\n"));
     3410
     3411        switch(VMX_EXIT_QUALIFICATION_APIC_ACCESS_TYPE(exitQualification))
     3412        {
     3413        case VMX_APIC_ACCESS_TYPE_LINEAR_READ:
     3414        case VMX_APIC_ACCESS_TYPE_LINEAR_WRITE:
     3415        {
     3416            RTGCPHYS GCPhys;
     3417            PDMApicGetBase(pVM, &GCPhys);
     3418            GCPhys += VMX_EXIT_QUALIFICATION_APIC_ACCESS_OFFSET(exitQualification);
     3419            rc = VINF_EM_RAW_EMULATE_INSTR;
     3420            break;
     3421        }
     3422
     3423        default:
     3424            rc = VINF_EM_RAW_EMULATE_INSTR;
     3425            break;
     3426        }
     3427        break;
     3428    }
     3429
    33663430    case VMX_EXIT_PREEMPTION_TIMER:     /* 52 VMX-preemption timer expired. The preemption timer counted down to zero. */
    33673431        goto ResumeExecution;
     
    34773541
    34783542    case VMX_EXIT_TPR:                  /* 43 TPR below threshold. Guest software executed MOV to CR8. */
     3543    case VMX_EXIT_APIC_ACCESS:          /* 44 APIC access. Guest software attempted to access memory at a physical address on the APIC-access page. */
    34793544    case VMX_EXIT_RDMSR:                /* 31 RDMSR. Guest software attempted to execute RDMSR. */
    34803545    case VMX_EXIT_WRMSR:                /* 32 WRMSR. Guest software attempted to execute WRMSR. */
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