Re: [PATCH RFC] x86/cpu: fix intermittent lockup on poweroff

From: Borislav Petkov
Date: Tue Apr 25 2023 - 17:07:04 EST


On Tue, Apr 25, 2023 at 01:34:48PM -0700, Dave Hansen wrote:
> > 0x0000000b 0x00: eax=0x00000001 ebx=0x00000002 ecx=0x00000100 edx=0x00000000
>
> which does have BIT(0) set.

Yeah, or the last basic leaf

0x0000000b 0x01: eax=0x00000005 ebx=0x0000000c ecx=0x00000201 edx=0x00000000

but that one has bit 0 set too, so yeah, patch is correct. I'll queue it
after -rc1.

But Tony, please change your commit message to say something like this:

"Check the maximum supported extended CPUID level because on Intel,
querying an invalid extended CPUID leaf returns the values of the
maximum basic CPUID leaf and if bit 0 in EAX is set, the check falsely
evaluates to true and WBINVD is wrongly executed where it shouldn't."

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette