x86/CPU/AMD: Improve the erratum 1386 workaround
authorBorislav Petkov (AMD) <bp@alien8.de>
Sun, 24 Mar 2024 19:51:35 +0000 (20:51 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 25 Mar 2024 13:05:24 +0000 (14:05 +0100)
commit29ba89f1895285f06c333546882e0c5ae9a6df23
tree70ad7d85dcdf7babc868045d9e6dd9efdd588c57
parent63edbaa48a579bb167aa92aa5826888730819fa2
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>
Tested-by: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/20240324200525.GBZgCHhYFsBj12PrKv@fat_crate.local
arch/x86/include/asm/cpu_device_id.h
arch/x86/kernel/cpu/amd.c