kvm: x86: Cleanup vcpu->arch.guest_xstate_size
PATCH 1/1 kvm: x86: Cleanup vcpu->arch.guest_xstate_size
vcpu->arch.guest_xstate_size lost its only user since commit df1daba7d1cb ("KVM: x86: support XSAVES usage in the host"), so clean it up.
Signed-off-by Xiaoyao Li <[email protected]>
--- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/cpuid.c | 8 ++------ arch/x86/kvm/x86.c | 2 -- 3 files changed, 2 insertions(+), 9 deletions(-)
arch/x86/include/asm/kvm_host.h +0 -1
@@ -654,7 +654,6 @@ struct kvm_vcpu_arch {u64 xcr0;u64 guest_supported_xcr0; -u32 guest_xstate_size;struct kvm_pio_request pio;void *pio_data;
arch/x86/kvm/cpuid.c +2 -6
@@ -84,15 +84,11 @@ int kvm_update_cpuid(struct kvm_vcpu *vcpu) kvm_read_cr4_bits(vcpu, X86_CR4_PKE)); best =kvm_find_cpuid_entry (vcpu,0xD ,0 ); -if (!best) { +if (!best) vcpu->arch.guest_supported_xcr0 =0 ; - vcpu->arch.guest_xstate_size =XSAVE_HDR_SIZE +XSAVE_HDR_OFFSET ; - }else { +else vcpu->arch.guest_supported_xcr0 = (best->eax | ((u64 )best->edx <<32 )) & supported_xcr0; - vcpu->arch.guest_xstate_size = best->ebx = -xstate_required_size (vcpu->arch.xcr0, false); - } best =kvm_find_cpuid_entry (vcpu,0xD ,1 ); if (best && (cpuid_entry_has(best, X86_FEATURE_XSAVES) ||
arch/x86/kvm/x86.c +0 -2
@@ -9358,8 +9358,6 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) }fx_init (vcpu); - vcpu->arch.guest_xstate_size =XSAVE_HDR_SIZE +XSAVE_HDR_OFFSET ; - vcpu->arch.maxphyaddr =cpuid_query_maxphyaddr (vcpu); vcpu->arch.pat =MSR_IA32_CR_PAT_DEFAULT ;
Signature · 1 line
2.18.2
Quoted 49 lines · Xiaoyao Li
vcpu->arch.guest_xstate_sizelost its only user since commitdf1daba7d1cb("KVM: x86: support XSAVES usage in the host"), so clean it up.Signed-off-by Xiaoyao Li <[email protected]>--- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/cpuid.c | 8 ++------ arch/x86/kvm/x86.c | 2 -- 3 files changed, 2 insertions(+), 9 deletions(-)arch/x86/include/asm/kvm_host.h +0
-1@@ -654,7 +654,6 @@ struct kvm_vcpu_arch {u64 xcr0;u64 guest_supported_xcr0; -u32 guest_xstate_size;struct kvm_pio_request pio;void *pio_data;arch/x86/kvm/cpuid.c +2
-6@@ -84,15 +84,11 @@ int kvm_update_cpuid(struct kvm_vcpu *vcpu) kvm_read_cr4_bits(vcpu, X86_CR4_PKE)); best =kvm_find_cpuid_entry (vcpu,0xD ,0 ); -if (!best) { +if (!best) vcpu->arch.guest_supported_xcr0 =0 ; - vcpu->arch.guest_xstate_size =XSAVE_HDR_SIZE +XSAVE_HDR_OFFSET ; - }else { +else vcpu->arch.guest_supported_xcr0 = (best->eax | ((u64 )best->edx <<32 )) & supported_xcr0; - vcpu->arch.guest_xstate_size = best->ebx = -xstate_required_size (vcpu->arch.xcr0, false); - } best =kvm_find_cpuid_entry (vcpu,0xD ,1 ); if (best && (cpuid_entry_has(best, X86_FEATURE_XSAVES) ||arch/x86/kvm/x86.c +0
-0
arch/x86/kvm/x86.c int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) · line 9363
Quoted 8 lines
arch/x86/kvm/x86.c +0
-2@@ -9358,8 +9358,6 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) }fx_init (vcpu); - vcpu->arch.guest_xstate_size =XSAVE_HDR_SIZE +XSAVE_HDR_OFFSET ; - vcpu->arch.maxphyaddr =cpuid_query_maxphyaddr (vcpu); vcpu->arch.pat =MSR_IA32_CR_PAT_DEFAULT ;
Reviewed-by Vitaly Kuznetsov <[email protected]>
Signature · 1 line
Vitaly
Quoted 50 lines · Xiaoyao Li
vcpu->arch.guest_xstate_sizelost its only user since commitdf1daba7d1cb("KVM: x86: support XSAVES usage in the host"), so clean it up.Signed-off-by Xiaoyao Li <[email protected]>--- arch/x86/include/asm/kvm_host.h | 1 - arch/x86/kvm/cpuid.c | 8 ++------ arch/x86/kvm/x86.c | 2 -- 3 files changed, 2 insertions(+), 9 deletions(-)arch/x86/include/asm/kvm_host.h +0
-1@@ -654,7 +654,6 @@ struct kvm_vcpu_arch {u64 xcr0;u64 guest_supported_xcr0; -u32 guest_xstate_size;struct kvm_pio_request pio;void *pio_data;arch/x86/kvm/cpuid.c +2
-6@@ -84,15 +84,11 @@ int kvm_update_cpuid(struct kvm_vcpu *vcpu) kvm_read_cr4_bits(vcpu, X86_CR4_PKE)); best =kvm_find_cpuid_entry (vcpu,0xD ,0 ); -if (!best) { +if (!best) vcpu->arch.guest_supported_xcr0 =0 ; - vcpu->arch.guest_xstate_size =XSAVE_HDR_SIZE +XSAVE_HDR_OFFSET ; - }else { +else vcpu->arch.guest_supported_xcr0 = (best->eax | ((u64 )best->edx <<32 )) & supported_xcr0; - vcpu->arch.guest_xstate_size = best->ebx = -xstate_required_size (vcpu->arch.xcr0, false); - } best =kvm_find_cpuid_entry (vcpu,0xD ,1 ); if (best && (cpuid_entry_has(best, X86_FEATURE_XSAVES) ||arch/x86/kvm/x86.c +0
-0
arch/x86/kvm/x86.c int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) · line 9363
Quoted 8 lines
arch/x86/kvm/x86.c +0
-2@@ -9358,8 +9358,6 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) }fx_init (vcpu); - vcpu->arch.guest_xstate_size =XSAVE_HDR_SIZE +XSAVE_HDR_OFFSET ; - vcpu->arch.maxphyaddr =cpuid_query_maxphyaddr (vcpu); vcpu->arch.pat =MSR_IA32_CR_PAT_DEFAULT ;
Queued, thanks.
Paolo