Re: [PATCH] x86/CPU/AMD: Clear RDRAND CPUID if Built-In-Self-Test failed on boot

From: Dmitry Safonov

Date: Tue Apr 28 2026 - 18:12:09 EST


On Tue, Apr 28, 2026 at 7:21 PM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> On Tue, Apr 28, 2026 at 06:35:31PM +0100, Dmitry Safonov via B4 Relay wrote:
> > Yet, CPUID gets cleared only for previously known broken
> > implementations, see i.e., commit c49a0a80137c ("x86/CPU/AMD: Clear
> > RDRAND CPUID bit on AMD family 15h/16h"), that disabled RDRAND on
> > the same CPU family, where it was broken only after suspend-resume.
> >
> > As RDRAND is not masked in CPUID, some userspace may attempt using it,
>
> So why aren't you clearing the MSR bit even if our internal X86_FEATURE
> representation is cleared?

That's exactly what this is about?

Or do you mean why not put this into some initscript? Potentially
possible, yet if the kernel already detected that rdrand is broken -
is there a downside to helping userspace avoid this issue?

Thanks,
Dmitry