VirtualBox

Changeset 14945 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 3, 2008 2:14:27 PM (16 years ago)
Author:
vboxsync
Message:

Manual disassembly of ins/outs. Take two.

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

Legend:

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

    r14943 r14945  
    18411841        if (IoExitInfo.n.u1STR)
    18421842        {
    1843             uint32_t cbSize;
    1844 
    18451843            /* ins/outs */
    1846             if (IoExitInfo.n.u1Type == 0)
     1844            DISCPUSTATE Cpu;
     1845
     1846            /* Disassemble manually to deal with segment prefixes. */
     1847            rc = EMInterpretDisasOne(pVM, CPUMCTX2CORE(pCtx), &Cpu, NULL);
     1848            if (rc == VINF_SUCCESS)
    18471849            {
    1848                 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitIOStringWrite);
    1849                 Log2(("IOMInterpretOUTSEx %RGv %x size=%d\n", (RTGCPTR)pCtx->rip, IoExitInfo.n.u16Port, uIOSize));
     1850                if (IoExitInfo.n.u1Type == 0)
     1851                {
     1852                    Log2(("IOMInterpretOUTSEx %RGv %x size=%d\n", (RTGCPTR)pCtx->rip, IoExitInfo.n.u16Port, uIOSize));
     1853                    STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitIOStringWrite);
     1854                    rc = IOMInterpretOUTSEx(pVM, CPUMCTX2CORE(pCtx), IoExitInfo.n.u16Port, Cpu.prefix, uIOSize);
     1855                }
     1856                else
     1857                {
     1858                    Log2(("IOMInterpretINSEx  %RGv %x size=%d\n", (RTGCPTR)pCtx->rip, IoExitInfo.n.u16Port, uIOSize));
     1859                    STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitIOStringRead);
     1860                    rc = IOMInterpretINSEx(pVM, CPUMCTX2CORE(pCtx), IoExitInfo.n.u16Port, Cpu.prefix, uIOSize);
     1861                }
    18501862            }
    18511863            else
    1852             {
    1853                 Log2(("IOMInterpretINSEx  %RGv %x size=%d\n", (RTGCPTR)pCtx->rip, IoExitInfo.n.u16Port, uIOSize));
    1854                 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitIOStringRead);
    1855             }
    1856 
    1857             /* Disassemble manually, because we don't have any information about segment prefixes. */
    1858             rc = EMInterpretInstruction(pVM, CPUMCTX2CORE(pCtx), 0, &cbSize);
     1864                rc = VINF_EM_RAW_EMULATE_INSTR;
    18591865        }
    18601866        else
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r14943 r14945  
    27712771        }
    27722772
     2773        uint32_t cbSize = g_aIOSize[uIOWidth];
     2774
    27732775        if (VMX_EXIT_QUALIFICATION_IO_STRING(exitQualification))
    27742776        {
    2775             uint32_t cbSize;
    2776 
    27772777            /* ins/outs */
    2778             if (fIOWrite)
     2778            DISCPUSTATE Cpu;
     2779
     2780            /* Disassemble manually to deal with segment prefixes. */
     2781            rc = EMInterpretDisasOne(pVM, CPUMCTX2CORE(pCtx), &Cpu, NULL);
     2782            if (rc == VINF_SUCCESS)
    27792783            {
    2780                 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitIOStringWrite);
    2781                 Log2(("IOMInterpretOUTSEx %RGv %x size=%d\n", (RTGCPTR)pCtx->rip, uPort, g_aIOSize[uIOWidth]));
     2784                if (fIOWrite)
     2785                {
     2786                    Log2(("IOMInterpretOUTSEx %RGv %x size=%d\n", (RTGCPTR)pCtx->rip, uPort, cbSize));
     2787                    STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitIOStringWrite);
     2788                    rc = IOMInterpretOUTSEx(pVM, CPUMCTX2CORE(pCtx), uPort, Cpu.prefix, cbSize);
     2789                }
     2790                else
     2791                {
     2792                    Log2(("IOMInterpretINSEx  %RGv %x size=%d\n", (RTGCPTR)pCtx->rip, uPort, cbSize));
     2793                    STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitIOStringRead);
     2794                    rc = IOMInterpretINSEx(pVM, CPUMCTX2CORE(pCtx), uPort, Cpu.prefix, cbSize);
     2795                }
    27822796            }
    27832797            else
    2784             {
    2785                 Log2(("IOMInterpretINSEx  %RGv %x size=%d\n", (RTGCPTR)pCtx->rip, uPort, g_aIOSize[uIOWidth]));
    2786                 STAM_COUNTER_INC(&pVCpu->hwaccm.s.StatExitIOStringRead);
    2787             }
    2788 
    2789             /* Disassemble manually, because we don't have any information about segment prefixes. */
    2790             rc = EMInterpretInstruction(pVM, CPUMCTX2CORE(pCtx), 0, &cbSize);
     2798                rc = VINF_EM_RAW_EMULATE_INSTR;
    27912799        }
    27922800        else
    27932801        {
    27942802            /* normal in/out */
    2795             uint32_t cbSize  = g_aIOSize[uIOWidth];
    27962803            uint32_t uAndVal = g_aIOOpAnd[uIOWidth];
    27972804
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