From nobody Tue Nov 26 09:47:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708560299624429.2690622161865; Wed, 21 Feb 2024 16:04:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcwZS-0007Y8-J7; Wed, 21 Feb 2024 19:04:14 -0500 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 1rcwZQ-0007Xq-Nk; Wed, 21 Feb 2024 19:04:12 -0500 Received: from mta0.cl.cam.ac.uk ([2a05:b400:110::25:0]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcwZO-0004oW-MN; Wed, 21 Feb 2024 19:04:12 -0500 Received: from technos.cl.cam.ac.uk ([2001:630:212:238:e63d:1aff:fe8d:4a70]:34906) (dnseec=no) by mta0.cl.cam.ac.uk:25 [2a05:b400:110::25:0] with esmtp (Exim 4.95) id 1rcwZD-00HXhZ-SY (envelope-from ); Thu, 22 Feb 2024 00:03:59 +0000 Received: from jrtc4 by technos.cl.cam.ac.uk with local (Exim 4.95) (envelope-from ) id 1rcwZD-006YTc-3J; Thu, 22 Feb 2024 00:03:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cl.cam.ac.uk; s=mta3; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uOqpFpRHeNTJkIs3ZCo+XPQx0TPFGZAjY2V7pgRTXhg=; t=1708560247; x=1709424247; b=NssVUuuYlpPQK1LRMcVMpFo2NEErxEXEh4sDRhJTek5ol/Nbr8cED28HcMFnHgTPEKpcSI+pynI 9I76pPZ21JOR7r3/F7AbMtt4n2jd066hAVemjcx9nZWceUyAmrBuJdGb9qxLb1vu/CufwBC2hRMoS QVpyzZeFVnCP7iDhXY4bjQ9WGZybjfiJ3fvbzHgdGkn+HahOZ76GStyz+GmaM2R59CpkpOKBxDsy1 Hc2+Bcty7HVIKm3HtvQoKXTxfjjJMx25cgif6LvV5dytClba/0Tqpvu4ru2XeyBJb3drnuRpBmpa8 +0a0brA0mBZUHrGvCyIvGrxlq+iIxPxft+TA==; X-CL-Received-SPF: pass (mta0.cl.cam.ac.uk: ) client-ip=2001:630:212:238:e63d:1aff:fe8d:4a70; envelope-from=jrtc4@cl.cam.ac.uk; helo=technos.cl.cam.ac.uk 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 (mta0.cl.cam.ac.uk: ) client-ip=2001:630:212:238:e63d:1aff:fe8d:4a70; envelope-from=jrtc4@cl.cam.ac.uk; helo=technos.cl.cam.ac.uk From: Jessica Clarke To: qemu-devel@nongnu.org Cc: Jessica Clarke , qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH] pl031: Update last RTCLR value on write in case it's read back Date: Thu, 22 Feb 2024 00:03:41 +0000 Message-Id: <20240222000341.1562443-1-jrtc27@jrtc27.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a05:b400:110::25:0; envelope-from=jrtc4@cl.cam.ac.uk; helo=mta0.cl.cam.ac.uk X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1708560301662100001 Content-Type: text/plain; charset="utf-8" The PL031 allows you to read RTCLR, which is meant to give you the last value written. PL031State has an lr field which is used when reading from RTCLR, and is present in the VM migration state, but we never actually update it, so it always reads as its initial 0 value. Signed-off-by: Jessica Clarke Reviewed-by: Alex Benn=C3=A9e --- hw/rtc/pl031.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c index 837b0bdf9b..563bb4b446 100644 --- a/hw/rtc/pl031.c +++ b/hw/rtc/pl031.c @@ -141,6 +141,7 @@ static void pl031_write(void * opaque, hwaddr offset, g_autofree const char *qom_path =3D object_get_canonical_path(opaq= ue); struct tm tm; =20 + s->lr =3D value; s->tick_offset +=3D value - pl031_get_count(s); =20 qemu_get_timedate(&tm, s->tick_offset); --=20 2.34.1