Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48387 Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/ntdll/tests/virtual.c | 14 +++++++++++++- dlls/ntdll/thread.c | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 31eb66c143..683a5e7bdf 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -25,6 +25,7 @@ #include "windef.h" #include "winternl.h" #include "wine/test.h" +#include "ddk/wdm.h"
static unsigned int page_size;
@@ -33,6 +34,8 @@ static NTSTATUS (WINAPI *pRtlFreeUserStack)(void *); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); static const BOOL is_win64 = sizeof(void*) != sizeof(int);
+static SYSTEM_BASIC_INFORMATION sbi; + static HANDLE create_target_process(const char *arg) { char **argv; @@ -513,9 +516,17 @@ static void test_NtMapViewOfSection(void) CloseHandle(process); }
+static void test_user_shared_data(void) +{ + const KSHARED_USER_DATA *user_shared_data = (void *)0x7ffe0000; + + ok(user_shared_data->NumberOfPhysicalPages == sbi.MmNumberOfPhysicalPages, + "Got number of physical pages %#x, expected %#x.\n", + user_shared_data->NumberOfPhysicalPages, sbi.MmNumberOfPhysicalPages); +} + START_TEST(virtual) { - SYSTEM_BASIC_INFORMATION sbi; HMODULE mod;
int argc; @@ -546,4 +557,5 @@ START_TEST(virtual) test_NtAllocateVirtualMemory(); test_RtlCreateUserStack(); test_NtMapViewOfSection(); + test_user_shared_data(); } diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index f993dd314c..9c9e5f6055 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -222,6 +222,7 @@ static void set_process_name( int argc, char *argv[] ) */ TEB *thread_init(void) { + SYSTEM_BASIC_INFORMATION sbi; TEB *teb; void *addr; SIZE_T size; @@ -310,6 +311,9 @@ TEB *thread_init(void) user_shared_data->TickCountMultiplier = 1 << 24; fill_cpu_info();
+ virtual_get_system_info( &sbi ); + user_shared_data->NumberOfPhysicalPages = sbi.MmNumberOfPhysicalPages; + return teb; }
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48386 Signed-off-by: Paul Gofman gofmanp@gmail.com --- dlls/ntdll/nt.c | 2 ++ dlls/ntdll/tests/virtual.c | 5 +++++ 2 files changed, 7 insertions(+)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index bc40d4e276..b89602cee8 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -1122,6 +1122,7 @@ static inline void get_cpuinfo(SYSTEM_CPU_INFORMATION* info) user_shared_data->ProcessorFeatures[PF_VIRT_FIRMWARE_ENABLED] = (regs2[2] >> 2) & 1; user_shared_data->ProcessorFeatures[PF_NX_ENABLED] = (regs2[3] >> 20) & 1; user_shared_data->ProcessorFeatures[PF_3DNOW_INSTRUCTIONS_AVAILABLE] = (regs2[3] >> 31) & 1; + user_shared_data->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] = (regs2[3] >> 27) & 1; if (regs2[3] >> 31) info->FeatureSet |= CPU_FEATURE_3DNOW; } } @@ -1143,6 +1144,7 @@ static inline void get_cpuinfo(SYSTEM_CPU_INFORMATION* info) { do_cpuid(0x80000001, regs2); /* get vendor features */ user_shared_data->ProcessorFeatures[PF_NX_ENABLED] = (regs2[3] >> 20) & 1; + user_shared_data->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] = (regs2[3] >> 27) & 1; } } else diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c index 683a5e7bdf..3b0d74daeb 100644 --- a/dlls/ntdll/tests/virtual.c +++ b/dlls/ntdll/tests/virtual.c @@ -523,6 +523,11 @@ static void test_user_shared_data(void) ok(user_shared_data->NumberOfPhysicalPages == sbi.MmNumberOfPhysicalPages, "Got number of physical pages %#x, expected %#x.\n", user_shared_data->NumberOfPhysicalPages, sbi.MmNumberOfPhysicalPages); + +#if defined(__i386__) || defined(__x86_64__) + ok(user_shared_data->ProcessorFeatures[PF_RDTSC_INSTRUCTION_AVAILABLE] /* Supported since Pentium CPUs. */, + "_RDTSC not available.\n"); +#endif }
START_TEST(virtual)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=65128
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=65127
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===