Re: [PATCH 4.9 43/92] x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown

2018-02-13 Thread Nick Lowe
Hi,

This does not seem to have subsumed the AMD specific code in

x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown
Commit a8799fd14d9f7f385a5a5c86cde247caf4bb0320

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.9.81=a8799fd14d9f7f385a5a5c86cde247caf4bb0320

x86/kaiser: Check boottime cmdline params
Commit 8018307a45a90ab2eecfd03d48b7efb31707df37

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/arch/x86/mm/kaiser.c?h=v4.9.75=8018307a45a90ab2eecfd03d48b7efb31707df37

Here, we can see:

+skip:
+ if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+ goto disable;

Refer to 4.9.81's kaiser.c
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/arch/x86/mm/kaiser.c?h=v4.9.81

Also 4.4.115's kaiser.c
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/arch/x86/mm/kaiser.c?h=v4.4.115

Cheers,

Nick


Re: [PATCH 4.9 43/92] x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown

2018-02-13 Thread Nick Lowe
Hi Arjan and Greg,

Sorry if I am not being clear enough.

My point is that there is a check for X86_VENDOR_AMD now in two places.

It is still hardcoded for the auto boot option which I think should
not be there. The patch on that basis looked incomplete to me.

Put another way, there is no effect to the auto option where the
contents of cpu_no_meltdown[] are changed and
cpu_vulnerable_to_meltdown returns differently.

The auto option does not make use of a determination of the
X86_BUG_CPU_MELTDOWN state.

This seems wrong to me. It does not seem correct to me for the auto
option to have this duplication with a check for just X86_VENDOR_AMD.

Regards,

Nick


Re: [PATCH 4.9 43/92] x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown

2018-02-16 Thread Nick Lowe
Hi,

This should use boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN)) - I am
preparing patches.

Best,

Nick


Re: [PATCH 4.9 43/92] x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown

2018-02-16 Thread Nick Lowe
Hi

I do not have a tested patch, but I expect the change would be something like:

skip:
-   if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+   if (!static_cpu_has_bug(X86_BUG_CPU_MELTDOWN))
   goto disable;

Cheers,

Nick


On Tue, Feb 13, 2018 at 4:32 PM, Greg Kroah-Hartman
<gre...@linuxfoundation.org> wrote:
> On Tue, Feb 13, 2018 at 03:27:47PM +0000, Nick Lowe wrote:
>> Hi Arjan and Greg,
>>
>> Sorry if I am not being clear enough.
>>
>> My point is that there is a check for X86_VENDOR_AMD now in two places.
>>
>> It is still hardcoded for the auto boot option which I think should
>> not be there. The patch on that basis looked incomplete to me.
>>
>> Put another way, there is no effect to the auto option where the
>> contents of cpu_no_meltdown[] are changed and
>> cpu_vulnerable_to_meltdown returns differently.
>>
>> The auto option does not make use of a determination of the
>> X86_BUG_CPU_MELTDOWN state.
>>
>> This seems wrong to me. It does not seem correct to me for the auto
>> option to have this duplication with a check for just X86_VENDOR_AMD.
>
> Do you have a patch that reflects what you want to see changed here?
>
> And can you test it?  :)
>
> I don't have any AMD hardware, sorry.
>
> thanks,
>
> greg k-h


Re: [PATCH 4.9 43/92] x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown

2018-02-13 Thread Nick Lowe
Hi,

This does not seem to have subsumed the AMD specific code in

x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown
Commit a8799fd14d9f7f385a5a5c86cde247caf4bb0320

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.9.81=a8799fd14d9f7f385a5a5c86cde247caf4bb0320

x86/kaiser: Check boottime cmdline params
Commit 8018307a45a90ab2eecfd03d48b7efb31707df37

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/arch/x86/mm/kaiser.c?h=v4.9.75=8018307a45a90ab2eecfd03d48b7efb31707df37

Here, we can see:

+skip:
+ if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+ goto disable;

Refer to 4.9.81's kaiser.c
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/arch/x86/mm/kaiser.c?h=v4.9.81

Also 4.4.115's kaiser.c
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/arch/x86/mm/kaiser.c?h=v4.4.115

Cheers,

Nick


Re: [PATCH 4.9 43/92] x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown

2018-02-13 Thread Nick Lowe
Hi Arjan and Greg,

Sorry if I am not being clear enough.

My point is that there is a check for X86_VENDOR_AMD now in two places.

It is still hardcoded for the auto boot option which I think should
not be there. The patch on that basis looked incomplete to me.

Put another way, there is no effect to the auto option where the
contents of cpu_no_meltdown[] are changed and
cpu_vulnerable_to_meltdown returns differently.

The auto option does not make use of a determination of the
X86_BUG_CPU_MELTDOWN state.

This seems wrong to me. It does not seem correct to me for the auto
option to have this duplication with a check for just X86_VENDOR_AMD.

Regards,

Nick


Re: [PATCH 4.9 43/92] x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown

2018-02-16 Thread Nick Lowe
Hi

I do not have a tested patch, but I expect the change would be something like:

skip:
-   if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+   if (!static_cpu_has_bug(X86_BUG_CPU_MELTDOWN))
   goto disable;

Cheers,

Nick


On Tue, Feb 13, 2018 at 4:32 PM, Greg Kroah-Hartman
 wrote:
> On Tue, Feb 13, 2018 at 03:27:47PM +0000, Nick Lowe wrote:
>> Hi Arjan and Greg,
>>
>> Sorry if I am not being clear enough.
>>
>> My point is that there is a check for X86_VENDOR_AMD now in two places.
>>
>> It is still hardcoded for the auto boot option which I think should
>> not be there. The patch on that basis looked incomplete to me.
>>
>> Put another way, there is no effect to the auto option where the
>> contents of cpu_no_meltdown[] are changed and
>> cpu_vulnerable_to_meltdown returns differently.
>>
>> The auto option does not make use of a determination of the
>> X86_BUG_CPU_MELTDOWN state.
>>
>> This seems wrong to me. It does not seem correct to me for the auto
>> option to have this duplication with a check for just X86_VENDOR_AMD.
>
> Do you have a patch that reflects what you want to see changed here?
>
> And can you test it?  :)
>
> I don't have any AMD hardware, sorry.
>
> thanks,
>
> greg k-h


Re: [PATCH 4.9 43/92] x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown

2018-02-16 Thread Nick Lowe
Hi,

This should use boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN)) - I am
preparing patches.

Best,

Nick