Re: [PATCH] x86, cpu: X86_FEATURE_NOPL should be disabled on 32-bit only

From: H. Peter Anvin
Date: Sun Oct 03 2010 - 18:23:56 EST


Sort of... only if the input is a constant.

"Borislav Petkov" <bp@xxxxxxxxx> wrote:

>From: "H. Peter Anvin" <hpa@xxxxxxxxx>
>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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/