From owner-svn-src-all@FreeBSD.ORG Tue Apr 7 19:31:38 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 0E60C1065707; Tue, 7 Apr 2009 19:31:37 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4B2A8FC08; Tue, 7 Apr 2009 19:31:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37JVaBP023275; Tue, 7 Apr 2009 19:31:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37JVai9023274; Tue, 7 Apr 2009 19:31:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904071931.n37JVai9023274@svn.freebsd.org> From: Ed Schouten Date: Tue, 7 Apr 2009 19:31:36 +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: r190817 - head/sys/amd64/include 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: Tue, 07 Apr 2009 19:32:03 -0000 Author: ed Date: Tue Apr 7 19:31:36 2009 New Revision: 190817 URL: http://svn.freebsd.org/changeset/base/190817 Log: Don't explicitly force ecx to be used for MSR_FSBASE/MSR_GSBASE. Because the "c" input constaint is used, the compiler will already place the MSR_FSBASE/MSR_GSBASE constants in ecx. Using __asm("ecx") makes LLVM crash. Even though this is also an LLVM bug, we'd better remove the unnecessary GCCism as well. Submitted by: Christoph Mallon Modified: head/sys/amd64/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Tue Apr 7 19:18:02 2009 (r190816) +++ head/sys/amd64/include/cpufunc.h Tue Apr 7 19:31:36 2009 (r190817) @@ -535,12 +535,9 @@ cpu_mwait(int extensions, int hints) static __inline void load_fs(u_int sel) { - register u_int32_t fsbase __asm("ecx"); - /* Preserve the fsbase value across the selector load */ - fsbase = MSR_FSBASE; - __asm __volatile("rdmsr; mov %0,%%fs; wrmsr" - : : "rm" (sel), "c" (fsbase) : "eax", "edx"); + __asm __volatile("rdmsr; mov %0,%%fs; wrmsr" + : : "rm" (sel), "c" (MSR_FSBASE) : "eax", "edx"); } #ifndef MSR_GSBASE @@ -549,16 +546,13 @@ load_fs(u_int sel) static __inline void load_gs(u_int sel) { - register u_int32_t gsbase __asm("ecx"); - /* * Preserve the gsbase value across the selector load. * Note that we have to disable interrupts because the gsbase * being trashed happens to be the kernel gsbase at the time. */ - gsbase = MSR_GSBASE; - __asm __volatile("pushfq; cli; rdmsr; mov %0,%%gs; wrmsr; popfq" - : : "rm" (sel), "c" (gsbase) : "eax", "edx"); + __asm __volatile("pushfq; cli; rdmsr; mov %0,%%gs; wrmsr; popfq" + : : "rm" (sel), "c" (MSR_GSBASE) : "eax", "edx"); } #else /* Usable by userland */