VirtualBox

Changeset 71297 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 10, 2018 6:02:02 AM (7 years ago)
Author:
vboxsync
Message:

NEM: Some more 17115 fixes and noted down an issue (possibly not at all new). bugref:9044

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h

    r71296 r71297  
    12621262           || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE
    12631263           || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_EXECUTE);
     1264    AssertMsg(pMsg->Header.InstructionLength < 0x10, ("%#x\n", pMsg->Header.InstructionLength));
    12641265
    12651266    /*
     
    12681269    if (pMsg->Header.ExecutionState.InterruptionPending)
    12691270        pCtx->fExtrn &= ~CPUMCTX_EXTRN_NEM_WIN_MASK;
     1271
     1272#if 0 /* Experiment: 20K -> 34K exit/s. */
     1273    if (   pMsg->Header.ExecutionState.EferLma
     1274        && pMsg->Header.CsSegment.Long
     1275        && pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE)
     1276    {
     1277        if (   pMsg->Header.Rip - (uint64_t)0xf65a < (uint64_t)(0xf662 - 0xf65a)
     1278            && pMsg->InstructionBytes[0] == 0x89
     1279            && pMsg->InstructionBytes[1] == 0x03)
     1280        {
     1281            pCtx->rip    = pMsg->Header.Rip + 2;
     1282            pCtx->fExtrn &= ~CPUMCTX_EXTRN_RIP;
     1283            AssertMsg(pMsg->Header.InstructionLength == 2, ("%#x\n", pMsg->Header.InstructionLength));
     1284            //Log(("%RX64 msg:\n%.80Rhxd\n", pCtx->rip, pMsg));
     1285            return VINF_SUCCESS;
     1286        }
     1287    }
     1288#endif
    12701289
    12711290    /*
     
    13181337# endif
    13191338
     1339    if (pMsg->Reserved1)
     1340        Log(("MemExit/Reserved1=%#x\n", pMsg->Reserved1));
     1341    if (pMsg->Header.ExecutionState.Reserved0 || pMsg->Header.ExecutionState.Reserved1)
     1342        Log(("MemExit/Hdr/State: Reserved0=%#x Reserved1=%#x\n", pMsg->Header.ExecutionState.Reserved0, pMsg->Header.ExecutionState.Reserved1));
     1343    //if (pMsg->InstructionByteCount > 0)
     1344    //    Log4(("InstructionByteCount=%#x %.16Rhxs\n", pMsg->InstructionByteCount, pMsg->InstructionBytes));
     1345
    13201346    if (pMsg->InstructionByteCount > 0)
    13211347        rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(pCtx), pMsg->Header.Rip,
     
    13461372    Assert(   pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_READ
    13471373           || pMsg->Header.InterceptAccessType == HV_INTERCEPT_ACCESS_WRITE);
     1374    AssertMsg(pMsg->Header.InstructionLength < 0x10, ("%#x\n", pMsg->Header.InstructionLength));
    13481375
    13491376    /*
  • trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp

    r71296 r71297  
    101101static decltype(WHvDeleteVirtualProcessor) *        g_pfnWHvDeleteVirtualProcessor;
    102102static decltype(WHvRunVirtualProcessor) *           g_pfnWHvRunVirtualProcessor;
    103 static decltype(WHvGetRunExitContextSize) *         g_pfnWHvGetRunExitContextSize;
    104103static decltype(WHvCancelRunVirtualProcessor) *     g_pfnWHvCancelRunVirtualProcessor;
    105104static decltype(WHvGetVirtualProcessorRegisters) *  g_pfnWHvGetVirtualProcessorRegisters;
     
    153152    NEM_WIN_IMPORT(0, false, WHvRunVirtualProcessor),
    154153    NEM_WIN_IMPORT(0, false, WHvCancelRunVirtualProcessor),
    155     NEM_WIN_IMPORT(0, false, WHvGetRunExitContextSize),
    156154    NEM_WIN_IMPORT(0, false, WHvGetVirtualProcessorRegisters),
    157155    NEM_WIN_IMPORT(0, false, WHvSetVirtualProcessorRegisters),
     
    15351533        if (fExitInstr && pExitReason->IoPortAccess.InstructionByteCount > 0)
    15361534            Log2(("Exit: + Instruction %.*Rhxs\n",
    1537                   pExitReason->IoPortAccess.InstructionByteCount, pExitReason->IoPortAccess.InstructionBytes));
     1535                  pExitReason->IoPortAccess.InstructionByteCount,
     1536                  &pExitReason->IoPortAccess.InstructionBytes[g_uBuildNo >= 17110 ? 3 : 0]));
    15381537    }
    15391538}
     
    16541653    if (pMemCtx->InstructionByteCount > 0)
    16551654        rcStrict = IEMExecOneWithPrefetchedByPC(pVCpu, CPUMCTX2CORE(pCtx), pMemCtx->VpContext.Rip,
    1656                                                 pMemCtx->InstructionBytes, pMemCtx->InstructionByteCount);
     1655                                                &pMemCtx->InstructionBytes[g_uBuildNo >= 17110 ? 3 : 0],
     1656                                                pMemCtx->InstructionByteCount);
    16571657    else
    16581658        rcStrict = IEMExecOne(pVCpu);
     
    16861686         * Simple port I/O.
    16871687         */
    1688         Assert(pCtx->rax == pIoPortCtx->Rax);
     1688        //Assert(pCtx->rax == pIoPortCtx->Rax); - sledgehammer
    16891689
    16901690        static uint32_t const s_fAndMask[8] =
     
    25232523 *
    25242524 *
     2525 * - Wrong instruction length in the VpContext with unmapped GPA memory exit
     2526 *   contexts on 17115/AMD.
     2527 *
     2528 *   One byte "PUSH CS" was reported as 2 bytes, while a two byte
     2529 *   "MOV [EBX],EAX" was reported with a 1 byte instruction length.  Problem
     2530 *   naturally present in untranslated hyper-v messages.
     2531 *
     2532 *
    25252533 * - The I/O port exit context information seems to be missing the address size
    25262534 *   information needed for correct string I/O emulation.
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