Re: [ros-dev] [ros-diffs] [jgardou] 50991: [NTOSKRNL] - Print supported CPU features. - Simplify detection of non working but claimed SYSENTER support for intel processors - Workaround a virtualbox "f
Am 07.03.2011 14:33, schrieb jgar...@svn.reactos.org: Author: jgardou Date: Mon Mar 7 13:33:10 2011 New Revision: 50991 ... +Reg[3] |= 0x800; ... +if ((Reg[0]& 0x0FFF3FFF)< 0x0633) I'd prefer symbolic constants over these magic numbers. + +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 Can we make this more compact please? Like "Supported CPU features: V86_VIS, RDTSC ..." Thanks, Timo ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 50991: [NTOSKRNL] - Print supported CPU features. - Simplify detection of non working but claimed SYSENTER support for intel processors - Workaround a virtualbox "f
The result: (ntoskrnl\ke\i386\cpu.c:485) Supported CPU features : (ntoskrnl\ke\i386\cpu.c:488) KF_V86_VIS(ntoskrnl\ke\i386\cpu.c:489) KF_RDTSC(ntoskrnl\ke\i386\cpu.c:490) KF_CR4(ntoskrnl\ke\i386\cpu.c:491) KF_CMOV(ntoskrnl\ke\i386\cpu.c:492) KF_GLOBAL_PAGE(ntoskrnl\ke\i386\cpu.c:493) KF_LARGE_PAGE(ntoskrnl\ke\i386\cpu.c:494) KF_MTRR(ntoskrnl\ke\i386\cpu.c:495) KF_CMPXCHG8B(ntoskrnl\ke\i386\cpu.c:496) KF_MMX(ntoskrnl\ke\i386\cpu.c:497) KF_WORKING_PTE(ntoskrnl\ke\i386\cpu.c:498) KF_PAT(ntoskrnl\ke\i386\cpu.c:499) KF_FXSR(ntoskrnl\ke\i386\cpu.c:500) KF_FAST_SYSCALL(ntoskrnl\ke\i386\cpu.c:501) KF_XMMI(ntoskrnl\ke\i386\cpu.c:504) KF_XMMI64(ntoskrnl\ke\i386\cpu.c:506) KF_NX_BIT(ntoskrnl\ke\i386\cpu.c:510) (ntoskrnl\ke\i386\cpu.c:816) Prefetch Cache: 64 bytes L2 Cache: 0 bytes L2 Cache Line: 64 bytes L2 Cache Associativity: 0 is not what i would call compact. Can we have something like: (ntoskrnl\ke\i386\cpu.c:485) Supported CPU features : KF_V86_VIS, KF_RDTSC, KF_CR4. KF_CMOV, KF_GLOBAL_PAGE, KF_LARGE_PAGE, KF_MTRR, KF_CMPXCHG8B, KF_MMX, KF_WORKING_PTE, KF_PAT, KF_FXSR, KF_FAST_SYSCALL, KF_XMMI, KF_XMMI64, KF_NX_BIT instead? Also it seems that L2 cache size detection is broken on my builbot's CPU: (ntoskrnl\ke\i386\cpu.c:816) Prefetch Cache: 64 bytes L2 Cache: 0 bytes L2 Cache Line: 64 bytes L2 Cache Associativity: 0 Regards 2011/3/7 Timo Kreuzer > Am 07.03.2011 14:33, schrieb jgar...@svn.reactos.org: > >> Author: jgardou >> Date: Mon Mar 7 13:33:10 2011 >> New Revision: 50991 >> ... >> +Reg[3] |= 0x800; >> ... >> +if ((Reg[0]& 0x0FFF3FFF)< 0x0633) >> > I'd prefer symbolic constants over these magic numbers. > > + >> +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 >> > Can we make this more compact please? Like "Supported CPU features: > V86_VIS, RDTSC ..." > > Thanks, > Timo > > > ___ > Ros-dev mailing list > Ros-dev@reactos.org > http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 50991: [NTOSKRNL] - Print supported CPU features. - Simplify detection of non working but claimed SYSENTER support for intel processors - Workaround a virtualbox "f
Try DbgPrint or OutputDebugString ;) On Mar 7, 2011 4:09 PM, "Olaf Siejka" wrote: > > The result: > > (ntoskrnl\ke\i386\cpu.c:485) Supported CPU features : > (ntoskrnl\ke\i386\cpu.c:488) KF_V86_VIS(ntoskrnl\ke\i386\cpu.c:489) KF_RDTSC(ntoskrnl\ke\i386\cpu.c:490) KF_CR4(ntoskrnl\ke\i386\cpu.c:491) KF_CMOV(ntoskrnl\ke\i386\cpu.c:492) KF_GLOBAL_PAGE(ntoskrnl\ke\i386\cpu.c:493) KF_LARGE_PAGE(ntoskrnl\ke\i386\cpu.c:494) KF_MTRR(ntoskrnl\ke\i386\cpu.c:495) KF_CMPXCHG8B(ntoskrnl\ke\i386\cpu.c:496) KF_MMX(ntoskrnl\ke\i386\cpu.c:497) KF_WORKING_PTE(ntoskrnl\ke\i386\cpu.c:498) KF_PAT(ntoskrnl\ke\i386\cpu.c:499) KF_FXSR(ntoskrnl\ke\i386\cpu.c:500) KF_FAST_SYSCALL(ntoskrnl\ke\i386\cpu.c:501) KF_XMMI(ntoskrnl\ke\i386\cpu.c:504) KF_XMMI64(ntoskrnl\ke\i386\cpu.c:506) KF_NX_BIT(ntoskrnl\ke\i386\cpu.c:510) > (ntoskrnl\ke\i386\cpu.c:816) Prefetch Cache: 64 bytes L2 Cache: 0 bytes L2 Cache Line: 64 bytes L2 Cache Associativity: 0 > > is not what i would call compact. Can we have something like: > > (ntoskrnl\ke\i386\cpu.c:485) Supported CPU features : KF_V86_VIS, KF_RDTSC, KF_CR4. KF_CMOV, KF_GLOBAL_PAGE, KF_LARGE_PAGE, KF_MTRR, KF_CMPXCHG8B, KF_MMX, KF_WORKING_PTE, KF_PAT, KF_FXSR, KF_FAST_SYSCALL, KF_XMMI, KF_XMMI64, KF_NX_BIT > > instead? > > Also it seems that L2 cache size detection is broken on my builbot's CPU: > (ntoskrnl\ke\i386\cpu.c:816) Prefetch Cache: 64 bytes L2 Cache: 0 bytes L2 Cache Line: 64 bytes L2 Cache Associativity: 0 > > Regards > > 2011/3/7 Timo Kreuzer > >> Am 07.03.2011 14:33, schrieb jgar...@svn.reactos.org: >>> >>> Author: jgardou >>> Date: Mon Mar 7 13:33:10 2011 >>> New Revision: 50991 >>> ... >>> +Reg[3] |= 0x800; >>> ... >>> +if ((Reg[0]& 0x0FFF3FFF)< 0x0633) >> >> I'd prefer symbolic constants over these magic numbers. >> >>> + >>> +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 >> >> Can we make this more compact please? Like "Supported CPU features: V86_VIS, RDTSC ..." >> >> Thanks, >> Timo >> >> >> ___ >> Ros-dev mailing list >> Ros-dev@reactos.org >> http://www.reactos.org/mailman/listinfo/ros-dev > > > > > > ___ > Ros-dev mailing list > Ros-dev@reactos.org > http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 50991: [NTOSKRNL] - Print supported CPU features. - Simplify detection of non working but claimed SYSENTER support for intel processors - Workaround a virtualbox "f
On Mar 7, 2011, at 4:33 PM, jgar...@svn.reactos.org wrote: Author: jgardou /* Check if the CPU is too old to support SYSENTER */ -if ((Prcb->CpuType < 6) || -((Prcb->CpuType == 6) && (Prcb->CpuStep < 0x0303))) +if ((Reg[0] & 0x0FFF3FFF) < 0x0633) { It was intentionally done over CpuType and CpuStep. Now you criptified it back to a raw Reg[0] value and weird hardcoded constant. Could you please 1) elaborate this change and 2) if you still think it's correct, and if you still tihnk(!) Windows does it same way, then rework it to use Prcb->Cpu* instead of these magic values? Not to say adding a hack for VirtualBox is far from being a beautiful, and would need to be *at least* marked so that it's not forgotten. Thanks, Aleksey Bragin. ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev
Re: [ros-dev] [ros-diffs] [jgardou] 50991: [NTOSKRNL] - Print supported CPU features. - Simplify detection of non working but claimed SYSENTER support for intel processors - Workaround a virtualbox "f
Official intel documentation : http://www.intel.com/Assets/PDF/appnote/241618.pdf, page 30. As to know how it's made on windows, well, I hope they follow intel docs ;-) Le 07/03/2011 21:49, Aleksey Bragin a écrit : On Mar 7, 2011, at 4:33 PM, jgar...@svn.reactos.org wrote: Author: jgardou /* Check if the CPU is too old to support SYSENTER */ -if ((Prcb->CpuType < 6) || -((Prcb->CpuType == 6) && (Prcb->CpuStep < 0x0303))) +if ((Reg[0] & 0x0FFF3FFF) < 0x0633) { It was intentionally done over CpuType and CpuStep. Now you criptified it back to a raw Reg[0] value and weird hardcoded constant. Could you please 1) elaborate this change and 2) if you still think it's correct, and if you still tihnk(!) Windows does it same way, then rework it to use Prcb->Cpu* instead of these magic values? Not to say adding a hack for VirtualBox is far from being a beautiful, and would need to be *at least* marked so that it's not forgotten. Thanks, Aleksey Bragin. ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev ___ Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev