From nobody Mon Feb 9 02:14:43 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1666963670; cv=none; d=zohomail.com; s=zohoarc; b=SoQ4g+Y5EKx+4R7q9spVRQjqLwNpXLcvEDKYcG1tOybBHO8iy6eLGifPKQADS9BKUzT45A4YOGBURkQ/mN8VtJUcNE+BV7ggNxyfkEt7VEwLLao60y5NSAeZUzOtHdDpTdGn7sNYFDeolCtaGZWxF+ZPZbJ47zzMoXJYSAZp7YY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666963670; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=X8FBaf6j0o4xPJN88auBAvKkeP87NQzvWJrTn6qHgRM=; b=cFpz+oUFK/XPVLytm+pJWQ+lGj3/wwCGn+ftuBCrLnn66E94FcL0rxJIxAVq+1mULpBRHZEzWYsxQGrOsG6/4+mt3PCMwXjmDIMOER068NTPn9LABXIWTpOShEQROkTshQ3Rw231ma7It087fDCKrlxLBIVb6gCFsX4ZS14h1MI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1666963670606877.7604267688984; Fri, 28 Oct 2022 06:27:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooPKW-00018x-VD; Fri, 28 Oct 2022 09:23:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooPKT-00011s-Jo for qemu-devel@nongnu.org; Fri, 28 Oct 2022 09:23:22 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooPKS-0005HG-3P for qemu-devel@nongnu.org; Fri, 28 Oct 2022 09:23:21 -0400 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-85-64PnYpRyMF-rmUM1OsZPsQ-1; Fri, 28 Oct 2022 09:23:13 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 91D0F101A54E; Fri, 28 Oct 2022 13:23:12 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8BAA71121319; Fri, 28 Oct 2022 13:23:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666963396; 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: in-reply-to:in-reply-to:references:references; bh=X8FBaf6j0o4xPJN88auBAvKkeP87NQzvWJrTn6qHgRM=; b=EOXFhz+xKizz671IIb04dk4252z/HD1h/SihsphaPYyoVEcrR1C0tZ6bdt41cgaZeR61Sr 032KzKB8pHqmUoU3Kq8CLuzuUKtSlqSgXx4okLAVuBYY/wYJ1EQtfnZKBTgHfv3WZR9xvN WD8SYd8iGFhmeSijCSZxqWawguYcFSo= X-MC-Unique: 64PnYpRyMF-rmUM1OsZPsQ-1 From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Nico Boehr Subject: [PULL 03/21] s390x/tod-kvm: don't save/restore the TOD in PV guests Date: Fri, 28 Oct 2022 15:22:46 +0200 Message-Id: <20221028132304.829103-4-thuth@redhat.com> In-Reply-To: <20221028132304.829103-1-thuth@redhat.com> References: <20221028132304.829103-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.516, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1666963672280100007 Content-Type: text/plain; charset="utf-8" From: Nico Boehr Under PV, the guest's TOD clock is under control of the ultravisor and the hypervisor cannot change it. With upcoming kernel changes[1], the Linux kernel will reject QEMU's request to adjust the guest's clock in this case, so don't attempt to set the clock. This avoids the following warning message on save/restore of a PV guest: warning: Unable to set KVM guest TOD clock: Operation not supported [1] https://lore.kernel.org/all/20221011160712.928239-2-nrb@linux.ibm.com/ Fixes: c3347ed0d2ee ("s390x: protvirt: Support unpack facility") Signed-off-by: Nico Boehr Message-Id: <20221012123229.1196007-1-nrb@linux.ibm.com> [thuth: Add curly braces] Signed-off-by: Thomas Huth --- hw/s390x/tod-kvm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/s390x/tod-kvm.c b/hw/s390x/tod-kvm.c index 9d0cbfbce2..e2202dae2d 100644 --- a/hw/s390x/tod-kvm.c +++ b/hw/s390x/tod-kvm.c @@ -13,6 +13,7 @@ #include "qemu/module.h" #include "sysemu/runstate.h" #include "hw/s390x/tod.h" +#include "hw/s390x/pv.h" #include "kvm/kvm_s390x.h" =20 static void kvm_s390_get_tod_raw(S390TOD *tod, Error **errp) @@ -84,6 +85,14 @@ static void kvm_s390_tod_vm_state_change(void *opaque, b= ool running, S390TODState *td =3D opaque; Error *local_err =3D NULL; =20 + /* + * Under PV, the clock is under ultravisor control, hence we cannot re= store + * it on resume. + */ + if (s390_is_pv()) { + return; + } + if (running && td->stopped) { /* Set the old TOD when running the VM - start the TOD clock. */ kvm_s390_set_tod_raw(&td->base, &local_err); --=20 2.31.1