[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c603b75b-3de0-4d50-9645-47853d84cc20@intel.com>
Date: Wed, 15 Jan 2025 10:39:40 -0800
From: "Chang S. Bae" <chang.seok.bae@...el.com>
To: Tony W Wang-oc <TonyWWang-oc@...oxin.com>, <tglx@...utronix.de>,
<mingo@...hat.com>, <bp@...en8.de>, <dave.hansen@...ux.intel.com>,
<x86@...nel.org>, <hpa@...or.com>, <aruna.ramakrishna@...cle.com>,
<pbonzini@...hat.com>, <levymitchell0@...il.com>, <attofari@...zon.de>,
<linux-kernel@...r.kernel.org>
CC: <CobeChen@...oxin.com>, <TimGuo@...oxin.com>, <LeoLiu-oc@...oxin.com>,
Lyle Li <LyleLi@...oxin.com>
Subject: Re: [PATCH] x86/fpu: Fix the os panic issue caused by the XGETBV
instruction
On 1/1/2025 11:54 PM, Tony W Wang-oc wrote:
> From: Lyle Li <LyleLi@...oxin.com>
>
> The callers of the xfeatures_in_use function must ensure that the
> current processor has the X86_FEATURE_XGETBV1 feature. However, in some
> places where xfeatures_in_use is called, there is no check to see if the
> processor supports this feature, leading to the execution of the XGETBV
> XCR1 instruction on processors that do not support this feature,
> triggering a #GP exception, and ultimately causing an OS panic.
I doubt this is a real issue. An XFD implementation without XGETBV1 is
considerably broken; every AMX system includes XGETBV1. Similarly, as
far as I can see, PKU implementations also include XGETBV1. QEMU's CPU
feature list [1] seems consistent with this.
Maybe a wild clearcpuid use may clear off the XGETBV1 flag. Adding this
dependency to the table would make the relationship explicit:
static const struct cpuid_dep cpuid_deps[] = {
...
+ { X86_FEATURE_PKU, X86_FEATURE_XGETBV1 },
{}
};
Note that XFD is already listed as dependent on XGETBV1.
But I doubt the kernel needs to be resilient to deliberately
misconfigured or crazy virtual machine setups.
Thanks,
Chang
[1] https://github.com/qemu/qemu/blob/master/target/i386/cpu.c
Powered by blists - more mailing lists