diff options
author | nectar <nectar@FreeBSD.org> | 2005-05-13 00:10:56 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2005-05-13 00:10:56 +0000 |
commit | 9ee23cec0308ecdb7139c33a3d6d1f5d7bc62037 (patch) | |
tree | c21ac516608de7df42c7d37a3ed05e5e167a613d /sys/i386/include/cpufunc.h | |
parent | 569f3fdf0dc5ab3c76973022c3437f5e58d415b7 (diff) | |
download | FreeBSD-src-9ee23cec0308ecdb7139c33a3d6d1f5d7bc62037.zip FreeBSD-src-9ee23cec0308ecdb7139c33a3d6d1f5d7bc62037.tar.gz |
Add a knob for disabling/enabling HTT, "machdep.hyperthreading_allowed".
Default off due to information disclosure on multi-user systems.
Submitted by: cperciva
Reviewed by: jhb
Diffstat (limited to 'sys/i386/include/cpufunc.h')
-rw-r--r-- | sys/i386/include/cpufunc.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index ecb84cd..9a646f6 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -93,6 +93,14 @@ do_cpuid(u_int ax, u_int *p) } static __inline void +cpuid_count(u_int ax, u_int cx, u_int *p) +{ + __asm __volatile("cpuid" + : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3]) + : "0" (ax), "c" (cx)); +} + +static __inline void enable_intr(void) { __asm __volatile("sti"); |