From owner-svn-src-stable@FreeBSD.ORG Sat Dec 19 19:45:38 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0571106566C; Sat, 19 Dec 2009 19:45:38 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-yw0-f172.google.com (mail-yw0-f172.google.com [209.85.211.172]) by mx1.freebsd.org (Postfix) with ESMTP id 589B68FC08; Sat, 19 Dec 2009 19:45:38 +0000 (UTC) Received: by ywh2 with SMTP id 2so4335406ywh.27 for ; Sat, 19 Dec 2009 11:45:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=YnrnxULD8yz78veS24l/aUmPYuGRJ774A/q5sv2X6gU=; b=LUp7WFracw6Y5fTk6npP8XK72SXzoyovf6w/X4tplkmzbXQGPotSQbjGK71ik17SXb 75x+J+0ShS0MRgt+zLMxMng5gq+FpEu2x0zGszWZhKEoapytjjdacWl5XS1QYeLrlAIm jbKOs61wjNKFsdalniHuD//pagAdKyJIG/Yd4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=BXiiiOjeWjRB1VyM9keZxxTQHrkYJFHIPAEw5omsyyZ7556WeaRzpr/s+q5hrlTIc9 zn81U9rRDY2VIElY9qAzGOaH1zGi4qQhi0RCUVlT1fDib8UTQx/iiLuTs1WjfJewUSSk ryDDLZpxMYfdlkhrWkXln7IgoWS7NeJecVutI= Received: by 10.151.1.4 with SMTP id d4mr544107ybi.265.1261250405928; Sat, 19 Dec 2009 11:20:05 -0800 (PST) Received: from dimension.5p.local (ppp-21.26.dialinfree.com [209.172.21.26]) by mx.google.com with ESMTPS id 4sm1535525ywi.57.2009.12.19.11.19.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 19 Dec 2009 11:20:04 -0800 (PST) Sender: "J. Hellenthal" Date: Sat, 19 Dec 2009 14:19:41 -0500 From: jhell To: Andriy Gapon In-Reply-To: <200912191045.nBJAjvfc030388@svn.freebsd.org> Message-ID: References: <200912191045.nBJAjvfc030388@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r200714 - in stable/7/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Dec 2009 19:45:39 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 19 Dec 2009 05:45, avg@ wrote: > Author: avg > Date: Sat Dec 19 10:45:57 2009 > New Revision: 200714 > URL: http://svn.freebsd.org/changeset/base/200714 > > Log: > MFC r200064: mca: small enhancements related to cpu quirks > > Modified: > stable/7/sys/amd64/amd64/mca.c > stable/7/sys/i386/i386/mca.c > Directory Properties: > stable/7/sys/ (props changed) > stable/7/sys/cddl/contrib/opensolaris/ (props changed) > stable/7/sys/contrib/dev/acpica/ (props changed) > stable/7/sys/contrib/pf/ (props changed) > > Modified: stable/7/sys/amd64/amd64/mca.c > ============================================================================== > --- stable/7/sys/amd64/amd64/mca.c Sat Dec 19 10:44:26 2009 (r200713) > +++ stable/7/sys/amd64/amd64/mca.c Sat Dec 19 10:45:57 2009 (r200714) > @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -478,6 +479,8 @@ void > mca_init(void) > { > uint64_t mcg_cap; > + uint64_t ctl; > + int skip; > int i; > > /* MCE is required. */ > @@ -495,15 +498,26 @@ mca_init(void) > wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); > > for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { > - /* > - * Enable logging of all errors. For P6 > - * processors, MC0_CTL is always enabled. > - * > - * XXX: Better CPU test needed here? > - */ > - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) > - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); > + /* By default enable logging of all errors. */ > + ctl = 0xffffffffffffffffUL; > + skip = 0; > + > + if (cpu_vendor_id == CPU_VENDOR_INTEL) { > + /* > + * For P6 models before Nehalem MC0_CTL is > + * always enabled and reserved. > + */ > + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 > + && CPUID_TO_MODEL(cpu_id) < 0x1a) > + skip = 1; > + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { > + /* BKDG for Family 10h: unset GartTblWkEn. */ > + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) > + ctl &= ~(1UL << 10); > + } > > + if (!skip) > + wrmsr(MSR_MC_CTL(i), ctl); > /* Clear all errors. */ > wrmsr(MSR_MC_STATUS(i), 0); > } > > Modified: stable/7/sys/i386/i386/mca.c > ============================================================================== > --- stable/7/sys/i386/i386/mca.c Sat Dec 19 10:44:26 2009 (r200713) > +++ stable/7/sys/i386/i386/mca.c Sat Dec 19 10:45:57 2009 (r200714) > @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -478,6 +479,8 @@ void > mca_init(void) > { > uint64_t mcg_cap; > + uint64_t ctl; > + int skip; > int i; > > /* MCE is required. */ > @@ -495,15 +498,26 @@ mca_init(void) > wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE); > > for (i = 0; i < (mcg_cap & MCG_CAP_COUNT); i++) { > - /* > - * Enable logging of all errors. For P6 > - * processors, MC0_CTL is always enabled. > - * > - * XXX: Better CPU test needed here? > - */ > - if (!(i == 0 && (cpu_id & 0xf00) == 0x600)) > - wrmsr(MSR_MC_CTL(i), 0xffffffffffffffffUL); > + /* By default enable logging of all errors. */ > + ctl = 0xffffffffffffffffUL; > + skip = 0; > + > + if (cpu_vendor_id == CPU_VENDOR_INTEL) { > + /* > + * For P6 models before Nehalem MC0_CTL is > + * always enabled and reserved. > + */ > + if (i == 0 && CPUID_TO_FAMILY(cpu_id) == 0x6 > + && CPUID_TO_MODEL(cpu_id) < 0x1a) > + skip = 1; > + } else if (cpu_vendor_id == CPU_VENDOR_AMD) { > + /* BKDG for Family 10h: unset GartTblWkEn. */ > + if (i == 4 && CPUID_TO_FAMILY(cpu_id) >= 0xf) > + ctl &= ~(1UL << 10); > + } > > + if (!skip) > + wrmsr(MSR_MC_CTL(i), ctl); > /* Clear all errors. */ > wrmsr(MSR_MC_STATUS(i), 0); > } > [FYI] Following errors are being generated on stable/7 i386 "Intel" based machine. If more information is needed, let me know. cc1: warnings being treated as errors /usr/src/sys/i386/i386/mca.c: In function 'mca_init': /usr/src/sys/i386/i386/mca.c:510: warning: implicit declaration of function 'CPUID_TO_FAMILY' /usr/src/sys/i386/i386/mca.c:510: warning: nested extern declaration of 'CPUID_TO_FAMILY' /usr/src/sys/i386/i386/mca.c:511: warning: implicit declaration of function 'CPUID_TO_MODEL' /usr/src/sys/i386/i386/mca.c:511: warning: nested extern declaration of 'CPUID_TO_MODEL' *** Error code 1 - -- Sat Dec 19 14:16:11 2009 -0500 jhell -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJLLSdZAAoJEJBXh4mJ2FR++e0H/iWCMNkzAjXOhQUUf24+eiJw 5rC/XcLCOCP8FAeu1LzJ2mnsGswPKnnnQaaT4i8K4g4kZyvaYFOszq8XOSsK4M2G bXWUTN7An6LLtct7tkDj+cOE7icjeTRCXBRhegnBG0IloXNxqbdxd8l/VNbXepGk gJPSSZHBGJ48GC6Um/sXP+XC/3tDSL9UdhCcRAJzBmZxpK1GnNJZbYREeBJo6Ywg uEjDJ29bqEMqwGIykh8CB+9u7CPZ70UcDPfQN4lz/YaWaYXGKMlzCYalbXZNVVUB AmS9PiTUBZ6gJpri0vtykePcWjiY0nESoV+9keNleADCVYzMnT9Hj/dwOiYg25o= =zift -----END PGP SIGNATURE-----