Changeset 107863 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jan 20, 2025 10:01:18 PM (3 months ago)
- svn:sync-xref-src-repo-rev:
- 167066
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp
r107862 r107863 47 47 #endif 48 48 #ifndef _WIN32_WINNT_WIN10_RS1 /* Missing define, causing trouble for us. */ 49 # define _WIN32_WINNT_WIN10_RS1 (_WIN32_WINNT_WIN10 + 1)49 # define _WIN32_WINNT_WIN10_RS1 (_WIN32_WINNT_WIN10 + 1) 50 50 #endif 51 51 #include <sysinfoapi.h> … … 95 95 /** VID I/O control detection: Fake timeout input. */ 96 96 #define NEM_WIN_IOCTL_DETECTOR_FAKE_TIMEOUT UINT32_C(0x00080286) 97 98 99 #ifndef NTDDI_WIN10_RS4 /* We use this to support older SDKs. */ 100 # define NTDDI_WIN10_RS4 (NTDDI_WIN10 + 5) /* 17134 */ 101 #endif 102 #ifndef NTDDI_WIN10_RS5 /* We use this to support older SDKs. */ 103 # define NTDDI_WIN10_RS5 (NTDDI_WIN10 + 6) /* ????? */ 104 #endif 105 #ifndef NTDDI_WIN10_19H1 /* We use this to support older SDKs. */ 106 # define NTDDI_WIN10_19H1 (NTDDI_WIN10 + 7) /* 18362 */ 107 #endif 108 #ifndef NTDDI_WIN10_VB 109 # define NTDDI_WIN10_VB (NTDDI_WIN10 + 8) /* 19040 */ 110 #endif 111 #ifndef NTDDI_WIN10_MN 112 # define NTDDI_WIN10_MN (NTDDI_WIN10 + 9) /* ????? */ 113 #endif 114 #ifndef NTDDI_WIN10_FE 115 # define NTDDI_WIN10_FE (NTDDI_WIN10 + 10) /* ????? */ 116 #endif 117 #ifndef NTDDI_WIN10_CO 118 # define NTDDI_WIN10_CO (NTDDI_WIN10 + 11) /* 22000 */ 119 #endif 120 #ifndef NTDDI_WIN10_NI 121 # define NTDDI_WIN10_NI (NTDDI_WIN10 + 12) /* 22621 */ 122 #endif 123 #ifndef NTDDI_WIN10_CU 124 # define NTDDI_WIN10_CU (NTDDI_WIN10 + 13) /* ????? */ 125 #endif 126 #ifndef NTDDI_WIN10_ZN 127 # define NTDDI_WIN10_ZN (NTDDI_WIN10 + 14) /* ????? */ 128 #endif 129 #ifndef NTDDI_WIN10_GA 130 # define NTDDI_WIN10_GA (NTDDI_WIN10 + 15) /* ????? */ 131 #endif 132 #ifndef NTDDI_WIN10_GE 133 # define NTDDI_WIN10_GE (NTDDI_WIN10 + 16) /* 26100 */ 134 #endif 135 136 #define MY_NTDDI_WIN10_17134 NTDDI_WIN10_RS4 137 #define MY_NTDDI_WIN10_18362 NTDDI_WIN10_19H1 138 #define MY_NTDDI_WIN10_19040 NTDDI_WIN10_VB 139 #define MY_NTDDI_WIN11_22000 NTDDI_WIN10_CO 140 #define MY_NTDDI_WIN11_22621 NTDDI_WIN10_NI 141 #define MY_NTDDI_WIN11_26100 NTDDI_WIN10_GE 97 142 98 143 … … 634 679 hrc, RTNtLastStatusValue(), RTNtLastErrorValue()); 635 680 NEM_LOG_REL_CAP_EX("WHvCapabilityCodeExtendedVmExits", "%'#018RX64", Caps.ExtendedVmExits.AsUINT64); 681 #define NEM_LOG_REL_CAP_VM_EXIT(a_Field) NEM_LOG_REL_CAP_SUB(#a_Field, Caps.ExtendedVmExits.a_Field) 682 NEM_LOG_REL_CAP_VM_EXIT(X64CpuidExit); 683 NEM_LOG_REL_CAP_VM_EXIT(X64MsrExit); 684 NEM_LOG_REL_CAP_VM_EXIT(ExceptionExit); 685 #if WDK_NTDDI_VERSION >= MY_NTDDI_WIN10_19040 686 NEM_LOG_REL_CAP_VM_EXIT(X64RdtscExit); 687 NEM_LOG_REL_CAP_VM_EXIT(X64ApicSmiExitTrap); 688 NEM_LOG_REL_CAP_VM_EXIT(HypercallExit); 689 NEM_LOG_REL_CAP_VM_EXIT(X64ApicInitSipiExitTrap); 690 #endif 691 #if WDK_NTDDI_VERSION >= MY_NTDDI_WIN11_22000 /** @todo Could some of these may have been added earlier... */ 692 NEM_LOG_REL_CAP_VM_EXIT(X64ApicWriteLint0ExitTrap); 693 NEM_LOG_REL_CAP_VM_EXIT(X64ApicWriteLint1ExitTrap); 694 NEM_LOG_REL_CAP_VM_EXIT(X64ApicWriteSvrExitTrap); 695 NEM_LOG_REL_CAP_VM_EXIT(UnknownSynicConnection); 696 NEM_LOG_REL_CAP_VM_EXIT(RetargetUnknownVpciDevice); 697 NEM_LOG_REL_CAP_VM_EXIT(X64ApicWriteLdrExitTrap); 698 NEM_LOG_REL_CAP_VM_EXIT(X64ApicWriteDfrExitTrap); 699 NEM_LOG_REL_CAP_VM_EXIT(GpaAccessFaultExit); 700 #endif 701 #undef NEM_LOG_REL_CAP_VM_EXIT 702 uint64_t const fKnownVmExits = RT_BIT_64(15) - 1U; 703 if (Caps.ExtendedVmExits.AsUINT64 & ~fKnownVmExits) 704 NEM_LOG_REL_CAP_SUB_EX("Unknown VM exit defs", "%#RX64", Caps.ExtendedVmExits.AsUINT64 & ~fKnownVmExits); 636 705 pVM->nem.s.fExtendedMsrExit = RT_BOOL(Caps.ExtendedVmExits.X64MsrExit); 637 706 pVM->nem.s.fExtendedCpuIdExit = RT_BOOL(Caps.ExtendedVmExits.X64CpuidExit); 638 707 pVM->nem.s.fExtendedXcptExit = RT_BOOL(Caps.ExtendedVmExits.ExceptionExit); 639 NEM_LOG_REL_CAP_SUB("fExtendedMsrExit", pVM->nem.s.fExtendedMsrExit);640 NEM_LOG_REL_CAP_SUB("fExtendedCpuIdExit", pVM->nem.s.fExtendedCpuIdExit);641 NEM_LOG_REL_CAP_SUB("fExtendedXcptExit", pVM->nem.s.fExtendedXcptExit);642 if (Caps.ExtendedVmExits.AsUINT64 & ~(uint64_t)7)643 LogRel(("NEM: Warning! Unknown VM exit definitions: %#RX64\n", Caps.ExtendedVmExits.AsUINT64));644 708 /** @todo RECHECK: WHV_EXTENDED_VM_EXITS typedef. */ 645 709 … … 654 718 hrc, RTNtLastStatusValue(), RTNtLastErrorValue()); 655 719 NEM_LOG_REL_CAP_EX("WHvCapabilityCodeFeatures", "%'#018RX64", Caps.Features.AsUINT64); 656 pVM->nem.s.fSpeculationControl = RT_BOOL(Caps.Features.SpeculationControl); 720 #define NEM_LOG_REL_CAP_FEATURE(a_Field) NEM_LOG_REL_CAP_SUB(#a_Field, Caps.Features.a_Field) 721 #if WDK_NTDDI_VERSION >= MY_NTDDI_WIN10_18362 722 NEM_LOG_REL_CAP_FEATURE(PartialUnmap); 723 NEM_LOG_REL_CAP_FEATURE(LocalApicEmulation); 724 NEM_LOG_REL_CAP_FEATURE(Xsave); 725 NEM_LOG_REL_CAP_FEATURE(DirtyPageTracking); 726 NEM_LOG_REL_CAP_FEATURE(SpeculationControl); 727 #endif 728 #if WDK_NTDDI_VERSION >= MY_NTDDI_WIN10_19040 729 NEM_LOG_REL_CAP_FEATURE(ApicRemoteRead); 730 NEM_LOG_REL_CAP_FEATURE(IdleSuspend); 731 #endif 732 #if WDK_NTDDI_VERSION >= MY_NTDDI_WIN11_22000 /** @todo Could some of these may have been added earlier... */ 733 NEM_LOG_REL_CAP_FEATURE(VirtualPciDeviceSupport); 734 NEM_LOG_REL_CAP_FEATURE(IommuSupport); 735 NEM_LOG_REL_CAP_FEATURE(VpHotAddRemove); 736 #endif 737 #undef NEM_LOG_REL_CAP_FEATURE 657 738 const uint64_t fKnownFeatures = RT_BIT_64(10) - 1U; 658 739 if (Caps.Features.AsUINT64 & ~fKnownFeatures) 659 LogRel(("NEM: Warning! Unknown feature definitions: %#RX64\n", Caps.Features.AsUINT64 & ~fKnownFeatures)); 740 NEM_LOG_REL_CAP_SUB_EX("Unknown features", "%#RX64", Caps.ExtendedVmExits.AsUINT64 & ~fKnownVmExits); 741 pVM->nem.s.fSpeculationControl = RT_BOOL(Caps.Features.SpeculationControl); 660 742 /** @todo RECHECK: WHV_CAPABILITY_FEATURES typedef. */ 661 743 … … 735 817 NEM_LOG_REL_CPU_FEATURE(Bmi1Support); 736 818 NEM_LOG_REL_CPU_FEATURE(Bmi2Support); 737 /* two reserved bits here, see below */819 NEM_LOG_REL_CPU_FEATURE(Reserved1); 738 820 NEM_LOG_REL_CPU_FEATURE(MovbeSupport); 739 821 NEM_LOG_REL_CPU_FEATURE(Npiep1Support); … … 750 832 NEM_LOG_REL_CPU_FEATURE(ShaSupport); 751 833 NEM_LOG_REL_CPU_FEATURE(X87PointersSavedSupport); 834 #if WDK_NTDDI_VERSION >= MY_NTDDI_WIN10_17134 /** @todo maybe some of these were added earlier... */ 835 NEM_LOG_REL_CPU_FEATURE(InvpcidSupport); 836 NEM_LOG_REL_CPU_FEATURE(IbrsSupport); 837 NEM_LOG_REL_CPU_FEATURE(StibpSupport); 838 NEM_LOG_REL_CPU_FEATURE(IbpbSupport); 839 NEM_LOG_REL_CPU_FEATURE(Reserved2); 840 NEM_LOG_REL_CPU_FEATURE(SsbdSupport); 841 NEM_LOG_REL_CPU_FEATURE(FastShortRepMovSupport); 842 NEM_LOG_REL_CPU_FEATURE(Reserved3); 843 NEM_LOG_REL_CPU_FEATURE(RdclNo); 844 NEM_LOG_REL_CPU_FEATURE(IbrsAllSupport); 845 NEM_LOG_REL_CPU_FEATURE(Reserved4); 846 NEM_LOG_REL_CPU_FEATURE(SsbNo); 847 NEM_LOG_REL_CPU_FEATURE(RsbANo); 848 #endif 849 #if WDK_NTDDI_VERSION >= MY_NTDDI_WIN10_19040 850 NEM_LOG_REL_CPU_FEATURE(Reserved5); 851 NEM_LOG_REL_CPU_FEATURE(RdPidSupport); 852 NEM_LOG_REL_CPU_FEATURE(UmipSupport); 853 NEM_LOG_REL_CPU_FEATURE(MdsNoSupport); 854 NEM_LOG_REL_CPU_FEATURE(MdClearSupport); 855 #endif 856 #if WDK_NTDDI_VERSION >= MY_NTDDI_WIN11_22000 857 NEM_LOG_REL_CPU_FEATURE(TaaNoSupport); 858 NEM_LOG_REL_CPU_FEATURE(TsxCtrlSupport); 859 NEM_LOG_REL_CPU_FEATURE(Reserved6); 860 #endif 752 861 #undef NEM_LOG_REL_CPU_FEATURE 753 if (Caps.ProcessorFeatures.AsUINT64 & (~(RT_BIT_64(43) - 1) | RT_BIT_64(27) | RT_BIT_64(28)))754 LogRel(("NEM: Warning! Unknown CPU features: %#RX64\n", Caps.ProcessorFeatures.AsUINT64));755 862 pVM->nem.s.uCpuFeatures.u64 = Caps.ProcessorFeatures.AsUINT64; 756 863 /** @todo RECHECK: WHV_PROCESSOR_FEATURES typedef. */
Note:
See TracChangeset
for help on using the changeset viewer.