Changeset 106988 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Nov 13, 2024 3:01:58 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/NEMR3Native-win-armv8.cpp
r106983 r106988 1860 1860 ); 1861 1861 char szInstr[256]; RT_ZERO(szInstr); 1862 #if 01863 1862 DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0, 1864 1863 DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE, 1865 1864 szInstr, sizeof(szInstr), NULL); 1866 #endif1867 1865 Log3(("%s%s\n", szRegs, szInstr)); 1868 1866 } … … 2359 2357 nemR3WinSetGReg(pVCpu, ARMV8_AARCH64_REG_X0, false /*f64BitReg*/, false /*fSignExtend*/, (uint64_t)ARM_PSCI_STS_NOT_SUPPORTED); 2360 2358 2359 /** @todo What to do if immediate is != 0? */ 2360 2361 if ( rcStrict == VINF_SUCCESS 2362 && fAdvancePc) 2363 pVCpu->cpum.GstCtx.Pc.u64 += sizeof(uint32_t); 2361 2364 2362 2365 return rcStrict; … … 2470 2473 #endif 2471 2474 2472 if (RT_UNLIKELY(!pVCpu->nem.s.fIdRegsSynced))2473 {2474 /*2475 * Sync the guest ID registers which are per VM once (they are readonly and stay constant during VM lifetime).2476 * Need to do it here and not during the init because loading a saved state might change the ID registers from what2477 * done in the call to CPUMR3PopulateFeaturesByIdRegisters().2478 */2479 PCCPUMIDREGS pIdRegsGst = NULL;2480 int rc = CPUMR3QueryGuestIdRegs(pVM, &pIdRegsGst);2481 AssertRCReturn(rc, rc);2482 2483 WHV_REGISTER_NAME aenmNames[12];2484 WHV_REGISTER_VALUE aValues[12];2485 2486 uint32_t iReg = 0;2487 #define ADD_REG64(a_enmName, a_uValue) do { \2488 aenmNames[iReg] = (a_enmName); \2489 aValues[iReg].Reg128.High64 = 0; \2490 aValues[iReg].Reg64 = (a_uValue); \2491 iReg++; \2492 } while (0)2493 2494 2495 ADD_REG64(WHvArm64RegisterIdAa64Mmfr0El1, pIdRegsGst->u64RegIdAa64Mmfr0El1);2496 #undef ADD_REG642497 2498 //HRESULT hrc = WHvSetVirtualProcessorRegisters(pVM->nem.s.hPartition, pVCpu->idCpu, aenmNames, iReg, aValues);2499 //AssertReturn(SUCCEEDED(hrc), VERR_NEM_IPE_9);2500 2501 pVCpu->nem.s.fIdRegsSynced = true;2502 }2503 2504 2475 /* 2505 2476 * Try switch to NEM runloop state. … … 2521 2492 */ 2522 2493 const bool fSingleStepping = DBGFIsStepping(pVCpu); 2523 // const uint32_t fCheckVmFFs = !fSingleStepping ? VM_FF_HP_R0_PRE_HM_MASK2524 // : VM_FF_HP_R0_PRE_HM_STEP_MASK;2525 // const uint32_t fCheckCpuFFs = !fSingleStepping ? VMCPU_FF_HP_R0_PRE_HM_MASK : VMCPU_FF_HP_R0_PRE_HM_STEP_MASK;2526 2494 VBOXSTRICTRC rcStrict = VINF_SUCCESS; 2527 2495 for (unsigned iLoop = 0;; iLoop++) 2528 2496 { 2529 /*2530 * Pending interrupts or such? Need to check and deal with this prior2531 * to the state syncing.2532 */2533 #if 02534 if (VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_INTERRUPT_FIQ | VMCPU_FF_UPDATE_IRQ))2535 {2536 /* Try inject interrupt. */2537 rcStrict = nemHCWinHandleInterruptFF(pVM, pVCpu, &pVCpu->nem.s.fDesiredInterruptWindows);2538 if (rcStrict == VINF_SUCCESS)2539 { /* likely */ }2540 else2541 {2542 LogFlow(("NEM/%u: breaking: nemHCWinHandleInterruptFF -> %Rrc\n", pVCpu->idCpu, VBOXSTRICTRC_VAL(rcStrict) ));2543 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatBreakOnStatus);2544 break;2545 }2546 }2547 #endif2548 2549 2497 /* Ensure that Hyper-V has the whole state. */ 2550 2498 int rc2 = nemHCWinCopyStateToHyperV(pVM, pVCpu); … … 2567 2515 if (VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC_NEM_WAIT, VMCPUSTATE_STARTED_EXEC_NEM)) 2568 2516 { 2569 #if 0 //def LOG_ENABLED2517 #ifdef LOG_ENABLED 2570 2518 if (LogIsFlowEnabled()) 2571 2519 { 2572 static const WHV_REGISTER_NAME s_aNames[6] = { WHvX64RegisterCs, WHvX64RegisterRip, WHvX64RegisterRflags, 2573 WHvX64RegisterSs, WHvX64RegisterRsp, WHvX64RegisterCr0 }; 2574 WHV_REGISTER_VALUE aRegs[RT_ELEMENTS(s_aNames)] = { {{0, 0} } }; 2520 static const WHV_REGISTER_NAME s_aNames[2] = { WHvArm64RegisterPc, WHvArm64RegisterPstate }; 2521 WHV_REGISTER_VALUE aRegs[RT_ELEMENTS(s_aNames)] = { { { {0, 0} } } }; 2575 2522 WHvGetVirtualProcessorRegisters(pVM->nem.s.hPartition, pVCpu->idCpu, s_aNames, RT_ELEMENTS(s_aNames), aRegs); 2576 LogFlow(("NEM/%u: Entry @ %04x:%08RX64 IF=%d EFL=%#RX64 SS:RSP=%04x:%08RX64 cr0=%RX64\n", 2577 pVCpu->idCpu, aRegs[0].Segment.Selector, aRegs[1].Reg64, RT_BOOL(aRegs[2].Reg64 & X86_EFL_IF), 2578 aRegs[2].Reg64, aRegs[3].Segment.Selector, aRegs[4].Reg64, aRegs[5].Reg64)); 2523 LogFlow(("NEM/%u: Entry @ %08RX64 pstate=%#RX64\n", pVCpu->idCpu, aRegs[0].Reg64, aRegs[1].Reg64)); 2579 2524 } 2580 2525 #endif 2526 2581 2527 MY_WHV_RUN_VP_EXIT_CONTEXT ExitReason = {0}; 2582 2528 TMNotifyStartOfExecution(pVM, pVCpu); … … 2587 2533 TMNotifyEndOfExecution(pVM, pVCpu, ASMReadTSC()); 2588 2534 #ifdef LOG_ENABLED 2589 LogFlow(("NEM/%u: Exit @ @todo Reason=%#x\n", pVCpu->idCpu, ExitReason.ExitReason)); 2535 if (LogIsFlowEnabled()) 2536 { 2537 static const WHV_REGISTER_NAME s_aNames[2] = { WHvArm64RegisterPc, WHvArm64RegisterPstate }; 2538 WHV_REGISTER_VALUE aRegs[RT_ELEMENTS(s_aNames)] = { { { {0, 0} } } }; 2539 WHvGetVirtualProcessorRegisters(pVM->nem.s.hPartition, pVCpu->idCpu, s_aNames, RT_ELEMENTS(s_aNames), aRegs); 2540 LogFlow(("NEM/%u: Exit @ %08RX64 pstate=%#RX64 Reason=%#x\n", 2541 pVCpu->idCpu, aRegs[0].Reg64, aRegs[1].Reg64, ExitReason.ExitReason)); 2542 } 2590 2543 #endif 2591 2544 if (SUCCEEDED(hrc)) … … 2599 2552 else 2600 2553 { 2601 LogFlow(("NEM/%u: breaking: nem HCWinHandleMessage-> %Rrc\n", pVCpu->idCpu, VBOXSTRICTRC_VAL(rcStrict) ));2554 LogFlow(("NEM/%u: breaking: nemR3WinHandleExit -> %Rrc\n", pVCpu->idCpu, VBOXSTRICTRC_VAL(rcStrict) )); 2602 2555 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatBreakOnStatus); 2603 2556 break; … … 2701 2654 #endif 2702 2655 2703 #if 0 2704 LogFlow(("NEM/%u: %04x:%08RX64 efl=%#08RX64 => %Rrc\n", pVCpu->idCpu, pVCpu->cpum.GstCtx.cs.Sel, 2705 pVCpu->cpum.GstCtx.rip, pVCpu->cpum.GstCtx.rflags.u, VBOXSTRICTRC_VAL(rcStrict) )); 2706 #endif 2656 LogFlow(("NEM/%u: %08RX64 pstate=%#08RX64 => %Rrc\n", pVCpu->idCpu, pVCpu->cpum.GstCtx.Pc.u64, 2657 pVCpu->cpum.GstCtx.fPState, VBOXSTRICTRC_VAL(rcStrict) )); 2707 2658 return rcStrict; 2708 2659 }
Note:
See TracChangeset
for help on using the changeset viewer.