From acd7f5a3da6b85bf5865ddd20456fd0c5061c8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Mon, 7 Mar 2011 13:33:10 +0000 Subject: [PATCH] [NTOSKRNL] - Print supported CPU features. - Simplify detection of non working but claimed SYSENTER support for intel processors - Workaround a virtualbox "feature" : claim that SYSENTER isn't supported despite the fact that it is. Fix hang on registration of mshtml.dll in 2nd stage when using Virtualbox. svn path=/trunk/; revision=50991 --- reactos/ntoskrnl/ke/i386/cpu.c | 36 ++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/ke/i386/cpu.c b/reactos/ntoskrnl/ke/i386/cpu.c index 2606297c1b4..4b56a2b9f26 100644 --- a/reactos/ntoskrnl/ke/i386/cpu.c +++ b/reactos/ntoskrnl/ke/i386/cpu.c @@ -303,10 +303,16 @@ KiGetFeatureBits(VOID) /* Remove support for correct PTE support. */ FeatureBits &= ~KF_WORKING_PTE; } + + /* Virtualbox claims to have no SYSENTER support, + * which is false for processors >= Pentium Pro */ + if(Prcb->CpuType >= 6) + { + Reg[3] |= 0x800; + } /* Check if the CPU is too old to support SYSENTER */ - if ((Prcb->CpuType < 6) || - ((Prcb->CpuType == 6) && (Prcb->CpuStep < 0x0303))) + if ((Reg[0] & 0x0FFF3FFF) < 0x00000633) { /* Disable it */ Reg[3] &= ~0x800; @@ -474,6 +480,32 @@ KiGetFeatureBits(VOID) } } } + + DPRINT1("Supported CPU features :\n"); +#define print_supported(kf_value) \ + if(FeatureBits & kf_value) DPRINT1("\t" #kf_value "\n") + print_supported(KF_V86_VIS); + print_supported(KF_RDTSC); + print_supported(KF_CR4); + print_supported(KF_CMOV); + print_supported(KF_GLOBAL_PAGE); + print_supported(KF_LARGE_PAGE); + print_supported(KF_MTRR); + print_supported(KF_CMPXCHG8B); + print_supported(KF_MMX); + print_supported(KF_WORKING_PTE); + print_supported(KF_PAT); + print_supported(KF_FXSR); + print_supported(KF_FAST_SYSCALL); + print_supported(KF_XMMI); + print_supported(KF_3DNOW); + print_supported(KF_AMDK6MTRR); + print_supported(KF_XMMI64); + print_supported(KF_DTS); + print_supported(KF_NX_BIT); + print_supported(KF_NX_DISABLED); + print_supported(KF_NX_ENABLED); +#undef print_supported /* Return the Feature Bits */ return FeatureBits;