From patchwork Tue Feb 27 13:32:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 776215 Delivered-To: patch@linaro.org Received: by 2002:adf:a113:0:b0:33d:f458:43ce with SMTP id o19csp159679wro; Tue, 27 Feb 2024 05:43:28 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUYrO45sSHU5dUfK3sDMPaWNsCKFhe5NqeZIvod/3ylNFbqBVMtoN1i5SxA6Qiq79X/S1hakKdYh8NEgfI/U+V1 X-Google-Smtp-Source: AGHT+IF6IA4N0jIR0z+SJqK8Uix4tHCKucSfMIpIa0HhvgTYdIqfUFlMIfRnu2420/jbfOsbRNdc X-Received: by 2002:a67:f5d4:0:b0:470:5080:451 with SMTP id t20-20020a67f5d4000000b0047050800451mr6293296vso.16.1709041408193; Tue, 27 Feb 2024 05:43:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709041408; cv=none; d=google.com; s=arc-20160816; b=hf50ZaEwKzxPx0T0s+5JK/bIZjRqa7OHmZPs3Fva4m73C+XvUXLGIRD++EWBezvSW7 Fns03pWE4evmV/6zfgUvD5m3uZH1S6lmMiRou0MtxvxplJyY7DN4107HqtL4Xyyq7SgO C7jv143gAmGVjUBjfdmGr1k6OgFbxqs4ZK7JY8FRjKEZ934T8grPxooA5d2T/bNITq7e XI3ZzC4tOQKUravBbdew7sPIWgD5Y8BRMCrqjv6eVHiL0Dd+FHw0/hbQaBxKO9QQLAnR Wi5WWuNo368X2bbfZuIWCpy90hJ1if/xV9bguzsAocXT3sLAcAMwlOrX678H/fa0o3v7 kVwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=joGUYxBf+AHBPVlumJel18CoFaqnsq9/5R/fva28MLs=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=jct7Kg9Xe9mQcorGA/6wBR0NXTYQskAi7AmG6iJ5oK+xLvRdJ7XB6UnUO9AcLbusGB PxoNkrKUtBE4QlGpZz13X35EvGhqggSzlcKMeDX0MgbY+Uw5NLNaSlOTZpGxwGB7S+L1 minkN08PhJVoq2XGCFYHAkgxJHT1NTxmxfhaHZ3PJUIEOhUcKcEKCOyp9+PEEWovYNMJ n5rTqiQDl1TI7xQe4Pf8ZbR4owqIJgkaAjF3bvbeQE5rXEQsKU7uMjfH3QArjWtqXfSp OfmFVkwW/gxRuoRDvQog5OGxgscgEIVBJlR0HHmBS9wkzvPNIGhOljCeyp3gAkNnmYGG YI/g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SvGM7GFF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c5-20020ac853c5000000b0042e6b29aaa4si7279337qtq.337.2024.02.27.05.43.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2024 05:43:28 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SvGM7GFF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rexb0-000187-JY; Tue, 27 Feb 2024 08:34:10 -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 1rexaF-0000hT-AC for qemu-devel@nongnu.org; Tue, 27 Feb 2024 08:33:23 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rexaD-0002qP-M9 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 08:33:23 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-412a14299a4so21618515e9.1 for ; Tue, 27 Feb 2024 05:33:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709040800; x=1709645600; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=joGUYxBf+AHBPVlumJel18CoFaqnsq9/5R/fva28MLs=; b=SvGM7GFFl5uFII2d0L7WcjouzXmjkmx/amw6Q7S65ISrhqO216Qr8oqRa8TqyactUo O68R3U1vd7SFvXzqf6A1Vp139GafNnLzqLTPVwIT70foRkR3KOb5AXBmGgDwthOa/AvV ajnV17CVAmOXl6n47iMX4pormd8UgIDdMd0VTo6dgXAjs+kFbUQslHC20Vu52ZXVdFlV arfBgV4j39jKaDac0chsIdKf6mrJkCtxchnNF4YfYU/A6hsFVipO4YzGPNGw6FAP++rq MlOk4JZUYyKd1fCKg0OseErmpjTMhZ38wcQ8u3TxQytuCSCfh9/U+EJXl6O5wCL1MF3u lslQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709040800; x=1709645600; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=joGUYxBf+AHBPVlumJel18CoFaqnsq9/5R/fva28MLs=; b=vIMJQKLqUPV7yVNlqHpGQfZmil0IrQKMGzfu+kbE5yqZ/xPvSqhYUZgFpXgAg9rlLT ULflz+ilr//QtSbzzjbq0ok+kMXJGRDMwEx+fiEv9RBYZh+d57Ct9SlYQYNIzyJbYr4r zp6xayCA1c6AlqbqeZV/jGcwE6pb/+km0QK59lJ9ZjlQSwyH34MhCodG8x4O9lGGQBof lLveC5MsC+BSbXA0xRYVnhyvX2gM0V+VGxGV4RHU/Ey5ktBLay6KgWdAvyaImwe+jBkL LmxWB2CgLQPL977mFu2jmr2+y4md5O7ksUOe7LcazEkYC6SR/zE6mnNlIJE3dDg4ooZA qP8w== X-Gm-Message-State: AOJu0YzxUi2/BvHFwMv1nfIgl93tnFoXrZAmk4BhvvEaFOnhUNkRMjVu BcQxVbZDZ0FAmAtbRNJGpJMyhxDodXp2c7bdAEnSyQ3mRn9KP8mvymfH5U8h9+MU2FBW77UM2mT o X-Received: by 2002:a5d:64e9:0:b0:33d:db7a:f8c1 with SMTP id g9-20020a5d64e9000000b0033ddb7af8c1mr4125271wri.48.1709040800397; Tue, 27 Feb 2024 05:33:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id i13-20020adfe48d000000b0033ae7d768b2sm11319552wrm.117.2024.02.27.05.33.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 05:33:20 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/45] pl031: Update last RTCLR value on write in case it's read back Date: Tue, 27 Feb 2024 13:32:38 +0000 Message-Id: <20240227133314.1721857-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227133314.1721857-1-peter.maydell@linaro.org> References: <20240227133314.1721857-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Jessica Clarke 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. Cc: qemu-stable@nongnu.org Signed-off-by: Jessica Clarke Reviewed-by: Alex Bennée Message-id: 20240222000341.1562443-1-jrtc27@jrtc27.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/rtc/pl031.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c index 837b0bdf9bd..563bb4b446e 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 = object_get_canonical_path(opaque); struct tm tm; + s->lr = value; s->tick_offset += value - pl031_get_count(s); qemu_get_timedate(&tm, s->tick_offset);