Changeset 74798 in vbox for trunk/include/VBox/vmm
- Timestamp:
- Oct 12, 2018 12:25:41 PM (6 years ago)
- Location:
- trunk/include/VBox/vmm
- Files:
-
- 3 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
Note:
See TracChangeset
for help on using the changeset viewer.