From mboxrd@z Thu Jan 1 00:00:00 1970 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 DE436C00145 for ; Mon, 12 Dec 2022 13:53:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233093AbiLLNxi (ORCPT ); Mon, 12 Dec 2022 08:53:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233109AbiLLNxN (ORCPT ); Mon, 12 Dec 2022 08:53:13 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E69126C8 for ; Mon, 12 Dec 2022 05:52:12 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D284C610A3 for ; Mon, 12 Dec 2022 13:52:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35518C433D2; Mon, 12 Dec 2022 13:52:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1670853131; bh=aABJ34yaBComAUvgfO/e7K0GbYrnuNzBaC8mfvbiyo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BTcCI3zEq63i1papGHU1LyDsTJbNLTSURY2e+KYQsUbG+YbwHHKNm7biPRVQ96A3S ye53fuH1UePxtqDSSaO7ssQbvazw5FS/UTpYt1oBrh5qy89OAmX54URvhh1iUmcoYn RlAaq/MrVMBxnIIeoBAjVLKUjXTxuxO3mLCpGp3k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thomas Huth , Christian Borntraeger , David Hildenbrand , Claudio Imbrenda , Janosch Frank Subject: [PATCH 4.14 16/38] KVM: s390: vsie: Fix the initialization of the epoch extension (epdx) field Date: Mon, 12 Dec 2022 14:19:17 +0100 Message-Id: <20221212130912.931026053@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212130912.069170932@linuxfoundation.org> References: <20221212130912.069170932@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Thomas Huth commit 0dd4cdccdab3d74bd86b868768a7dca216bcce7e upstream. 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: 8fa1696ea781 ("KVM: s390: Multiple Epoch Facility support") Signed-off-by: Thomas Huth Reviewed-by: Christian Borntraeger Acked-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Reviewed-by: Janosch Frank 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 Signed-off-by: Greg Kroah-Hartman --- arch/s390/kvm/vsie.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/arch/s390/kvm/vsie.c +++ b/arch/s390/kvm/vsie.c @@ -373,8 +373,10 @@ static int shadow_scb(struct kvm_vcpu *v if (test_kvm_cpu_feat(vcpu->kvm, KVM_S390_VM_CPU_FEAT_CEI)) scb_s->eca |= scb_o->eca & ECA_CEI; /* Epoch Extension */ - if (test_kvm_facility(vcpu->kvm, 139)) + if (test_kvm_facility(vcpu->kvm, 139)) { scb_s->ecd |= scb_o->ecd & ECD_MEF; + scb_s->epdx = scb_o->epdx; + } prepare_ibc(vcpu, vsie_page); rc = shadow_crycb(vcpu, vsie_page);