From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934301AbYEGXCw (ORCPT ); Wed, 7 May 2008 19:02:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759389AbYEGXCK (ORCPT ); Wed, 7 May 2008 19:02:10 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.31.123]:41441 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756536AbYEGXCH (ORCPT ); Wed, 7 May 2008 19:02:07 -0400 Date: Thu, 8 May 2008 01:02:54 +0200 From: Pavel Machek To: Yinghai Lu Cc: Thomas Gleixner , Adrian Bunk , Rene Herman , Ingo Molnar , Linux Kernel , hpa@zytor.com, torvalds@linux-foundation.org, akpm@linux-foundation.org Subject: Re: 2.6.26, PAT and AMD family 6 Message-ID: <20080507230254.GL18516@elf.ucw.cz> References: <48210A71.1060409@keyaccess.nl> <86802c440805061939q39ff5500h3c9e229ecbc6b2e6@mail.gmail.com> <20080507124650.GD29935@cs181133002.pp.htv.fi> <20080507212343.GB14951@cs181133002.pp.htv.fi> <20080507221435.GH18516@elf.ucw.cz> <86802c440805071522r424b2011v7c0d852db4c4abfd@mail.gmail.com> <20080507223705.GJ18516@elf.ucw.cz> <86802c440805071540i71f9d0c4y2eaf97e170ee538e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86802c440805071540i71f9d0c4y2eaf97e170ee538e@mail.gmail.com> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2008-05-07 15:40:38, Yinghai Lu wrote: > On Wed, May 7, 2008 at 3:37 PM, Pavel Machek wrote: > > On Wed 2008-05-07 15:22:37, Yinghai Lu wrote: > > > On Wed, May 7, 2008 at 3:14 PM, Pavel Machek wrote: > > > > 3) copy&paste code remained in the patch > > > > > > i thought to keep the stub so could add more other stuff in the switch > > > like 64 bit > > > > This is _not_ good enough reason to copy&paste. Just do it like this: > > > > > > > switch (c->x86_vendor) { > > > case X86_VENDOR_AMD: > > > early_init_amd(c); > > > > > break; > > > case X86_VENDOR_INTEL: > > > early_init_intel(c); > > > > > break; > > > case X86_VENDOR_CENTAUR: > > > early_init_centaur(c); > > > break; > > > } > > > > # clear_cpu_cap(c, X86_FEATURE_PAT); > > > > # > > # switch (c->x86_vendor) { > > # case X86_VENDOR_AMD: > > # if (c->x86 >= 0xf && c->x86 <= 0x11) > > > > # set_cpu_cap(c, X86_FEATURE_PAT); > > # break; > > # case X86_VENDOR_INTEL: > > # if (c->x86 == 0xF || (c->x86 == 6 && c->x86_model >= 15)) > > > > # set_cpu_cap(c, X86_FEATURE_PAT); > > # break; > > # } > > > > And then, factor out code marked # into separate function, and call it > > from all three places. > > still need two copies or ifdef, otherwise you will check some 32bit > only cpu fam/model in 64bit node. So we'll check 32-bit only cpu in 64bit node. What is the problem? Being microsecond slower during startup? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html