From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934468AbcATPJ6 (ORCPT ); Wed, 20 Jan 2016 10:09:58 -0500 Received: from terminus.zytor.com ([198.137.202.10]:35797 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933889AbcATPJz (ORCPT ); Wed, 20 Jan 2016 10:09:55 -0500 Subject: Re: [PATCH] x86: static_cpu_has_safe: discard dynamic check after init To: Borislav Petkov References: <20160116193658.GC32085@pd.tnic> <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> Cc: Brian Gerst , the arch/x86 maintainers , Linux Kernel Mailing List , Ingo Molnar , Denys Vlasenko , Andy Lutomirski , Linus Torvalds From: "H. Peter Anvin" Message-ID: <569FA333.7020401@zytor.com> Date: Wed, 20 Jan 2016 07:09:39 -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: <20160120150109.GF23350@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 07:01, Borislav Petkov wrote: > On Tue, Jan 19, 2016 at 08:02:01PM -0800, H. Peter Anvin wrote: >> ... "i" (1 << (bit & 7)), >> "m" (((const char *)boot_cpu_data->x86_capability)[bit >> 3]) ... > > Nice! > > I was going to do: > > "i" (1 << (bit & 31)), > "m" (((boot_cpu_data->x86_capability)[bit >> 5])) > But then you're using testl and get long immediates. (And the parentheses around boot_cpu_data->x86_capability are redundant.) -hpa