summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-10-01 12:52:48 +0000
committerkib <kib@FreeBSD.org>2009-10-01 12:52:48 +0000
commita73674620c7fa1fe443dd9e7532a797292aeb6e1 (patch)
treec218591e92ae38710a10254262320d857ac2092a
parent6f65ac42775d5a36dd9aa0878ca09ef1e6de660e (diff)
downloadFreeBSD-src-a73674620c7fa1fe443dd9e7532a797292aeb6e1.zip
FreeBSD-src-a73674620c7fa1fe443dd9e7532a797292aeb6e1.tar.gz
As a workaround, for Intel CPUs, do not use CLFLUSH in
pmap_invalidate_cache_range() when self-snoop is apparently not reported in cpu features. We get a reserved trap when clflushing APIC registers window. XEN in full system virtualization mode removes self-snoop from CPU features, making this a problem. Tested by: csjp Reviewed by: alc MFC after: 3 days
-rw-r--r--sys/amd64/amd64/initcpu.c6
-rw-r--r--sys/i386/i386/initcpu.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c
index 4376dd0..7aaff82 100644
--- a/sys/amd64/amd64/initcpu.c
+++ b/sys/amd64/amd64/initcpu.c
@@ -165,4 +165,10 @@ initializecpu(void)
*/
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.
+ */
+ if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS))
+ cpu_feature &= ~CPUID_CLFSH;
}
diff --git a/sys/i386/i386/initcpu.c b/sys/i386/i386/initcpu.c
index 1ecff1c..dc8da0b 100644
--- a/sys/i386/i386/initcpu.c
+++ b/sys/i386/i386/initcpu.c
@@ -717,6 +717,12 @@ initializecpu(void)
*/
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.
+ */
+ if (cpu_vendor_id == CPU_VENDOR_INTEL && !(cpu_feature & CPUID_SS))
+ cpu_feature &= ~CPUID_CLFSH;
#if defined(PC98) && !defined(CPU_UPGRADE_HW_CACHE)
/*
OpenPOWER on IntegriCloud