From: "Chang S. Bae" <chang.seok.bae@intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: <linux-kernel@vger.kernel.org>, <x86@kernel.org>,
<tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>,
<dave.hansen@linux.intel.com>, <hpa@zytor.com>,
<avagin@gmail.com>
Subject: Re: [PATCH v2 4/4] x86/fpu: Correct the legacy state offset and size information
Date: Wed, 28 Sep 2022 15:16:42 -0700 [thread overview]
Message-ID: <16abaac3-d73f-2d00-f785-a16ec32139f1@intel.com> (raw)
In-Reply-To: <YzS3SXVxJOrC/k5X@google.com>
On 9/28/2022 2:06 PM, Sean Christopherson wrote:
> On Thu, Sep 22, 2022, Chang S. Bae wrote:
>>
>> diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
>> index a3f7045d1f8e..ac2ec5d6e7e4 100644
>> --- a/arch/x86/kernel/fpu/xstate.c
>> +++ b/arch/x86/kernel/fpu/xstate.c
>> @@ -143,8 +143,13 @@ static unsigned int xfeature_get_offset(u64 xcomp_bv, int xfeature)
>> * offsets.
>> */
>> if (!cpu_feature_enabled(X86_FEATURE_XCOMPACTED) ||
>> - xfeature <= XFEATURE_SSE)
>> + xfeature <= XFEATURE_SSE) {
>> + if (xfeature <= XFEATURE_SSE)
>> + pr_warn("The legacy state (%d) is discontiguously located.\n",
>> + xfeature);
>
> pr_warn() here isn't warranted. copy_uabi_to_xstate() calls this with non-extended
> features,
I think patch1 makes changes not to call this for legacy features anymore.
> which is perfectly fine since it manually handles MXCSR. And that helper
> is directly reachable by userspace, i.e. userspace can spam the pr_warn().
I don't think I get your point. I assume that helper is
__raw_xsave_addr(). But then I'm missing how it can be directly reached
by userspace.
Thanks,
Chang
next prev parent reply other threads:[~2022-09-28 22:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-22 20:00 [PATCH v2 0/4] x86/fpu: Fix MXCSR handling and SSE component definition Chang S. Bae
2022-09-22 20:00 ` [PATCH v2 1/4] x86/fpu: Fix the MXCSR state reshuffling between userspace and kernel buffers Chang S. Bae
2022-09-22 20:00 ` [PATCH v2 2/4] selftests/x86/mxcsr: Test the MXCSR state write via ptrace Chang S. Bae
2022-09-22 20:00 ` [PATCH v2 3/4] x86/fpu: Disallow legacy states from fpstate_clear_xstate_component() Chang S. Bae
2022-09-22 20:00 ` [PATCH v2 4/4] x86/fpu: Correct the legacy state offset and size information Chang S. Bae
2022-09-28 21:06 ` Sean Christopherson
2022-09-28 22:16 ` Chang S. Bae [this message]
2022-09-28 22:32 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16abaac3-d73f-2d00-f785-a16ec32139f1@intel.com \
--to=chang.seok.bae@intel.com \
--cc=avagin@gmail.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®