From nobody Mon Apr 13 12:33:19 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=1772897279; cv=none; d=zohomail.com; s=zohoarc; b=kkpa68ErRQoM21Vw0GHH/iMt86TS21P9A4hHgQ2A2p+xr5KIy9Q4G6wHhQiwFjHAIOe67Gt5CGyzPczsjBp1hLNtr1JlTnOJiHGMG31htF2mZWqk6IR5UDjB6PT4KtXv63L1pGVtfxePQGeXwfGkW9iZv45raxDhl1pU/pxeKGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772897279; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=i5IyQN2SJFLJ6QDcX5nSCyHv0PTm61zI92Uq2QIvVm4=; b=gnWtCTrDjLjTqd0dGJ0lfze6N+55bjM8n8dcJbswDLD8SX/gsI6R01dWOIrN5uyKVo15cc3zgbL4P/IzRBhkXZ4o5jjssC2/ZyeFeuEyQd/GGAdGE1bTfCFguHSgYyaOylyOvsCaTzeJ8Ljaz2pzMninsiIz/qrzGTsDTLrHePA= 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 1772897279767315.21373731392964; Sat, 7 Mar 2026 07:27:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vytYe-00050Y-7p; Sat, 07 Mar 2026 10:27:12 -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 1vytYb-0004ze-7r for qemu-devel@nongnu.org; Sat, 07 Mar 2026 10:27:09 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vytYZ-00085a-F1 for qemu-devel@nongnu.org; Sat, 07 Mar 2026 10:27:09 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-439c944bb62so2981998f8f.3 for ; Sat, 07 Mar 2026 07:27:07 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439dae2b9d8sm12464452f8f.21.2026.03.07.07.27.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 07 Mar 2026 07:27:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1772897226; x=1773502026; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i5IyQN2SJFLJ6QDcX5nSCyHv0PTm61zI92Uq2QIvVm4=; b=yeYYQtBzfmGHAO6WYKPxAOHcCEbRjOh5IQXmOrm07ZdtnZHji65M99hmhQuFc7RPgE FudJA/+ckOqHH/Lv0W9o5O4DSg3VvaEu27g5UQterJ5xYJTTCBcvm+rmHUAJWICW797y 7sShfIs0KWnpiP4O1/rqW9j8oGSWrd/7ZFYN9qmIlXSVaH57Nr8GeGY/ZOxvG+rTO/5J qnNR95S636WzakDWNOJFwZ8ru37n/KzOiag4bYeGhaj6yTKVtbPiK8L1BbD8nRwQ7OOA fAwR+2ry2eZk7ezCiIbOnAZTYY7geFkjSJllSQMtl03SszPhExXhBAsNbpAmUmXFqtqG uzKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772897226; x=1773502026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=i5IyQN2SJFLJ6QDcX5nSCyHv0PTm61zI92Uq2QIvVm4=; b=NY4V4d9d8UuJLRsABJ6HTZT2R+zy0rlsvxtPi/YN9enV5IawZDEAIQQoZ1Wb9WIa8q Ci4xRuztbE11kc1Ij9rgaknzUSH/M1NVKpzyI4d6uxxbbRyNzPa3Xc/pMM2PVQR/TwAv mIiBnrjfUENnk0+98tigvHqE+aA7s8ntoXKk/mCjd4qAFKq2SGu0mYPhvonYgE65PN/i /t3RbNmF8h3gUyuYYcOnFO+BZBuhLaBfEFtKCn+kWEcTggF68tAzDgB4Jv/D9gcfqBnG dyNeinXOuly8OfDy9XH+gjdpPdIpC9Q/0dKma2qNmmBROiCYqvBzoWUkrsE9MJeWuhKK aghQ== X-Gm-Message-State: AOJu0Yw6CSiGKf8d0tTKH7nBacov3gCj257FC2PAy1So44Noy4pwuoF2 ujmWg76oqaFq6EwIA9dep+MeNdTDvGcO8TfiIktq6JJVQKzzU9AD4bePmSvuC8luT7dYMT579Vh mkldqSk4= X-Gm-Gg: ATEYQzzla87Bk6jmUvKEkp5Zqtabicd247fqdy2bWS2zxXn8C9BIfvdqA0kS7kApnLi EGrufQiJ4M0V6pxHxZJn+RQh1JTNKJuK1/FpkpvPjPWYZTdtdqmLaplp/gtJ0m8K03jv1q2m2Oq vmDNtfZqtFDeIzZqwj/eHoByAd8rrwrspVw03Whye8FUaET8Q3i+XCTQSYj5mrF2xc3LetuzboP A3MxBJqy6gBUWrVkMa8Xp+NpOmanZrVlvbkbx/LaVcvWFCDS9sLhyJf2OjqhB6yO3ONS/m4escB XVHAg0qs7lpaRjrXYJh1DpZoXaUsEc/g21KjKJ2QelDI9i1lPJJZxYJMgfSOryQhE9Se6amWMeX NMcoPNSx3Yz01mq/Deb4cjkRgyJWH6IEPONzvHyY8XXobvfrL0YxAk+TdMoLQzHZevMCCLfswWJ qJNrpDmgTfb3kQoiMROWGV7Lftlu/IuaAbn2tQe7A5VKbU7FC+pPXNHTGnOYUkjmrTQ6qENjqw X-Received: by 2002:a05:6000:4301:b0:439:bce5:64fb with SMTP id ffacd0b85a97d-439da6578d6mr9835670f8f.23.1772897225598; Sat, 07 Mar 2026 07:27:05 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , "Michael S. Tsirkin" , Igor Mammedov , =?UTF-8?q?Cl=C3=A9ment=20Mathieu--Drif?= , Paolo Bonzini , Stefan Berger , Ani Sinha , Thomas Huth , Aurelien Jarno , Marcel Apfelbaum , Corey Minyard , Eduardo Habkost , Yanan Wang Subject: [PATCH 04/10] hw/core/boards: Remove MachineClass::smbus_no_migration_support field Date: Sat, 7 Mar 2026 16:26:28 +0100 Message-ID: <20260307152635.83893-5-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260307152635.83893-1-philmd@linaro.org> References: <20260307152635.83893-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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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: 1772897281538158500 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 --- 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.52.0