From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756577AbcARTpo (ORCPT ); Mon, 18 Jan 2016 14:45:44 -0500 Received: from terminus.zytor.com ([198.137.202.10]:59329 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754270AbcARTpl (ORCPT ); Mon, 18 Jan 2016 14:45:41 -0500 Subject: Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init To: Borislav Petkov , Andy Lutomirski References: <1452972124-7380-1-git-send-email-brgerst@gmail.com> <20160116193658.GC32085@pd.tnic> <20160117103337.GC8549@pd.tnic> <20160118181457.GG12651@pd.tnic> <20160118183921.GH12651@pd.tnic> Cc: Brian Gerst , the arch/x86 maintainers , Linux Kernel Mailing List , Ingo Molnar , Denys Vlasenko , Linus Torvalds From: "H. Peter Anvin" Message-ID: <569D40CE.5090506@zytor.com> Date: Mon, 18 Jan 2016 11:45:18 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20160118183921.GH12651@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/18/16 10:39, Borislav Petkov wrote: > On Mon, Jan 18, 2016 at 10:29:24AM -0800, Andy Lutomirski wrote: >> I think that, if we can make static_cpu_has be unconditionally safe as >> a result > > Problem with this is the additional .altinstructions entry for > X86_FEATURE_ALWAYS. And sometimes you don't really need to use the _safe > variant when you know you're safe. > I think the two-byte optimization is the real issue if there is one at all. I don't care about the inittext, and unless I'm misremembering completely altinstructions also get ejected. So I don't personally object to killing off the unsafe variant. -hpa