From nobody Thu Apr 16 02:22:12 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BE5FC4332F for ; Wed, 23 Nov 2022 09:09:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237128AbiKWJJx (ORCPT ); Wed, 23 Nov 2022 04:09:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237151AbiKWJJo (ORCPT ); Wed, 23 Nov 2022 04:09:44 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26686193C2 for ; Wed, 23 Nov 2022 01:08:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669194525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WQbEhgs5qxc94Qred5pff5swxDYduz0Vj7Oft/jd7ac=; b=Xx9SD4+sZwah5ImmkxMjgS9wiCSP9aq54aRKzRqSjG2zLD4vy1UevPCRINu/IB7l3VyUMC jA80q4IzNJMoABpcjWTFSVJQMjyM9v/ylXZqVdoFL4oj0Cj1AFUFALNnHCi6VNWfN3PpKB FdgM5NYRb4PSozVyw/4BRyiPtA9b2/8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-512-poHxTbQwPziHRPlq95zWVw-1; Wed, 23 Nov 2022 04:08:40 -0500 X-MC-Unique: poHxTbQwPziHRPlq95zWVw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 62D52811E7A; Wed, 23 Nov 2022 09:08:40 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1487A1415114; Wed, 23 Nov 2022 09:08:37 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Janosch Frank , Claudio Imbrenda Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Borntraeger , David Hildenbrand , "Collin L. Walling" , Jason J Herne Subject: [PATCH] KVM: s390: vsie: Fix the initialization of the epoch extension (epdx) field Date: Wed, 23 Nov 2022 10:08:33 +0100 Message-Id: <20221123090833.292938-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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=3D2140899 Fixes: 8fa1696ea781 ("KVM: s390: Multiple Epoch Facility support") Signed-off-by: Thomas Huth Acked-by: David Hildenbrand Reviewed-by: Christian Borntraeger Reviewed-by: Claudio Imbrenda Reviewed-by: Janosch Frank --- arch/s390/kvm/vsie.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c index 94138f8f0c1c..ace2541ababd 100644 --- a/arch/s390/kvm/vsie.c +++ b/arch/s390/kvm/vsie.c @@ -546,8 +546,10 @@ static int shadow_scb(struct kvm_vcpu *vcpu, struct vs= ie_page *vsie_page) if (test_kvm_cpu_feat(vcpu->kvm, KVM_S390_VM_CPU_FEAT_CEI)) scb_s->eca |=3D scb_o->eca & ECA_CEI; /* Epoch Extension */ - if (test_kvm_facility(vcpu->kvm, 139)) + if (test_kvm_facility(vcpu->kvm, 139)) { scb_s->ecd |=3D scb_o->ecd & ECD_MEF; + scb_s->epdx =3D scb_o->epdx; + } =20 /* etoken */ if (test_kvm_facility(vcpu->kvm, 156)) --=20 2.31.1