From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934594AbcATQQ4 (ORCPT ); Wed, 20 Jan 2016 11:16:56 -0500 Received: from terminus.zytor.com ([198.137.202.10]:36628 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934015AbcATQQy (ORCPT ); Wed, 20 Jan 2016 11:16:54 -0500 Subject: Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init To: Borislav Petkov References: <20160117103337.GC8549@pd.tnic> <20160118181457.GG12651@pd.tnic> <20160118185107.GI12651@pd.tnic> <20160119011026.GA12911@pd.tnic> <20160119092213.GA15071@pd.tnic> <569F06B9.4060903@zytor.com> <20160120150109.GF23350@pd.tnic> <569FA333.7020401@zytor.com> <20160120160451.GG23350@pd.tnic> Cc: Brian Gerst , the arch/x86 maintainers , Linux Kernel Mailing List , Ingo Molnar , Denys Vlasenko , Andy Lutomirski , Linus Torvalds From: "H. Peter Anvin" X-Enigmail-Draft-Status: N1110 Message-ID: <569FB2E6.4030302@zytor.com> Date: Wed, 20 Jan 2016 08:16:38 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160120160451.GG23350@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/20/16 08:04, Borislav Petkov wrote: > On Wed, Jan 20, 2016 at 07:09:39AM -0800, H. Peter Anvin wrote: >> But then you're using testl and get long immediates. >> >> (And the parentheses around boot_cpu_data->x86_capability are redundant.) > > Right. > > Ok, below is what builds here. So no SOBs etc. > > All this include hell wankery is so that we can use boot_cpu_data in > cpufeature.h. And that's not simple because boot/mkcpustr.c includes it > too so if I carve out struct cpuinfo_x86 to a separate asm/cpuinfo.h > header, it complains because it doesn't see it. > > Thus this _ASM_BOOT_MKCPUSTR_ yucky marker to stop arch/x86/boot from > including it. > > I'm very open to better ideas. :-) > I think the right answer is to split the macros that define specific CPU features into a separate file. It would also make it assembly-safe which would be useful in some other places. However, I do also want to observe that we already do have this specific marker... it is called __KERNEL__. -hpa