[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1955637d-b7ab-20a8-558a-6b909b7069a9@intel.com>
Date: Tue, 25 Apr 2023 13:34:48 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Tony Battersby <tonyb@...ernetics.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org
Cc: "H. Peter Anvin" <hpa@...or.com>,
Mario Limonciello <mario.limonciello@....com>,
Tom Lendacky <thomas.lendacky@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC] x86/cpu: fix intermittent lockup on poweroff
On 4/25/23 13:03, Dave Hansen wrote:
> On 4/25/23 12:26, Tony Battersby wrote:
>> - if (cpuid_eax(0x8000001f) & BIT(0))
>> + if (c->extended_cpuid_level >= 0x8000001f &&
>> + (cpuid_eax(0x8000001f) & BIT(0)))
>> native_wbinvd();
> Oh, so the existing code is running into the
>
>> If a value entered for CPUID.EAX is higher than the maximum input
>> value for basic or extended function for that processor then the data
>> for the highest basic information leaf is returned
> behavior. It's basically looking at BIT(0) of some random extended
> leaf. Probably 0x80000008 based on your 'cpuid -r' output.
Whoops, 0x80000008 isn't a "basic information leaf". If 'cpuid -r'
dumps all the basic leaves, that would mean the "highest basic
information leaf" is 0x0000000b:
> 0x0000000b 0x00: eax=0x00000001 ebx=0x00000002 ecx=0x00000100 edx=0x00000000
which does have BIT(0) set.
So, that at least explains how WBINVD gets called in the first place.
But (as tglx noted on IRC) it doesn't really explain the lockup. WBINVD
should work everywhere and it won't #UD or something because the CPUID
check was botched.
Powered by blists - more mailing lists