All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] KVM: s390: do not clobber registers during guest reset/store" failed to apply to 4.14-stable tree
@ 2020-02-09 12:37 gregkh
  2020-02-09 21:32 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: gregkh @ 2020-02-09 12:37 UTC (permalink / raw)
  To: borntraeger, cohuck, david, frankja; +Cc: stable


The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 55680890ea78be0df5e1384989f1be835043c084 Mon Sep 17 00:00:00 2001
From: Christian Borntraeger <borntraeger@de.ibm.com>
Date: Fri, 31 Jan 2020 05:02:00 -0500
Subject: [PATCH] KVM: s390: do not clobber registers during guest reset/store
 status

The initial CPU reset clobbers the userspace fpc and the store status
ioctl clobbers the guest acrs + fpr.  As these calls are only done via
ioctl (and not via vcpu_run), no CPU context is loaded, so we can (and
must) act directly on the sync regs, not on the thread context.

Cc: stable@kernel.org
Fixes: e1788bb995be ("KVM: s390: handle floating point registers in the run ioctl not in vcpu_put/load")
Fixes: 31d8b8d41a7e ("KVM: s390: handle access registers in the run ioctl not in vcpu_put/load")
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Link: https://lore.kernel.org/r/20200131100205.74720-2-frankja@linux.ibm.com
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index d9e6bf3d54f0..876802894b35 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -2860,9 +2860,7 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu)
 	vcpu->arch.sie_block->gcr[14] = CR14_UNUSED_32 |
 					CR14_UNUSED_33 |
 					CR14_EXTERNAL_DAMAGE_SUBMASK;
-	/* make sure the new fpc will be lazily loaded */
-	save_fpu_regs();
-	current->thread.fpu.fpc = 0;
+	vcpu->run->s.regs.fpc = 0;
 	vcpu->arch.sie_block->gbea = 1;
 	vcpu->arch.sie_block->pp = 0;
 	vcpu->arch.sie_block->fpf &= ~FPF_BPBC;
@@ -4351,7 +4349,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
 	switch (ioctl) {
 	case KVM_S390_STORE_STATUS:
 		idx = srcu_read_lock(&vcpu->kvm->srcu);
-		r = kvm_s390_vcpu_store_status(vcpu, arg);
+		r = kvm_s390_store_status_unloaded(vcpu, arg);
 		srcu_read_unlock(&vcpu->kvm->srcu, idx);
 		break;
 	case KVM_S390_SET_INITIAL_PSW: {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: FAILED: patch "[PATCH] KVM: s390: do not clobber registers during guest reset/store" failed to apply to 4.14-stable tree
  2020-02-09 12:37 FAILED: patch "[PATCH] KVM: s390: do not clobber registers during guest reset/store" failed to apply to 4.14-stable tree gregkh
@ 2020-02-09 21:32 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2020-02-09 21:32 UTC (permalink / raw)
  To: gregkh; +Cc: borntraeger, cohuck, david, frankja, stable

On Sun, Feb 09, 2020 at 01:37:35PM +0100, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 4.14-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From 55680890ea78be0df5e1384989f1be835043c084 Mon Sep 17 00:00:00 2001
>From: Christian Borntraeger <borntraeger@de.ibm.com>
>Date: Fri, 31 Jan 2020 05:02:00 -0500
>Subject: [PATCH] KVM: s390: do not clobber registers during guest reset/store
> status
>
>The initial CPU reset clobbers the userspace fpc and the store status
>ioctl clobbers the guest acrs + fpr.  As these calls are only done via
>ioctl (and not via vcpu_run), no CPU context is loaded, so we can (and
>must) act directly on the sync regs, not on the thread context.
>
>Cc: stable@kernel.org
>Fixes: e1788bb995be ("KVM: s390: handle floating point registers in the run ioctl not in vcpu_put/load")
>Fixes: 31d8b8d41a7e ("KVM: s390: handle access registers in the run ioctl not in vcpu_put/load")
>Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>Reviewed-by: David Hildenbrand <david@redhat.com>
>Reviewed-by: Cornelia Huck <cohuck@redhat.com>
>Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>Link: https://lore.kernel.org/r/20200131100205.74720-2-frankja@linux.ibm.com
>Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

This was a context conflict because we don't have b9224cd7381a ("KVM:
s390: introduce defines for control registers") on 4.14. I've fixed it
and queued it up on 4.14.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-09 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-09 12:37 FAILED: patch "[PATCH] KVM: s390: do not clobber registers during guest reset/store" failed to apply to 4.14-stable tree gregkh
2020-02-09 21:32 ` Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.