From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756229Ab1HEUIM (ORCPT ); Fri, 5 Aug 2011 16:08:12 -0400 Received: from terminus.zytor.com ([198.137.202.10]:47011 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756114Ab1HEUII (ORCPT ); Fri, 5 Aug 2011 16:08:08 -0400 Message-ID: <4E3C4D8C.1010709@zytor.com> Date: Fri, 05 Aug 2011 13:07:40 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0 MIME-Version: 1.0 To: Borislav Petkov CC: Ingo Molnar , Thomas Gleixner , Linus Torvalds , Andrew Morton , Avi Kivity , "Przywara, Andre" , "Pohlack, Martin" , LKML Subject: Re: [PATCH -v3.2 3/3] x86, AMD: Move BSP code to cpu_dev helper References: <1312550110-24160-1-git-send-email-bp@amd64.org> <4E3C2405.8090309@zytor.com> <20110805175522.GA26217@aftab> <20110805180409.GC26217@aftab> In-Reply-To: <20110805180409.GC26217@aftab> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/05/2011 11:04 AM, Borislav Petkov wrote: > Move code which is run once on the BSP during boot into the cpu_dev > helper. > +static void __cpuinit bsp_init_amd(struct cpuinfo_x86 *c) > +{ > + if (static_cpu_has(X86_FEATURE_CONSTANT_TSC)) { > + You can't use static_cpu_has() here, since this code runs before alternatives -- it will always be false. Furthermore, for code that only runs once, it is never a win to do patching. Arguably bsp_init should be __init and not __cpuinit, but I don't know how to make that work with the machinery, and is something that can be fixed anyway. -hpa