- Timestamp:
- Oct 12, 2018 12:25:41 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpum.mac
r74479 r74798 281 281 .hwvirt.svm.HCPhysVmcb RTHCPHYS_RES 1 282 282 .hwvirt.enmHwvirt resd 1 283 .hwvirt.fGif resb 1 284 alignb 8 283 285 .hwvirt.fLocalForcedActions resd 1 284 .hwvirt.fGif resb 1285 286 alignb 64 286 287 endstruc -
trunk/include/VBox/vmm/cpumctx.h
r74753 r74798 666 666 /** 0x3f0 - Hardware virtualization type currently in use. */ 667 667 CPUMHWVIRT enmHwvirt; 668 /** 0x3f4 - A subset of guest force flags that are saved while running the 668 /** 0x3f4 - Global interrupt flag - AMD only (always true on Intel). */ 669 bool fGif; 670 bool afPadding1[3]; 671 /** 0x3f8 - A subset of guest force flags that are saved while running the 669 672 * nested-guest. */ 670 673 uint32_t fLocalForcedActions; 671 /** 0x3f8 - Global interrupt flag - AMD only (always true on Intel). */ 672 bool fGif; 673 /** 0x3fc - Padding. */ 674 uint8_t abPadding1[7]; 674 uint8_t abPadding[4]; 675 675 } hwvirt; 676 676 /** @} */ … … 775 775 AssertCompileMemberAlignment(CPUMCTX, hwvirt.CPUM_UNION_NM(s.) vmx.pvIoBitmapR0, 8); 776 776 AssertCompileMemberOffset(CPUMCTX, hwvirt.enmHwvirt, 0x3f0); 777 AssertCompileMemberOffset(CPUMCTX, hwvirt.f LocalForcedActions,0x3f4);778 AssertCompileMemberOffset(CPUMCTX, hwvirt.f Gif,0x3f8);777 AssertCompileMemberOffset(CPUMCTX, hwvirt.fGif, 0x3f4); 778 AssertCompileMemberOffset(CPUMCTX, hwvirt.fLocalForcedActions, 0x3f8); 779 779 AssertCompileMembersAtSameOffset(CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw.) rax, CPUMCTX, CPUM_UNION_NM(g.) aGRegs); 780 780 AssertCompileMembersAtSameOffset(CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw.) rax, CPUMCTX, CPUM_UNION_STRUCT_NM(g,qw2.) r0); -
trunk/include/VBox/vmm/vm.h
r74797 r74798 103 103 /** Per CPU forced action. 104 104 * See the VMCPU_FF_* \#defines. Updated atomically. */ 105 #ifdef VMCPU_WITH_64_BIT_FFS 106 uint64_t volatile fLocalForcedActions; 107 #else 105 108 uint32_t volatile fLocalForcedActions; 106 109 uint32_t fForLocalForcedActionsExpansion; 110 #endif 107 111 /** The CPU state. */ 108 112 VMCPUSTATE volatile enmState; … … 675 679 * @sa VMCPU_FF_SET_MASK 676 680 */ 677 #define VMCPU_FF_SET(pVCpu, fFlag) do { \ 681 #ifdef VMCPU_WITH_64_BIT_FFS 682 # define VMCPU_FF_SET(pVCpu, fFlag) do { \ 683 AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \ 684 AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \ 685 ASMAtomicBitSet(&(pVCpu)->fLocalForcedActions, fFlag##_BIT); \ 686 } while (0) 687 #else 688 # define VMCPU_FF_SET(pVCpu, fFlag) do { \ 678 689 AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \ 679 690 AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \ 680 691 ASMAtomicOrU32(&(pVCpu)->fLocalForcedActions, (fFlag)); \ 681 692 } while (0) 693 #endif 682 694 683 695 /** @def VMCPU_FF_SET_MASK … … 688 700 * @sa VMCPU_FF_SET 689 701 */ 690 #define VMCPU_FF_SET_MASK(a_pVCpu, fFlags) \ 702 #ifdef VMCPU_WITH_64_BIT_FFS 703 # if ARCH_BITS > 32 704 # define VMCPU_FF_SET_MASK(a_pVCpu, fFlags) \ 705 do { ASMAtomicOrU64(&a_pVCpu->fLocalForcedActions, (fFlags)); } while (0) 706 # else 707 # define VMCPU_FF_SET_MASK(a_pVCpu, fFlags) do { \ 708 if (!((fFlags) >> 32)) ASMAtomicOrU32((uint32_t volatile *)&a_pVCpu->fLocalForcedActions, (uint32_t)(fFlags)); \ 709 else ASMAtomicOrU64(&a_pVCpu->fLocalForcedActions, (fFlags)); \ 710 } while (0) 711 # endif 712 #else 713 # define VMCPU_FF_SET_MASK(a_pVCpu, fFlags) \ 691 714 do { ASMAtomicOrU32(&a_pVCpu->fLocalForcedActions, (fFlags)); } while (0) 715 #endif 692 716 693 717 /** @def VM_FF_CLEAR … … 709 733 * @param fFlag The flag to clear. 710 734 */ 711 #define VMCPU_FF_CLEAR(pVCpu, fFlag) do { \ 735 #ifdef VMCPU_WITH_64_BIT_FFS 736 # define VMCPU_FF_CLEAR(pVCpu, fFlag) do { \ 737 AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \ 738 AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \ 739 ASMAtomicBitClear(&(pVCpu)->fLocalForcedActions, fFlag##_BIT); \ 740 } while (0) 741 #else 742 # define VMCPU_FF_CLEAR(pVCpu, fFlag) do { \ 712 743 AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \ 713 744 AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \ 714 745 ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlag)); \ 715 746 } while (0) 747 #endif 716 748 717 749 /** @def VMCPU_FF_CLEAR_MASK … … 721 753 * @param fFlags The flags to clear. 722 754 */ 723 #define VMCPU_FF_CLEAR_MASK(pVCpu, fFlags) \ 755 #ifdef VMCPU_WITH_64_BIT_FFS 756 # if ARCH_BITS > 32 757 # define VMCPU_FF_CLEAR_MASK(pVCpu, fFlags) \ 758 do { ASMAtomicAndU64(&(pVCpu)->fLocalForcedActions, ~(fFlags)); } while (0) 759 # else 760 # define VMCPU_FF_CLEAR_MASK(pVCpu, fFlags) do { \ 761 if (!((fFlags) >> 32)) ASMAtomicAndU32((uint32_t volatile *)&(pVCpu)->fLocalForcedActions, ~(uint32_t)(fFlags)); \ 762 else ASMAtomicAndU64(&(pVCpu)->fLocalForcedActions, ~(fFlags)); \ 763 } while (0) 764 # endif 765 #else 766 # define VMCPU_FF_CLEAR_MASK(pVCpu, fFlags) \ 724 767 do { ASMAtomicAndU32(&(pVCpu)->fLocalForcedActions, ~(fFlags)); } while (0) 768 #endif 725 769 726 770 /** @def VM_FF_IS_SET … … 732 776 */ 733 777 #if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA) 734 # define VM_FF_IS_SET(pVM, fFlag) (((pVM)->fGlobalForcedActions & (fFlag)) ==(fFlag))778 # define VM_FF_IS_SET(pVM, fFlag) RT_BOOL((pVM)->fGlobalForcedActions & (fFlag)) 735 779 #else 736 780 # define VM_FF_IS_SET(pVM, fFlag) \ … … 739 783 AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \ 740 784 AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \ 741 return (a_pVM->fGlobalForcedActions & (fFlag)) == (fFlag); \785 return RT_BOOL(a_pVM->fGlobalForcedActions & (fFlag)); \ 742 786 }(pVM)) 743 787 #endif … … 751 795 */ 752 796 #if !defined(VBOX_STRICT) || !defined(RT_COMPILER_SUPPORTS_LAMBDA) 753 # define VMCPU_FF_IS_SET(pVCpu, fFlag) (((pVCpu)->fLocalForcedActions & (fFlag)) ==(fFlag))797 # define VMCPU_FF_IS_SET(pVCpu, fFlag) RT_BOOL((pVCpu)->fLocalForcedActions & (fFlag)) 754 798 #else 755 799 # define VMCPU_FF_IS_SET(pVCpu, fFlag) \ … … 758 802 AssertCompile(RT_IS_POWER_OF_TWO(fFlag)); \ 759 803 AssertCompile((fFlag) == RT_BIT_32(fFlag##_BIT)); \ 760 return (a_pVCpu->fLocalForcedActions & (fFlag)) == (fFlag); \804 return RT_BOOL(a_pVCpu->fLocalForcedActions & (fFlag)); \ 761 805 }(pVCpu)) 762 806 #endif -
trunk/src/VBox/VMM/VBoxVMM.d
r71222 r74798 30 30 /*^^VMM-ALT-TP: "%04x:%08llx rc=%d", (a_pCtx)->cs, (a_pCtx)->rip, (a_rc) */ 31 31 32 probe em__ff__high(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint 32_t a_fLocal, int a_rc);32 probe em__ff__high(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint64_t a_fLocal, int a_rc); 33 33 /*^^VMM-ALT-TP: "vm=%#x cpu=%#x rc=%d", (a_fGlobal), (a_fLocal), (a_rc) */ 34 34 35 probe em__ff__all(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint 32_t a_fLocal, int a_rc);35 probe em__ff__all(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint64_t a_fLocal, int a_rc); 36 36 /*^^VMM-ALT-TP: "vm=%#x cpu=%#x rc=%d", (a_fGlobal), (a_fLocal), (a_rc) */ 37 37 … … 39 39 /*^^VMM-ALT-TP: "%d", (a_rc) */ 40 40 41 probe em__ff__raw(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint 32_t a_fLocal);41 probe em__ff__raw(struct VMCPU *a_pVCpu, uint32_t a_fGlobal, uint64_t a_fLocal); 42 42 /*^^VMM-ALT-TP: "vm=%#x cpu=%#x", (a_fGlobal), (a_fLocal) */ 43 43 -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r74791 r74798 14337 14337 if (RT_LIKELY(pVCpu->iem.s.rcPassUp == VINF_SUCCESS)) 14338 14338 { 14339 uint 32_t fCpu = pVCpu->fLocalForcedActions14339 uint64_t fCpu = pVCpu->fLocalForcedActions 14340 14340 & ( VMCPU_FF_ALL_MASK & ~( VMCPU_FF_PGM_SYNC_CR3 14341 14341 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL … … 14499 14499 if (RT_LIKELY(pVCpu->iem.s.rcPassUp == VINF_SUCCESS)) 14500 14500 { 14501 uint 32_t fCpu = pVCpu->fLocalForcedActions14501 uint64_t fCpu = pVCpu->fLocalForcedActions 14502 14502 & ( VMCPU_FF_ALL_MASK & ~( VMCPU_FF_PGM_SYNC_CR3 14503 14503 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplStrInstr.cpp.h
r74791 r74798 89 89 else \ 90 90 { \ 91 LogFlow(("%s: Leaving early (outer)! ffcpu=%# xffvm=%#x\n", \92 __FUNCTION__, ( a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \91 LogFlow(("%s: Leaving early (outer)! ffcpu=%#RX64 ffvm=%#x\n", \ 92 __FUNCTION__, (uint64_t)(a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \ 93 93 return VINF_SUCCESS; \ 94 94 } \ … … 104 104 else \ 105 105 { \ 106 LogFlow(("%s: Leaving early (outer)! ffcpu=%# xffvm=%#x\n", \107 __FUNCTION__, ( a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \106 LogFlow(("%s: Leaving early (outer)! ffcpu=%#RX64 ffvm=%#x\n", \ 107 __FUNCTION__, (uint64_t)(a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \ 108 108 return VINF_SUCCESS; \ 109 109 } \ … … 124 124 else \ 125 125 { \ 126 LogFlow(("%s: Leaving early (inner)! ffcpu=%# xffvm=%#x\n", \127 __FUNCTION__, ( a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \126 LogFlow(("%s: Leaving early (inner)! ffcpu=%#RX64 ffvm=%#x\n", \ 127 __FUNCTION__, (uint64_t)(a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \ 128 128 return VINF_SUCCESS; \ 129 129 } \ … … 144 144 else \ 145 145 { \ 146 LogFlow(("%s: Leaving early (inner)! ffcpu=%# x(ffvm=%#x)\n", \147 __FUNCTION__, ( a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \146 LogFlow(("%s: Leaving early (inner)! ffcpu=%#RX64 (ffvm=%#x)\n", \ 147 __FUNCTION__, (uint64_t)(a_pVCpu)->fLocalForcedActions, (a_pVM)->fGlobalForcedActions)); \ 148 148 return VINF_SUCCESS; \ 149 149 } \ -
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r74791 r74798 4309 4309 /** @todo Try handle pending flags, not just return to EM loops. Take care 4310 4310 * not to set important RCs here unless we've handled a message. */ 4311 LogFlow(("NEM/%u: breaking: pending FF (%#x / %# x)\n",4312 pVCpu->idCpu, pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions));4311 LogFlow(("NEM/%u: breaking: pending FF (%#x / %#RX64)\n", 4312 pVCpu->idCpu, pVM->fGlobalForcedActions, (uint64_t)pVCpu->fLocalForcedActions)); 4313 4313 STAM_REL_COUNTER_INC(&pVCpu->nem.s.StatBreakOnFFPost); 4314 4314 } -
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r74791 r74798 3236 3236 /* Please, no longjumps here (any logging shouldn't flush jump back to ring-3). NO LOGGING BEFORE THIS POINT! */ 3237 3237 VMMRZCallRing3Disable(pVCpu); 3238 Log4Func(("rcExit=%d LocalFF=%#RX 32 GlobalFF=%#RX32\n", rcExit,pVCpu->fLocalForcedActions,3238 Log4Func(("rcExit=%d LocalFF=%#RX64 GlobalFF=%#RX32\n", rcExit, (uint64_t)pVCpu->fLocalForcedActions, 3239 3239 pVCpu->CTX_SUFF(pVM)->fGlobalForcedActions)); 3240 3240 -
trunk/src/VBox/VMM/VMMR3/EMR3Nem.cpp
r74795 r74798 309 309 if (VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL)) 310 310 { 311 Log(("NEM: TODO: Make VMCPU_FF_PGM_SYNC_CR3 / VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL quiet! (%# x)\n",pVCpu->fLocalForcedActions));311 Log(("NEM: TODO: Make VMCPU_FF_PGM_SYNC_CR3 / VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL quiet! (%#RX64)\n", (uint64_t)pVCpu->fLocalForcedActions)); 312 312 VMCPU_FF_CLEAR_MASK(pVCpu, VMCPU_FF_PGM_SYNC_CR3 | VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL); 313 313 } -
trunk/src/VBox/VMM/VMMR3/VMEmt.cpp
r74791 r74798 1112 1112 || VMCPU_FF_IS_ANY_SET(pVCpu, fMask)) 1113 1113 { 1114 LogFlow(("VMR3WaitHalted: returns VINF_SUCCESS (FF %#x FFCPU %# x)\n", pVM->fGlobalForcedActions,pVCpu->fLocalForcedActions));1114 LogFlow(("VMR3WaitHalted: returns VINF_SUCCESS (FF %#x FFCPU %#RX64)\n", pVM->fGlobalForcedActions, (uint64_t)pVCpu->fLocalForcedActions)); 1115 1115 return VINF_SUCCESS; 1116 1116 } -
trunk/src/VBox/VMM/VMMR3/VMM.cpp
r74790 r74798 3103 3103 for (VMCPUID i = 0; i < pVM->cCpus; i++) 3104 3104 { 3105 const uint 32_t fLocalForcedActions = pVM->aCpus[i].fLocalForcedActions;3106 pHlp->pfnPrintf(pHlp, "CPU %u FFs: %#RX 32", i, fLocalForcedActions);3105 const uint64_t fLocalForcedActions = pVM->aCpus[i].fLocalForcedActions; 3106 pHlp->pfnPrintf(pHlp, "CPU %u FFs: %#RX64", i, fLocalForcedActions); 3107 3107 3108 3108 /* show the flag mnemonics */ … … 3139 3139 #endif 3140 3140 if (f) 3141 pHlp->pfnPrintf(pHlp, "%s\n Unknown bits: %#RX 32\n", c ? "," : "", f);3141 pHlp->pfnPrintf(pHlp, "%s\n Unknown bits: %#RX64\n", c ? "," : "", f); 3142 3142 else 3143 3143 pHlp->pfnPrintf(pHlp, "\n"); -
trunk/src/VBox/VMM/include/CPUMInternal.mac
r74479 r74798 254 254 .Guest.hwvirt.svm.HCPhysVmcb RTHCPHYS_RES 1 255 255 .Guest.hwvirt.enmHwvirt resd 1 256 .Guest.hwvirt.fGif resb 1 257 alignb 8 256 258 .Guest.hwvirt.fLocalForcedActions resd 1 257 .Guest.hwvirt.fGif resb 1258 259 alignb 64 259 260 … … 542 543 .Hyper.hwvirt.svm.HCPhysVmcb RTHCPHYS_RES 1 543 544 .Hyper.hwvirt.enmHwvirt resd 1 545 .Hyper.hwvirt.fGif resb 1 546 alignb 8 544 547 .Hyper.hwvirt.fLocalForcedActions resd 1 545 .Hyper.hwvirt.fGif resb 1546 548 alignb 64 547 549 -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r74542 r74798 169 169 GEN_CHECK_OFF(CPUMCTX, hwvirt.vmx.pvMsrBitmapR3); 170 170 GEN_CHECK_OFF(CPUMCTX, hwvirt.enmHwvirt); 171 GEN_CHECK_OFF(CPUMCTX, hwvirt.fGif); 171 172 GEN_CHECK_OFF(CPUMCTX, hwvirt.fLocalForcedActions); 172 GEN_CHECK_OFF(CPUMCTX, hwvirt.fGif);173 173 /** @todo NSTVMX: add rest of hwvirt fields when code is more 174 174 * finalized. */ -
trunk/src/recompiler/VBoxRecompiler.c
r74791 r74798 1166 1166 && !VMCPU_FF_IS_ANY_SET(pVCpu, VMCPU_FF_ALL_REM_MASK)) 1167 1167 continue; 1168 RTLogPrintf("remR3RunLoggingStep: rc=VINF_SUCCESS w/ FFs (%#x/%# x)\n",1169 pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions);1168 RTLogPrintf("remR3RunLoggingStep: rc=VINF_SUCCESS w/ FFs (%#x/%#RX64)\n", 1169 pVM->fGlobalForcedActions, (uint64_t)pVCpu->fLocalForcedActions); 1170 1170 rc = VINF_SUCCESS; 1171 1171 break; … … 1200 1200 continue; 1201 1201 1202 RTLogPrintf("remR3RunLoggingStep: rc=VINF_SUCCESS w/ FFs (%#x/%# x)\n",1203 pVM->fGlobalForcedActions, pVCpu->fLocalForcedActions);1202 RTLogPrintf("remR3RunLoggingStep: rc=VINF_SUCCESS w/ FFs (%#x/%#RX64)\n", 1203 pVM->fGlobalForcedActions, (uint64_t)pVCpu->fLocalForcedActions); 1204 1204 rc = VINF_SUCCESS; 1205 1205 }
Note:
See TracChangeset
for help on using the changeset viewer.