Re: [PATCH v2] Linux VM workaround for Knights Landing A/D leak
From: Dave Hansen
Date: Tue Jun 14 2016 - 14:54:30 EST
On 06/14/2016 11:34 AM, One Thousand Gnomes wrote:
> On Tue, 14 Jun 2016 10:24:16 -0700
> Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> wrote:
>
>> On 06/14/2016 10:01 AM, Lukasz Anaczkowski wrote:
>>> v2 (Lukasz Anaczkowski):
>>> () fixed compilation breakage
>> ...
>>
>> By unconditionally defining the workaround code, even on kernels where
>> there is no chance of ever hitting this bug. I think that's a pretty
>> poor way to do it.
>>
>> Can we please stick this in one of the intel.c files, so it's only
>> present on CPU_SUP_INTEL builds?
>
> Can we please make it use alternatives or somesuch so that it just goes
> away at boot if its not a Knights Landing box ?
Lukasz, Borislav suggested using static_cpu_has_bug(), which will do the
alternatives patching. It's definitely the right thing to use here.