From nobody Tue Apr 15 10:55:53 2025 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1615228679; cv=none; d=zohomail.com; s=zohoarc; b=Z62LZrGcuAB7vQXENbGkMlkIH4SvYoX49KwAqY7YpDDbEVXTuKUWQsZV4H9TivFe1uS7gh6ytRK6Fj/xyWqJS9xu7Dy+LP1fVbPl99QSPcrv9Ood5dcimoSO+tcXHSNLyjOoP8pSAX51eEJTlfXMSE0Fb8paDUGmcKJptkK5C7o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615228679; h=Content-Type:Content-Transfer-Encoding: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=hBs2oe4YZMn4XESXoB2fTZGh7p5EasWVcofOAmRY3vE=; b=AKOfdkurWvX6gpUGuWrYq1hq2n30HQis0GWm0jRKyPhoiN+85UCKT721tjbFpx+P5E1Pj8G157rRSsPCARE+9spx+u2Hfv5c1IXKPxxAffi7VfWlSFdOwRuhn1JWo/yW89Sh85e4zuFdOQ8CQe3YZBfk3GqMe1aTHzSJ27+cTgI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615228679287995.6727756047156; Mon, 8 Mar 2021 10:37:59 -0800 (PST) Received: from localhost ([::1]:42772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJKlS-000464-3b for importer@patchew.org; Mon, 08 Mar 2021 13:37:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJJlF-0007ME-HW for qemu-devel@nongnu.org; Mon, 08 Mar 2021 12:33:41 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:34693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJJkq-00077x-NE for qemu-devel@nongnu.org; Mon, 08 Mar 2021 12:33:41 -0500 Received: by mail-wr1-x42f.google.com with SMTP id u16so12326426wrt.1 for ; Mon, 08 Mar 2021 09:33:14 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id i10sm18628217wrs.11.2021.03.08.09.33.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 09:33:13 -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=hBs2oe4YZMn4XESXoB2fTZGh7p5EasWVcofOAmRY3vE=; b=MxCINSFfoJTDwv8mg6xReCtAwmjEjPkpkBzXGKY4aoAXm0nsVyX7SFaRVz60XaToYy l5Z3u3qqBSVv19MnGc3x362AzYL572Gt11YLzlbKEPzWifk7FHa4Uz8lnB1EF//aVGPg A9G62o3I8C2bHrqpZ057daw7h5SHSJ5safzFM4seOdogx9coD5JvTz0uxDZlPeaKaD2w uo8E425XUlaSTOIMxBHIC6aEEO/u7ugH2VviH3SId+4dSbubPMRUOYeXUOvw3Iy+2tVc RED7UvKZzS3lrux7SnJ4sQqeF68WWYU1qFydv/b4CovYuNDGUBrUSxy1W6uGtaGJT+V4 eorw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hBs2oe4YZMn4XESXoB2fTZGh7p5EasWVcofOAmRY3vE=; b=JPlP+xClVSfRz4qkwc3bsEFIFTARXQL4E8e+AT75GYxuw80N+E6qiTGe/GMpKYRxp2 JX8yehuyI99SIQ92SMw1nva9fN/W7GrEVvtgnrF22a/n/ApR0ZuAJ7p0HfDoZ5D+V1S8 8vuIN2aUq86UGheV6DE3oUC9a3NQQesdri9NlZ1MUphDR4adyoILIP3DUD7h3zzXgXK/ eQSh9BVMcFZIhfUtqmLUgYr1HtIQWa7T/uQPJ/DRYmQyVd+LNo5osK19fayvn4Hjy9IA XeMcMeLqvYv0k390DTTqRnnff2SmpsDw+YXS65Anq3/kzvl3AEaJKAHTxG10SQY6fnAy Dxfg== X-Gm-Message-State: AOAM530buzVQ2t+AxRHoTFVynub7M7w8LUvm0mp1oJHV4yhgdbGi+dUP WO+gTup8uHy/Iqnuj6dVMvaa5467IzoGBQ== X-Google-Smtp-Source: ABdhPJzZ4zBCCHq83I6Mg63CQCY2Y94qUm/8hfR70aOZkKAdbipE5KwWn1uufccKKenh2vCeVvrIFQ== X-Received: by 2002:a5d:4592:: with SMTP id p18mr25657093wrq.244.1615224793937; Mon, 08 Mar 2021 09:33:13 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 37/54] hw/misc/mps2-fpgaio: Fold counters subsection into main vmstate Date: Mon, 8 Mar 2021 17:32:27 +0000 Message-Id: <20210308173244.20710-38-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308173244.20710-1-peter.maydell@linaro.org> References: <20210308173244.20710-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" X-ZohoMail-DKIM: pass (identity @linaro.org) We've already broken migration compatibility for all the MPS boards, so we might as well take advantage of this to simplify the vmstate for the FPGAIO device by folding the counters subsection into the main vmstate description. Signed-off-by: Peter Maydell Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-id: 20210219144617.4782-38-peter.maydell@linaro.org --- hw/misc/mps2-fpgaio.c | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/hw/misc/mps2-fpgaio.c b/hw/misc/mps2-fpgaio.c index f3db88ddcc8..72598c8a3d2 100644 --- a/hw/misc/mps2-fpgaio.c +++ b/hw/misc/mps2-fpgaio.c @@ -285,41 +285,21 @@ static void mps2_fpgaio_realize(DeviceState *dev, Err= or **errp) } } =20 -static bool mps2_fpgaio_counters_needed(void *opaque) -{ - /* Currently vmstate.c insists all subsections have a 'needed' functio= n */ - return true; -} - -static const VMStateDescription mps2_fpgaio_counters_vmstate =3D { - .name =3D "mps2-fpgaio/counters", +static const VMStateDescription mps2_fpgaio_vmstate =3D { + .name =3D "mps2-fpgaio", .version_id =3D 2, .minimum_version_id =3D 2, - .needed =3D mps2_fpgaio_counters_needed, .fields =3D (VMStateField[]) { + VMSTATE_UINT32(led0, MPS2FPGAIO), + VMSTATE_UINT32(prescale, MPS2FPGAIO), + VMSTATE_UINT32(misc, MPS2FPGAIO), VMSTATE_INT64(clk1hz_tick_offset, MPS2FPGAIO), VMSTATE_INT64(clk100hz_tick_offset, MPS2FPGAIO), VMSTATE_UINT32(counter, MPS2FPGAIO), VMSTATE_UINT32(pscntr, MPS2FPGAIO), VMSTATE_INT64(pscntr_sync_ticks, MPS2FPGAIO), VMSTATE_END_OF_LIST() - } -}; - -static const VMStateDescription mps2_fpgaio_vmstate =3D { - .name =3D "mps2-fpgaio", - .version_id =3D 1, - .minimum_version_id =3D 1, - .fields =3D (VMStateField[]) { - VMSTATE_UINT32(led0, MPS2FPGAIO), - VMSTATE_UINT32(prescale, MPS2FPGAIO), - VMSTATE_UINT32(misc, MPS2FPGAIO), - VMSTATE_END_OF_LIST() }, - .subsections =3D (const VMStateDescription*[]) { - &mps2_fpgaio_counters_vmstate, - NULL - } }; =20 static Property mps2_fpgaio_properties[] =3D { --=20 2.20.1