From owner-svn-src-head@FreeBSD.ORG Wed Sep 10 15:59:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0136486; Wed, 10 Sep 2014 15:59:07 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 832D61713; Wed, 10 Sep 2014 15:59:07 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 694ECB9B9; Wed, 10 Sep 2014 11:59:06 -0400 (EDT) From: John Baldwin To: Konstantin Belousov Subject: Re: svn commit: r270850 - in head/sys: i386/i386 i386/include i386/isa x86/acpica Date: Wed, 10 Sep 2014 10:41 -0400 Message-ID: <21371080.holR7l8cnU@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <20140909085813.GC2737@kib.kiev.ua> References: <201408301748.s7UHmc6H059701@svn.freebsd.org> <1432043.pIBGVXe1sj@ralph.baldwin.cx> <20140909085813.GC2737@kib.kiev.ua> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 10 Sep 2014 11:59:06 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Sep 2014 15:59:07 -0000 On Tuesday, September 09, 2014 11:58:13 AM Konstantin Belousov wrote: > On Sat, Sep 06, 2014 at 04:04:49PM -0400, John Baldwin wrote: > > @@ -692,6 +706,27 @@ > > > > #ifdef I586_CPU > > > > case CPU_586: > > switch (cpu_vendor_id) { > > > > + case CPU_VENDOR_AMD: > > +#ifdef CPU_WT_ALLOC > > + if (((cpu_id & 0x0f0) > 0) && > > + ((cpu_id & 0x0f0) < 0x60) && > > + ((cpu_id & 0x00f) > 3)) > > + enable_K5_wt_alloc(); > > + else if (((cpu_id & 0x0f0) > 0x80) || > > + (((cpu_id & 0x0f0) == 0x80) && > > + (cpu_id & 0x00f) > 0x07)) > > + enable_K6_2_wt_alloc(); > > + else if ((cpu_id & 0x0f0) > 0x50) > > + enable_K6_wt_alloc(); > > +#endif > > + if ((cpu_id & 0xf0) == 0xa0) > > + /* > > + * Make sure the TSC runs through > > + * suspension, otherwise we can't use > > + * it as timecounter > > + */ > > + wrmsr(0x1900, rdmsr(0x1900) | 0x20ULL); > > + break; > > Move of the code to initialize CPU from identcpu() to initializecpu() > seems to be a fix on its own. Since you are moving the fragments > around, would you mind start using CPUID_MODEL/STEPPING etc constants ? > The code was ancient, probably predating the defines. I will probably split this up into a couple of commits one of which will be to move register setting from identcpu.c to initcpu.c. I can look at using the constants, but in particular when using CPUID_TO_*() the logic is slightly different (e.g. you have to check for model and family values for '6' instead of '60' or '600'), so I would prefer to do those changes as a separate commit to help with debugging in the future if I get one wrong. > > --- //depot/vendor/freebsd/src/sys/i386/xen/mp_machdep.c > > +++ //depot/user/jhb/acpipci/i386/xen/mp_machdep.c > > @@ -602,17 +602,8 @@ > > > > npxinit(); > > > > #if 0 > > > > - /* set up SSE registers */ > > - enable_sse(); > > -#endif > > -#if 0 && defined(PAE) > > - /* Enable the PTE no-execute bit. */ > > - if ((amd_feature & AMDID_NX) != 0) { > > - uint64_t msr; > > - > > - msr = rdmsr(MSR_EFER) | EFER_NXE; > > - wrmsr(MSR_EFER, msr); > > - } > > + /* set up SSE/NX registers */ > > I suggest removing 'registers' from the comment above. Ok. Note that this is just a copy of the code in amd64/i386, but I will fix all three. -- John Baldwin