From owner-svn-src-all@FreeBSD.ORG Thu Oct 1 12:52:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E216106568D; Thu, 1 Oct 2009 12:52:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EEF28FC1F; Thu, 1 Oct 2009 12:52:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n91CqmkH051602; Thu, 1 Oct 2009 12:52:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n91Cqmlb051599; Thu, 1 Oct 2009 12:52:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910011252.n91Cqmlb051599@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 1 Oct 2009 12:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197663 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Oct 2009 12:52:49 -0000 Author: kib Date: Thu Oct 1 12:52:48 2009 New Revision: 197663 URL: http://svn.freebsd.org/changeset/base/197663 Log: 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 Modified: head/sys/amd64/amd64/initcpu.c head/sys/i386/i386/initcpu.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Thu Oct 1 12:50:26 2009 (r197662) +++ head/sys/amd64/amd64/initcpu.c Thu Oct 1 12:52:48 2009 (r197663) @@ -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; } Modified: head/sys/i386/i386/initcpu.c ============================================================================== --- head/sys/i386/i386/initcpu.c Thu Oct 1 12:50:26 2009 (r197662) +++ head/sys/i386/i386/initcpu.c Thu Oct 1 12:52:48 2009 (r197663) @@ -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) /*