Re: [PATCH -v2] x86/CPU/AMD: Improve the erratum 1386 workaround

Maciej S. Szmigiero
2024-03-25T12:46:12Z

On 24.03.2024 21:05, Borislav Petkov wrote:
> On Thu, Mar 21, 2024 at 04:21:39PM +0100, Maciej S. Szmigiero wrote:
>> On 21.03.2024 13:05, Borislav Petkov wrote:
>>> From: "Borislav Petkov (AMD)" <bp@alien8.de>
>>>
>>> Disable XSAVES only on machines which haven't loaded the microcode
>>> revision containing the erratum fix.
>>>
>>> This will come in handy when running archaic OSes as guests. OSes whose
>>> brilliant programmers thought that CPUID is overrated and one should not
>>> query it but use features directly, ala shoot first, ask questions
>>> later... but only if you're alive after the shooting.
>>>
>>> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
>>> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>>> Cc: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
>>> ---
>>
>> Tested-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
>
> Yeah, thanks but still not good enough. Turns out we already have the
> min microcode revision testing functionality so there's no need for me
> to reinvent the wheel.
>
> No harm no foul, tho, the stuff in those two previous patches I will use
> in the microcode loader soon for simplifying the loading.
>
> Here's one *final* variant, I promise! :-)
>
> Sorry about that.

No problem, it happens :)

> ---
> From: "Borislav Petkov (AMD)" <bp@alien8.de>
> Date: Sun, 24 Mar 2024 20:51:35 +0100
> Subject: [PATCH -v2] x86/CPU/AMD: Improve the erratum 1386 workaround
>
> Disable XSAVES only on machines which haven't loaded the microcode
> revision containing the erratum fix.
>
> This will come in handy when running archaic OSes as guests. OSes whose
> brilliant programmers thought that CPUID is overrated and one should not
> query it but use features directly, ala shoot first, ask questions
> later... but only if you're alive after the shooting.
>
> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> Cc: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
> ---

I have tested the updated patch now, including negative test by
increasing the required microcode version by 10, and can confirm that
this version works properly too.

Thanks,
Maciej