]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
x86/KVM: Convert to fpstate
authorThomas Gleixner <tglx@linutronix.de>
Wed, 13 Oct 2021 14:55:33 +0000 (16:55 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:55:56 +0000 (11:55 +0200)
BugLink: https://bugs.launchpad.net/bugs/1967750
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>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Link: https://lkml.kernel.org/r/20211013145322.451439983@linutronix.de
(cherry picked from commit 1c57572d754fc54e0b8ac0df5350969ce6292d12)
Acked-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arch/x86/kvm/x86.c

index 446a544f846c1f4469c407cf13cacf5ef4a2be8e..2443743da75b9dd580968726cb562476fdbfd6c4 100644 (file)
@@ -10529,7 +10529,7 @@ int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
 
        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;
@@ -10552,7 +10552,7 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
 
        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;