From: Dave Hansen <dave.hansen@intel.com>
To: Like Xu <like.xu.linux@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
Sean Christopherson <seanjc@google.com>,
Jim Mattson <jmattson@google.com>,
Wanpeng Li <wanpengli@tencent.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Joerg Roedel <joro@8bytes.org>,
x86@kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org, Like Xu <likexu@tencent.com>
Subject: Re: [PATCH] KVM: x86/xcr0: Don't make XFEATURE_MASK_SSE a mandatory bit setting
Date: Wed, 19 Jan 2022 07:23:05 -0800 [thread overview]
Message-ID: <1b6a8366-d1ab-536f-9bad-8c2b7a822fcb@intel.com> (raw)
In-Reply-To: <20220119070427.33801-1-likexu@tencent.com>
On 1/18/22 11:04 PM, Like Xu wrote:
> Remove the XFEATURE_MASK_SSE bit as part of the XFEATURE_MASK_EXTEND
> and opportunistically, move it into the context of its unique user KVM.
Is this a problem for xstate_required_size()? The rules for the CPUID
sub-functions <=1 are different than those for >1. Most importantly,
'eax' doesn't enumerate the size of the feature for the XFEATURE_SSE
sub-leaf.
I think XFEATURE_MASK_EXTEND was being used to avoid that oddity:
> u32 xstate_required_size(u64 xstate_bv, bool compacted)
> {
> int feature_bit = 0;
> u32 ret = XSAVE_HDR_SIZE + XSAVE_HDR_OFFSET;
>
> xstate_bv &= XFEATURE_MASK_EXTEND;
> while (xstate_bv) {
> if (xstate_bv & 0x1) {
> u32 eax, ebx, ecx, edx, offset;
> cpuid_count(0xD, feature_bit, &eax, &ebx, &ecx, &edx);
> /* ECX[1]: 64B alignment in compacted form */
> if (compacted)
> offset = (ecx & 0x2) ? ALIGN(ret, 64) : ret;
> else
> offset = ebx;
> ret = max(ret, offset + eax);
> }
>
> xstate_bv >>= 1;
> feature_bit++;
> }
>
> return ret;
> }
next prev parent reply other threads:[~2022-01-19 15:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-19 7:04 Like Xu
2022-01-19 15:23 ` Dave Hansen [this message]
2022-01-20 12:01 ` [DROP][PATCH] " Like Xu
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=1b6a8366-d1ab-536f-9bad-8c2b7a822fcb@intel.com \
--to=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=like.xu.linux@gmail.com \
--cc=likexu@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--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®