Skip to content

Commit 7ae5eec

Browse files
committed
KVM: s390: vsie: Fix the initialization of the epoch extension (epdx) field
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2140899 Upstream Status: https://git.kernel.org/pub/scm/virt/kvm/kvm.git commit 0dd4cdc Author: Thomas Huth <thuth@redhat.com> Date: Wed Nov 23 10:08:33 2022 +0100 KVM: s390: vsie: Fix the initialization of the epoch extension (epdx) field We recently experienced some weird huge time jumps in nested guests when rebooting them in certain cases. After adding some debug code to the epoch handling in vsie.c (thanks to David Hildenbrand for the idea!), it was obvious that the "epdx" field (the multi-epoch extension) did not get set to 0xff in case the "epoch" field was negative. Seems like the code misses to copy the value from the epdx field from the guest to the shadow control block. By doing so, the weird time jumps are gone in our scenarios. Link: https://bugzilla.redhat.com/show_bug.cgi?id=2140899 Fixes: 8fa1696 ("KVM: s390: Multiple Epoch Facility support") Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com> Acked-by: David Hildenbrand <david@redhat.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Cc: stable@vger.kernel.org # 4.19+ Link: https://lore.kernel.org/r/20221123090833.292938-1-thuth@redhat.com Message-Id: <20221123090833.292938-1-thuth@redhat.com> Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
1 parent 2b32968 commit 7ae5eec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/s390/kvm/vsie.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,10 @@ static int shadow_scb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
546546
if (test_kvm_cpu_feat(vcpu->kvm, KVM_S390_VM_CPU_FEAT_CEI))
547547
scb_s->eca |= scb_o->eca & ECA_CEI;
548548
/* Epoch Extension */
549-
if (test_kvm_facility(vcpu->kvm, 139))
549+
if (test_kvm_facility(vcpu->kvm, 139)) {
550550
scb_s->ecd |= scb_o->ecd & ECD_MEF;
551+
scb_s->epdx = scb_o->epdx;
552+
}
551553

552554
/* etoken */
553555
if (test_kvm_facility(vcpu->kvm, 156))

0 commit comments

Comments
 (0)