From nobody Sat Apr 11 23:04:21 2026 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=1773071605; cv=none; d=zohomail.com; s=zohoarc; b=csQVMayJ3t6APvzT4m6CN8QVTsv1ppCi2jj+I5M1Pkaajkks9NKt0252rKjgOflh2u6eccPtoobB00FgyLC9PRRX/CqovVzxeKDp++Go2XPySDRP9rxQPLJ3hV/D8PwYd/WXD+yWqxCNRRIt4Rbk3WlluxlXG9JX6/qAuuyymhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773071605; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=UjlYj7EvBnMKHImEQ8XvxuaNoxFu0RUHBwONjSEDr6Y=; b=kVf8OtVirU+Q+PIJRrUksuYG0b7FYhsKLeNX4yYeGdyAQcqiCFz85bkz02FuF30ASh2hs8Hc36qaDS/qDxaYSIE7ow7YQCm0cVmnFTYzP/gl+krs86w9Rbe0bZ+624L7LcKgCBKFFCF++XDnwPpaGf9czVBNv0QFjFcltPVSDwI= 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) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1773071605112104.17643252280175; Mon, 9 Mar 2026 08:53:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vzcus-0003lO-CN; Mon, 09 Mar 2026 11:53:10 -0400 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 1vzcuj-0003XY-6Q for qemu-devel@nongnu.org; Mon, 09 Mar 2026 11:53:02 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vzcug-0008AE-Um for qemu-devel@nongnu.org; Mon, 09 Mar 2026 11:53:00 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-48534237460so18198695e9.3 for ; Mon, 09 Mar 2026 08:52:57 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-485419c2930sm2739455e9.0.2026.03.09.08.52.54 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Mar 2026 08:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773071576; x=1773676376; 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=UjlYj7EvBnMKHImEQ8XvxuaNoxFu0RUHBwONjSEDr6Y=; b=WURiTKvcRwwzHW+kRYmrHgJ6Wcqhsozd5mMYeRNk8eu2B3ptH50bfD6B4ho97EOdh0 wk34Etsb1DS0zQcyHP4Tnha2Grizxu6hB6Nh0MZvwwmH/VW7KuKv2uEPyIJSuFbuJdgg 5QRwuIQKeeQBXrYmxdZAET/Gh0HzAZ9H24lsirMrwiLlSazTMSzpxRdXLtQKUAZDstIh jcMQrlMT3c9kGfgY2sUli5uurnJgfO/WneDgTcPK6V2d9ByhqO5jVQcg0hecW4a1CIuj WwgD/mviA2nIhA5D1/mIdfbluuMDX+Q0UpCehEeO8NWa8OgVNvi6kgySq+yMF/4/8549 Ca6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773071576; x=1773676376; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=UjlYj7EvBnMKHImEQ8XvxuaNoxFu0RUHBwONjSEDr6Y=; b=HmKFQP5p9T7fNv6vb/TQPQ79qpec+unSwJ04/wM4k3BFoqSk/T8ioSLM5GNHaHW7OF hPINoWufCGS5ChTfq4xEadgy3dLukZkL3xpBXxMqzN+NHJob1qpdeZD1BE6y4IUbvC6k q0RZqeEz3+wBXUGi1hxeolOfPHAk91k1841O+nTW1qVIo31ZO/MswGUSehKnMaUYyPNH Ku8ITb02Ijji+/m6MQhE+cFB7EYwNblZ5iuQ8UwCopDE7urEtgK2ANGE8QVvJR+93/5j Az426vpseY9l6Ylqc+1XCRFDsTq+SaZgVBqt/L4rPJSgdWGTUtRWCLxScD9W+cYw1qqp AEaQ== X-Gm-Message-State: AOJu0Yx0qVsrsVMwwanN1o1Y4mqBEofF8hzIuZgAhudKK7X7/MbdA17A iWwAMelF80VCViC71JDpp5+JHZciETb3eTA6gOxN68wisDfgE+Rsudx8YkZrjB6M4bQK/yNXT46 AgSw3Clg= X-Gm-Gg: ATEYQzw5dzpP+zmGdgSz9qKQRqKihWgKcdLjvxdY83kHu8HvcW9xULtqj+1+0q2O1Gl ffTfcyfn10xZ6JhPIXwwNazi/red6uqkFwmEeX9cNHpSq06ugDdBP+GlYgfbBESHl301nzlfl6I 6cmrDRtQuDBUxce3mzhQYYcPcprDKAIiKje3Z9KtoYoghL0Kd15rMAmh4dwt/BY7e3cu5+J5H0L 0p0spMz3NO9APxJy3dSDjkWMhmpcFKsV4QWpllvboTESMDk6dDwkzeiBy3rHl8PLZN5OBtRR5D6 pR+oJxwV4BgdkiFqcd1vzaxb+wkhtAZwAonknrIIKRvbS0Ynjbz8H5GhrMauBYzv04h0p+ua2ih bP22RiV2MTLuaqk9t/JErj1aP3f7i1yaaEq/ev/3MIqK1KnvpuW/MXY9d9xGyqKYi01ulPSzW1S eKbU873PvVcEDtQWXZp/bW8MHoRnX45yN98cUuTCc0uWai6ysMVkNFCN6xn1mEc0xJT7ENnZ9y X-Received: by 2002:a05:600c:310f:b0:485:390d:74f8 with SMTP id 5b1f17b1804b1-485390d7719mr77360355e9.25.1773071575711; Mon, 09 Mar 2026 08:52:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 05/49] hw/core/boards: Remove MachineClass::smbus_no_migration_support field Date: Mon, 9 Mar 2026 16:51:35 +0100 Message-ID: <20260309155219.62400-6-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260309155219.62400-1-philmd@linaro.org> References: <20260309155219.62400-1-philmd@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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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.29 Precedence: list List-Id: qemu development 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: pass (identity @linaro.org) X-ZM-MESSAGEID: 1773071606323154100 The MachineClass::smbus_no_migration_support boolean was only used by the pc-q35-3.1 and pc-i440fx-3.1 machines, which got removed. Remove it, along with pm_smbus_vmstate_needed(). Use the unconditional VMSTATE_BOOL() and VMSTATE_STRUCT() macros. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Acked-by: Corey Minyard Message-Id: <20260307152635.83893-5-philmd@linaro.org> --- include/hw/core/boards.h | 1 - include/hw/i2c/pm_smbus.h | 7 ------- hw/acpi/piix4.c | 8 +------- hw/i2c/pm_smbus.c | 7 ------- hw/i2c/smbus_eeprom.c | 4 +--- hw/i2c/smbus_ich9.c | 10 ++-------- 6 files changed, 4 insertions(+), 33 deletions(-) diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index 9ad2a7d5c97..e15dbcea83b 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -314,7 +314,6 @@ struct MachineClass { bool auto_enable_numa_with_memhp; bool auto_enable_numa_with_memdev; bool ignore_boot_device_suffixes; - bool smbus_no_migration_support; bool nvdimm_supported; bool numa_mem_supported; bool auto_enable_numa; diff --git a/include/hw/i2c/pm_smbus.h b/include/hw/i2c/pm_smbus.h index dafe0df4f69..62bbd45e803 100644 --- a/include/hw/i2c/pm_smbus.h +++ b/include/hw/i2c/pm_smbus.h @@ -44,13 +44,6 @@ typedef struct PMSMBus { =20 void pm_smbus_init(DeviceState *parent, PMSMBus *smb, bool force_aux_blk); =20 -/* - * For backwards compatibility on migration, older versions don't have - * working migration for pm_smbus, this lets us ignore the migrations - * for older machine versions. - */ -bool pm_smbus_vmstate_needed(void); - extern const VMStateDescription pmsmb_vmstate; =20 #endif /* PM_SMBUS_H */ diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 138ac3d3940..43860d12278 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -205,11 +205,6 @@ static const VMStateDescription vmstate_cpuhp_state = =3D { } }; =20 -static bool piix4_vmstate_need_smbus(void *opaque, int version_id) -{ - return pm_smbus_vmstate_needed(); -} - /* * This is a fudge to turn off the acpi_index field, * whose test was always broken on piix4 with 6.2 and older machine types. @@ -238,8 +233,7 @@ static const VMStateDescription vmstate_acpi =3D { VMSTATE_UINT16(ar.pm1.evt.en, PIIX4PMState), VMSTATE_UINT16(ar.pm1.cnt.cnt, PIIX4PMState), VMSTATE_STRUCT(apm, PIIX4PMState, 0, vmstate_apm, APMState), - VMSTATE_STRUCT_TEST(smb, PIIX4PMState, piix4_vmstate_need_smbus, 3, - pmsmb_vmstate, PMSMBus), + VMSTATE_STRUCT(smb, PIIX4PMState, 3, pmsmb_vmstate, PMSMBus), VMSTATE_TIMER_PTR(ar.tmr.timer, PIIX4PMState), VMSTATE_INT64(ar.tmr.overflow_time, PIIX4PMState), VMSTATE_STRUCT(ar.gpe, PIIX4PMState, 2, vmstate_gpe, ACPIGPE), diff --git a/hw/i2c/pm_smbus.c b/hw/i2c/pm_smbus.c index ead53d2724d..5654d516382 100644 --- a/hw/i2c/pm_smbus.c +++ b/hw/i2c/pm_smbus.c @@ -443,13 +443,6 @@ static const MemoryRegionOps pm_smbus_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 -bool pm_smbus_vmstate_needed(void) -{ - MachineClass *mc =3D MACHINE_GET_CLASS(qdev_get_machine()); - - return !mc->smbus_no_migration_support; -} - const VMStateDescription pmsmb_vmstate =3D { .name =3D "pmsmb", .version_id =3D 1, diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index d9ac556a0ab..693d4762205 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -88,11 +88,9 @@ static int eeprom_write_data(SMBusDevice *dev, uint8_t *= buf, uint8_t len) =20 static bool smbus_eeprom_vmstate_needed(void *opaque) { - MachineClass *mc =3D MACHINE_GET_CLASS(qdev_get_machine()); SMBusEEPROMDevice *eeprom =3D opaque; =20 - return (eeprom->accessed || smbus_vmstate_needed(&eeprom->smbusdev)) && - !mc->smbus_no_migration_support; + return eeprom->accessed || smbus_vmstate_needed(&eeprom->smbusdev); } =20 static const VMStateDescription vmstate_smbus_eeprom =3D { diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index 956c9b59bbc..51513e73fde 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -41,20 +41,14 @@ struct ICH9SMBState { PMSMBus smb; }; =20 -static bool ich9_vmstate_need_smbus(void *opaque, int version_id) -{ - return pm_smbus_vmstate_needed(); -} - static const VMStateDescription vmstate_ich9_smbus =3D { .name =3D "ich9_smb", .version_id =3D 1, .minimum_version_id =3D 1, .fields =3D (const VMStateField[]) { VMSTATE_PCI_DEVICE(dev, ICH9SMBState), - VMSTATE_BOOL_TEST(irq_enabled, ICH9SMBState, ich9_vmstate_need_smb= us), - VMSTATE_STRUCT_TEST(smb, ICH9SMBState, ich9_vmstate_need_smbus, 1, - pmsmb_vmstate, PMSMBus), + VMSTATE_BOOL(irq_enabled, ICH9SMBState), + VMSTATE_STRUCT(smb, ICH9SMBState, 1, pmsmb_vmstate, PMSMBus), VMSTATE_END_OF_LIST() } }; --=20 2.53.0