From patchwork Thu Jan 20 15:16:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 533595 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp180867imr; Thu, 20 Jan 2022 13:31:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMROd9XVWzmoz18SUmJYQ81hkXQjelc9G+eIHFvR2txAFbrT6VKk+Wz7HUjXpA4/IKX7/V X-Received: by 2002:a05:622a:1a0c:: with SMTP id f12mr952923qtb.118.1642714315814; Thu, 20 Jan 2022 13:31:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642714315; cv=none; d=google.com; s=arc-20160816; b=tBMOkCKQCPYDGvsL+9qZG/7PZDLn8lqjotvrd+uVv3OXO4E6omgwMoMWwN/Pp6b4XR jXncIqnau6c3LCom142/hvtWceSluL3e2EunmKnHTtKPNjvkveYg2QL3Q/h7HHR+EEzv 6Pdx2g3g/MuCKTJtB0YpsK6rwOzMIOBvTIbA6PkUNCXgRzOlNwN1t4qM0oLasZvDNwv9 F/j7CebTP15YpMOzgSUTkxbq4L/4UlvgQTYCtyr304mByuGzSX7JyGva7KVRxF/htcPd okGQ7CzmjBSC54GZoGUTR3JrsKVF38Abjz3QBs3FaUCQAA3FXITI8dczbOi92Q0NcZMm tRog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=FcNzRDDLqUXh8SKulDhEdj/nqpA2o3Dbwbq+sgN0vNg=; b=dyW16QvYA8vcvYBUaDlR0IIBJfOex8qMw+QTujHYIYErgH1GieK47uetVb6U2x8nhr sOPCpAJLUfQ3+Wvt31kBQn/HFWl6wqadCoUTo15oiBmDUutkFRsuQQOxT88aHTKrrZv6 3UamHlmj7O6sgj3AfQhosou9940bU8UGjbSsA9ngA0aJau3BZPTkUqLT5PsanEO9wC/N cI+LjMlntVeeRRJW103W8pxPCHIYKLXMXJecZfQjUf1owpBHoviZfZj6ycQjilNMzChK GrkXGPG076P2fgVuZqAqqlR2lcLfF+BBFETHgz3DQpLRYZLDu5AbhPZiNQb8KJqBgP4n Bh1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZewIxEA1; 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 207si536526ywu.171.2022.01.20.13.31.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Jan 2022 13:31:55 -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=ZewIxEA1; 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]:59354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAf2B-000810-9o for patch@linaro.org; Thu, 20 Jan 2022 16:31:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAZB3-0007iH-TB for qemu-devel@nongnu.org; Thu, 20 Jan 2022 10:16:44 -0500 Received: from [2a00:1450:4864:20::332] (port=43972 helo=mail-wm1-x332.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAZAz-0003OX-Nm for qemu-devel@nongnu.org; Thu, 20 Jan 2022 10:16:41 -0500 Received: by mail-wm1-x332.google.com with SMTP id e9-20020a05600c4e4900b0034d23cae3f0so14515455wmq.2 for ; Thu, 20 Jan 2022 07:16:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FcNzRDDLqUXh8SKulDhEdj/nqpA2o3Dbwbq+sgN0vNg=; b=ZewIxEA1BzNUxoMoJEmAuxr2QDpTFmGWoYpJhbBxjTHst0Z9BhlCyAEfmvybhhiPNW pwBEMEGdRcRBjDWvAPsMG7GeZyv2Hx3FHcW8Z6bMH3LO2NpSzKL7oHCwHN9f8sZEQoIN NBgjUzSj67EPZacOugUlRryQ45LqZ0xtoQivt7rWFUeF1KEzpJm1AftJA6r7vx4E20L4 xRNJ+74j5R1437gorGJX3I/NDNFiIUlPoDvE2zKa/8+GlI9fafHWu3787kIcXWz+UDn1 QePcpkpEAW+tsOHaCJC06ZRax3M1/CaiLJYVTyDn/PwxBWDjBvc6N7Uda9lwKV85Emy6 r8rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FcNzRDDLqUXh8SKulDhEdj/nqpA2o3Dbwbq+sgN0vNg=; b=SnyLUeqelsVuiV7dLxUuVOhS+84mor1WEDX+4zIIOkZPIMacu41qmo3oQq482uyCDF x1Ya0U74WEhqCfu1DW9YiPW9yEH3XYogQwkTzeIEaxQnmFGRjJ5uZVf9FfR7bY5m7nr6 iqFB9jV20Q+VfHoFJ7nSehUi3MiVGZZ5vw+RtIRdIcOaqzhZWzf3iYF059qfUaPVnF00 xnuvjJbjlayXi7oJYOkZz7bql24r1+TIAjaqnk7pvkAj3OLfiPrs2K7E7sjv4cXmQi3p EuAKtgUS+sMHHfbxinr7C/cWdJghAEeoWRpAzOZO77lpcWQhXP2vI6a3ay5X+rJS9Fne KfOg== X-Gm-Message-State: AOAM531cpQWyNyqwucC8J2ALFl1ISRO78QvKXD3IBcudccBli+FMJa8t 1EdL7n+NKjaMiOgagUbN4Zv0iw== X-Received: by 2002:a1c:7316:: with SMTP id d22mr9331490wmb.5.1642691771507; Thu, 20 Jan 2022 07:16:11 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id v5sm3984750wrx.114.2022.01.20.07.16.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 07:16:11 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH] hw/armv7m: Fix broken VMStateDescription Date: Thu, 20 Jan 2022 15:16:09 +0000 Message-Id: <20220120151609.433555-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::332 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: qemu-stable@nongnu.org, "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In commit d5093d961585f02 we added a VMStateDescription to the TYPE_ARMV7M object, to handle migration of its Clocks. However a cut-and-paste error meant we used the wrong struct name in the VMSTATE_CLOCK() macro arguments. The result was that attempting a 'savevm' might result in an assertion failure. Cc: qemu-stable@nongnu.org Buglink: https://gitlab.com/qemu-project/qemu/-/issues/803 Fixes: d5093d961585f02 Signed-off-by: Peter Maydell Reviewed-by: Ani Sinha Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- It's a shame there's no way to type-check that the struct name used in the VMSTATE macros is correct... --- hw/arm/armv7m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 8d08db80be8..ceb76df3cd4 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -520,8 +520,8 @@ static const VMStateDescription vmstate_armv7m = { .version_id = 1, .minimum_version_id = 1, .fields = (VMStateField[]) { - VMSTATE_CLOCK(refclk, SysTickState), - VMSTATE_CLOCK(cpuclk, SysTickState), + VMSTATE_CLOCK(refclk, ARMv7MState), + VMSTATE_CLOCK(cpuclk, ARMv7MState), VMSTATE_END_OF_LIST() } };