[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4e4b37d1-e2f8-6757-003c-d19ae8184088@intel.com>
Date: Mon, 8 Feb 2021 07:23:13 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Jing Liu <jing2.liu@...ux.intel.com>, pbonzini@...hat.com
Cc: Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] kvm: x86: Revise guest_fpu xcomp_bv field
On 2/8/21 8:16 AM, Jing Liu wrote:
> -#define XSTATE_COMPACTION_ENABLED (1ULL << 63)
> -
> static void fill_xsave(u8 *dest, struct kvm_vcpu *vcpu)
> {
> struct xregs_state *xsave = &vcpu->arch.guest_fpu->state.xsave;
> @@ -4494,7 +4492,8 @@ static void load_xsave(struct kvm_vcpu *vcpu, u8 *src)
> /* Set XSTATE_BV and possibly XCOMP_BV. */
> xsave->header.xfeatures = xstate_bv;
> if (boot_cpu_has(X86_FEATURE_XSAVES))
> - xsave->header.xcomp_bv = host_xcr0 | XSTATE_COMPACTION_ENABLED;
> + xsave->header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT |
> + xfeatures_mask_all;
Are 'host_xcr0' and 'xfeatures_mask_all' really interchangeable? If so,
shouldn't we just remove 'host_xcr0' everywhere?
Powered by blists - more mailing lists