From patchwork Mon Feb 21 09:27:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 544427 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp3111799imn; Mon, 21 Feb 2022 01:59:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxsVYNSrpSj6QjaeJsgjMn/DEuzVMqELkJdO62uWpZR6gKtDDjFeVUBaCrjDDZwomRamNF4 X-Received: by 2002:a37:b4c6:0:b0:508:b101:75b9 with SMTP id d189-20020a37b4c6000000b00508b10175b9mr11562502qkf.550.1645437583022; Mon, 21 Feb 2022 01:59:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645437583; cv=none; d=google.com; s=arc-20160816; b=gTwA+CfifyVVz38ipyAT49FbfgXZXSyFPBep+CTSd41aT6/Liu0dFN47HStV+wrxjU DDkRyavBpEc5EX8owQvW56qiZXpHVZYB/FLemYOUGGYGa2JzC+5d5fscM0McaIj8B3R0 Upt4MNHn4lvWWiLBPIJRzJlg7seQe6W1WHUln1DZitz9QS21MHfod7MWY5dJ/Wpitul8 hqClToUhusRu7B3WO25oRKI5e/NUgVbqJ+5XH9zettxjUQ7BzvtyWGItUHIEExdoDqVX c/yp5OZNFXSqKDZFv6IsKyEqoOf55Bm0feNSb/kA0+GT9gDjtYOHqI5AXftr6WkTFPgK OfMQ== 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=iMXdQaYTq6z65Mtgg9aHLP5XjipTMw7NVjVyfg18JIE=; b=l/7+Lp87HfLRSMJ2clG5g619ThkFdPQE7y0Vp9Y+xI3uIkMnqXcgxrCNomw0aLyxmk PDsDe4dkEhl44JPfx5GaXZR5NYvHVMTA0GQR9TaTW8gFf2HdHjrq0qGk5/UmYEa/xJH2 4YjyrZmypH1EtTOvj3kiCAPHTNvd6GYa9A14hmB4qZ4BQCgdrf8bPMicD97MHg60aDCQ rJezGvuwj+8uZcWyfU9JSG5FI4IdscQRchYjwneTp4Q9QdGJWnWx7R9a7mXWNheXlkmt oMuU382TobuknRDqoWVP6TV9vU50jnRpqglL8jB/J0n0JOaHpgLdx4Mf+VMF4twurXc+ DEFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Umxc8GeS; 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 n8si6557842qtx.375.2022.02.21.01.59.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Feb 2022 01:59:43 -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=Umxc8GeS; 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]:36748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM5Tq-0002oB-K6 for patch@linaro.org; Mon, 21 Feb 2022 04:59:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM4zr-0000EU-6w for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:47 -0500 Received: from [2a00:1450:4864:20::42c] (port=36535 helo=mail-wr1-x42c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM4zZ-00013M-9v for qemu-devel@nongnu.org; Mon, 21 Feb 2022 04:28:42 -0500 Received: by mail-wr1-x42c.google.com with SMTP id o24so25919601wro.3 for ; Mon, 21 Feb 2022 01:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=iMXdQaYTq6z65Mtgg9aHLP5XjipTMw7NVjVyfg18JIE=; b=Umxc8GeSNitwwVItnKjCuq2IsWSGURRKTnRHhHLf4Y1nX0/CvKTlyGuN+4NWs4oaLc grXAfnaQfMs0OqBban+nzdZR77q8VW6RaZdQeWlL1WQE1QBS520fV2fZJiUgGbueT96r QrsJrBXVd5xF+ZvyumXYJsVfJaie3HUC9N8uxPYKDx0wOCYZpQVRN0fRTzdRqsnFLgjb PI8jSvgSQ1HGX0n9y6VGxQOu8Vpvi32WhQZbcnXedMY0Mata7z3fmTxpJWT9MsM34rCO i8tbdc1nNNt37zVB97PGapflKO8IirzgfVRa2KUmfl8R9eoVtkjhGreDuI58YNQ0PMZP +WbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iMXdQaYTq6z65Mtgg9aHLP5XjipTMw7NVjVyfg18JIE=; b=17Me5f+fhTYmiaiAYpa65qPDI/6lv7pnz6ddXONzFsNomc4quUqGWH/taThlDbotCR 3e8oaldJV9NL6WByzpUxP9Dj5tyM0ALavK45JcrUN3BVO3DYxNCE9Jw1M1OQmUcXMNI7 f97olMGSlnc2AKvp7w7Rbuuz6Px0etktjlwpFKvi8MuKBN5NytoVO20wnqf7O6UscePH cfEXDA2JzsOhKugpoJ76SClDnI4WYX+qeX9RwoVM0gH5iVdjEqaOnfFBL2x1qk52IepC CJhm/KXZmGboXSy7FP1EgpAsP8nIRT4hKLa/l6AXaB8rx/DKEYmuuFvxf8sp6LCmd5/Z XUZQ== X-Gm-Message-State: AOAM532Wiwn0UdyyUNYKHDPP3kZ0dHgtymRJs5V98QUTOwaotDArMcBo kadPExwkQESc+vJpHSZ3jEPHZzup0Hifkw== X-Received: by 2002:a5d:6482:0:b0:1e8:330e:e442 with SMTP id o2-20020a5d6482000000b001e8330ee442mr15166210wri.107.1645435700234; Mon, 21 Feb 2022 01:28:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id q76sm7555778wme.1.2022.02.21.01.28.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 01:28:19 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 22/26] hw/timer: fix a9gtimer vmstate Date: Mon, 21 Feb 2022 09:27:56 +0000 Message-Id: <20220221092800.404870-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220221092800.404870-1-peter.maydell@linaro.org> References: <20220221092800.404870-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42c (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Pavel Dovgalyuk A9 gtimer includes global control field and number of per-cpu fields. But only per-cpu ones are migrated. This patch adds a subsection for global control field migration. Signed-off-by: Pavel Dovgalyuk Message-id: 164422345976.2186660.1104517592452494510.stgit@pasha-ThinkPad-X280 Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/timer/a9gtimer.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c index 7233068a37f..5e959b6d09f 100644 --- a/hw/timer/a9gtimer.c +++ b/hw/timer/a9gtimer.c @@ -318,6 +318,12 @@ static void a9_gtimer_realize(DeviceState *dev, Error **errp) } } +static bool vmstate_a9_gtimer_control_needed(void *opaque) +{ + A9GTimerState *s = opaque; + return s->control != 0; +} + static const VMStateDescription vmstate_a9_gtimer_per_cpu = { .name = "arm.cortex-a9-global-timer.percpu", .version_id = 1, @@ -331,6 +337,17 @@ static const VMStateDescription vmstate_a9_gtimer_per_cpu = { } }; +static const VMStateDescription vmstate_a9_gtimer_control = { + .name = "arm.cortex-a9-global-timer.control", + .version_id = 1, + .minimum_version_id = 1, + .needed = vmstate_a9_gtimer_control_needed, + .fields = (VMStateField[]) { + VMSTATE_UINT32(control, A9GTimerState), + VMSTATE_END_OF_LIST() + } +}; + static const VMStateDescription vmstate_a9_gtimer = { .name = "arm.cortex-a9-global-timer", .version_id = 1, @@ -344,6 +361,10 @@ static const VMStateDescription vmstate_a9_gtimer = { 1, vmstate_a9_gtimer_per_cpu, A9GTimerPerCPU), VMSTATE_END_OF_LIST() + }, + .subsections = (const VMStateDescription*[]) { + &vmstate_a9_gtimer_control, + NULL } };