Re: [PATCH v1] kvm: x86: Revise guest_fpu xcomp_bv field

2021-02-24 Thread Liu, Jing2
On 2/25/2021 4:40 AM, Sean Christopherson wrote: On Tue, Feb 23, 2021, Liu, Jing2 wrote: XCOMP_BV[63] field indicates that the save area is in the compacted format and XCOMP_BV[62:0] indicates the states that have space allocated in the save area, including both XCR0 and XSS bits enable by

Re: [PATCH v1] kvm: x86: Revise guest_fpu xcomp_bv field

2021-02-24 Thread Sean Christopherson
On Tue, Feb 23, 2021, Liu, Jing2 wrote: > XCOMP_BV[63] field indicates that the save area is in the > compacted format and XCOMP_BV[62:0] indicates the states that > have space allocated in the save area, including both XCR0 > and XSS bits enable by the host kernel. Use xfeatures_mask_all > for

Re: [PATCH v1] kvm: x86: Revise guest_fpu xcomp_bv field

2021-02-22 Thread Liu, Jing2
On 2/23/2021 12:06 AM, Sean Christopherson wrote: On Mon, Feb 22, 2021, Liu, Jing2 wrote: On 2/9/2021 1:24 AM, Sean Christopherson wrote: On Mon, Feb 08, 2021, Dave Hansen wrote: On 2/8/21 8:16 AM, Jing Liu wrote: -#define XSTATE_COMPACTION_ENABLED (1ULL << 63) - static void

Re: [PATCH v1] kvm: x86: Revise guest_fpu xcomp_bv field

2021-02-22 Thread Sean Christopherson
On Mon, Feb 22, 2021, Liu, Jing2 wrote: > > On 2/9/2021 1:24 AM, Sean Christopherson wrote: > > On Mon, Feb 08, 2021, Dave Hansen wrote: > > > On 2/8/21 8:16 AM, Jing Liu wrote: > > > > -#define XSTATE_COMPACTION_ENABLED (1ULL << 63) > > > > - > > > > static void fill_xsave(u8 *dest, struct

Re: [PATCH v1] kvm: x86: Revise guest_fpu xcomp_bv field

2021-02-21 Thread Liu, Jing2
On 2/9/2021 1:24 AM, Sean Christopherson wrote: On Mon, Feb 08, 2021, Dave Hansen wrote: 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 =

Re: [PATCH v1] kvm: x86: Revise guest_fpu xcomp_bv field

2021-02-08 Thread Sean Christopherson
On Mon, Feb 08, 2021, Dave Hansen wrote: > 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 = >arch.guest_fpu->state.xsave; > > @@ -4494,7 +4492,8 @@

Re: [PATCH v1] kvm: x86: Revise guest_fpu xcomp_bv field

2021-02-08 Thread Dave Hansen
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 = >arch.guest_fpu->state.xsave; > @@ -4494,7 +4492,8 @@ static void load_xsave(struct kvm_vcpu *vcpu, u8 *src)

[PATCH v1] kvm: x86: Revise guest_fpu xcomp_bv field

2021-02-07 Thread Jing Liu
Bit 63 of the XCOMP_BV field indicates that the save area is in the compacted format and the remaining bits indicate the states that have space allocated in the save area, not only user states. Since fpstate_init() has initialized xcomp_bv, let's just use that. Signed-off-by: Jing Liu ---