summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2010-08-02 17:01:23 +0000
committerjhb <jhb@FreeBSD.org>2010-08-02 17:01:23 +0000
commitc6eb2c5ec7d96a646b6c4835ff209a178481f669 (patch)
tree5d75737cf66c58d8a7638e8350c82d7278adc1dc /sys/amd64
parentec28b7bf63c9ab049a292f7f3895fe1ffa976f88 (diff)
downloadFreeBSD-src-c6eb2c5ec7d96a646b6c4835ff209a178481f669.zip
FreeBSD-src-c6eb2c5ec7d96a646b6c4835ff209a178481f669.tar.gz
Tweak the logic to disable CLFLUSH in virtual environments to work around
problems with flushing the local APIC register range so that it checks vm_guest directly. Reviewed by: kib, alc MFC after: 2 weeks
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/initcpu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c
index c97ad3d..923b28c 100644
--- a/sys/amd64/amd64/initcpu.c
+++ b/sys/amd64/amd64/initcpu.c
@@ -177,17 +177,17 @@ initializecpucache()
if ((cpu_feature & CPUID_CLFSH) != 0)
cpu_clflush_line_size = ((cpu_procinfo >> 8) & 0xff) * 8;
/*
- * XXXKIB: (temporary) hack to work around traps generated when
- * CLFLUSHing APIC registers window.
+ * XXXKIB: (temporary) hack to work around traps generated
+ * when CLFLUSHing APIC register window under virtualization
+ * environments. These environments tend to disable the
+ * CPUID_SS feature even though the native CPU supports it.
*/
TUNABLE_INT_FETCH("hw.clflush_disable", &hw_clflush_disable);
- if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS) &&
- hw_clflush_disable == -1)
+ if (vm_guest != VM_GUEST_NO && hw_clflush_disable == -1)
cpu_feature &= ~CPUID_CLFSH;
/*
* Allow to disable CLFLUSH feature manually by
- * hw.clflush_disable tunable. This may help Xen guest on some AMD
- * CPUs.
+ * hw.clflush_disable tunable.
*/
if (hw_clflush_disable == 1)
cpu_feature &= ~CPUID_CLFSH;
OpenPOWER on IntegriCloud