diff mbox series

[05/21] x86/KVM: Convert to fpstate

Message ID 20211013145322.451439983@linutronix.de (mailing list archive)
State New, archived
Headers show
Series x86/fpu: Move register state into a container struct (part 2) | expand

Commit Message

Thomas Gleixner Oct. 13, 2021, 2:55 p.m. UTC
Convert KVM code to the new register storage mechanism in preparation for
dynamically sized buffers.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
---
 arch/x86/kvm/x86.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Paolo Bonzini Oct. 13, 2021, 3:11 p.m. UTC | #1
On 13/10/21 16:55, Thomas Gleixner wrote:
> Convert KVM code to the new register storage mechanism in preparation for
> dynamically sized buffers.
> 
> No functional change.
> 
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: kvm@vger.kernel.org
> ---
>   arch/x86/kvm/x86.c |    4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -10389,7 +10389,7 @@ int kvm_arch_vcpu_ioctl_get_fpu(struct k
>   
>   	vcpu_load(vcpu);
>   
> -	fxsave = &vcpu->arch.guest_fpu->state.fxsave;
> +	fxsave = &vcpu->arch.guest_fpu->fpstate->regs.fxsave;
>   	memcpy(fpu->fpr, fxsave->st_space, 128);
>   	fpu->fcw = fxsave->cwd;
>   	fpu->fsw = fxsave->swd;
> @@ -10412,7 +10412,7 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct k
>   
>   	vcpu_load(vcpu);
>   
> -	fxsave = &vcpu->arch.guest_fpu->state.fxsave;
> +	fxsave = &vcpu->arch.guest_fpu->fpstate->regs.fxsave;
>   
>   	memcpy(fxsave->st_space, fpu->fpr, 128);
>   	fxsave->cwd = fpu->fcw;
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
diff mbox series

Patch

--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -10389,7 +10389,7 @@  int kvm_arch_vcpu_ioctl_get_fpu(struct k
 
 	vcpu_load(vcpu);
 
-	fxsave = &vcpu->arch.guest_fpu->state.fxsave;
+	fxsave = &vcpu->arch.guest_fpu->fpstate->regs.fxsave;
 	memcpy(fpu->fpr, fxsave->st_space, 128);
 	fpu->fcw = fxsave->cwd;
 	fpu->fsw = fxsave->swd;
@@ -10412,7 +10412,7 @@  int kvm_arch_vcpu_ioctl_set_fpu(struct k
 
 	vcpu_load(vcpu);
 
-	fxsave = &vcpu->arch.guest_fpu->state.fxsave;
+	fxsave = &vcpu->arch.guest_fpu->fpstate->regs.fxsave;
 
 	memcpy(fxsave->st_space, fpu->fpr, 128);
 	fxsave->cwd = fpu->fcw;