From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754841Ab0JCWXt (ORCPT ); Sun, 3 Oct 2010 18:23:49 -0400 Received: from terminus.zytor.com ([198.137.202.10]:59954 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195Ab0JCWXs (ORCPT ); Sun, 3 Oct 2010 18:23:48 -0400 X-User-Agent: K-9 Mail for Android References: <20101003093701.GB3733@liondog.tnic> <4CA89681.8000202@zytor.com> <20101003152212.GA13233@liondog.tnic> <20101003201139.GA16532@liondog.tnic> In-Reply-To: <20101003201139.GA16532@liondog.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PATCH] x86, cpu: X86_FEATURE_NOPL should be disabled on 32-bit only From: "H. Peter Anvin" Date: Sun, 03 Oct 2010 15:22:13 -0700 To: Borislav Petkov CC: Ingo Molnar , Thomas Gleixner , lkml Message-ID: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sort of... only if the input is a constant. "Borislav Petkov" wrote: >From: "H. Peter Anvin" >Date: Sun, Oct 03, 2010 at 11:19:18AM -0700 > >> I think we actually need to set it on 64 bits. > >Ok, correct me if I'm wrong but I think it is already "indirectly" set >on 64-bits through REQUIRED_MASK3: > >#define REQUIRED_MASK3 (NEED_NOPL) > >which is defined as > >#define NEED_NOPL (1<<(X86_FEATURE_NOPL & 31)) > >when either CONFIG_X86_P6_NOP or CONFIG_X86_64 are selected. > >and cpu_has() does > >#define cpu_has(c, bit) \ > (__builtin_constant_p(bit) && \ > ... > (((bit)>>5)==3 && (1UL<<((bit)&31) & REQUIRED_MASK3)) || \ > ... > ? 1 : test_cpu_cap(c, bit)) > >which returns 1 when testing for X86_FEATURE_NOPL, no? > >-- >Regards/Gruss, > Boris. -- Sent from my mobile phone. Please pardon any lack of formatting.