From nobody Sat Jul 25 17:35:18 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=163.com ARC-Seal: i=1; a=rsa-sha256; t=1784121584; cv=none; d=zohomail.com; s=zohoarc; b=Yr/++okXv6OgtZSIxCzw15Ax1fmoen+GbAOhdBpTzYEDfvlvQQFC7YK3owAoFzj57h9gO4/HeWORiHitwq3US4nbj4P7TaOJnfOKEnoNiOLSntX2tKkyk0PRxUGFVqK1r//MKUWrH4DIcu9d3Ayx6pYO0L2KHVIaFBkaM+WMdu0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784121584; h=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=OEsWXniuKuS7Dv64452nhmMS0A0cBn43enStB4hf4kg=; b=drk0LA/NLY38OPcctkI7Mz0KOiFMqGnIfYtOoaYC+KnGA9itsNvNVeL515BvYu9u7MmxWtyBa5dMQVq3xrAhtteKFR4AZvZjDx9/+/Ynp7sP7fEpK+ZafvcXu9GP/Szs4Ca1A8pI01oPeEXB2x0wmn/BSDyWtAOKoH7jCfLBCi0= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1784121584244637.3275904688743; Wed, 15 Jul 2026 06:19:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wjzVj-0004uA-Hk; Wed, 15 Jul 2026 09:18:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wjzVh-0004sp-5l; Wed, 15 Jul 2026 09:18:49 -0400 Received: from m16.mail.163.com ([117.135.210.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wjzVc-0003wD-0n; Wed, 15 Jul 2026 09:18:48 -0400 Received: from dt-VM.localdomain (unknown []) by gzga-smtp-mtada-g1-0 (Coremail) with SMTP id _____wD3f9ieiFdqI6DwJA--.41397S3; Wed, 15 Jul 2026 21:18:23 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=OE sWXniuKuS7Dv64452nhmMS0A0cBn43enStB4hf4kg=; b=YUdZh0/V7UwDKWDUs1 u1TAiLAauf3cBGl0yJRgVm8nMJJ11ZqtP8RG/mow3N5y0IomDjK9jqHCtHAzRliB E0ffqXY68QEWkqJisCcDQ6NINrd4GSeHBaqvazRMa2LwLCfTyuQgOt1OBdQlcbSZ XEOp21IQ98zTmezjVaGU9wUNw= From: Tao Ding To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, marcandre.lureau@redhat.com, pbonzini@redhat.com, Tao Ding Subject: [PATCH 1/1] hw/char: imx_serial: add missing migration state Date: Wed, 15 Jul 2026 21:18:19 +0800 Message-ID: <20260715131819.14827-2-dingtao0430@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260715131819.14827-1-dingtao0430@163.com> References: <20260715131819.14827-1-dingtao0430@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wD3f9ieiFdqI6DwJA--.41397S3 X-Coremail-Antispam: 1Uf129KBjvJXoWxJr43WryxWryDCFWrWF4DJwb_yoW5Jr18pr 4Utr45KrWkAFn8Aa18Z3W3ur4rKFsY93W7CryxXwnYk3W5tr1Sy342yayI93s3JrWvkw1a vFZ2yry2vw1qy3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0ziPkuxUUUUU= X-Originating-IP: [119.4.20.225] X-CM-SenderInfo: pglqw3tdrqkjqq6rljoofrz/xtbC4R+592pXiJ-0RwAA3p 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=lists1p.gnu.org; Received-SPF: pass client-ip=117.135.210.5; envelope-from=dingtao0430@163.com; helo=m16.mail.163.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=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 @163.com) X-ZM-MESSAGEID: 1784121586086158500 Content-Type: text/plain; charset="utf-8" Add ucr2 from imx_serial to vmstate, and increment the version_id. Migrating on sabrelite can reproduce this issue: 1. Prepare the U-Boot required for sabrelite. (according to sabrelite.rst) 2. Compile qemu $ mkdir build && cd build && ../configure --target-list=3D"arm-softmmu"= && make -j4 3. Start sabrelite and prepare for migration $ ./build/qemu-system-arm -M sabrelite \ -smp 1 -m 1G -display none -serial null -serial mon:stdio \ -kernel ~/u-boot 4. Enter qemu monitor after uboot. (ctrl + a + c) (qemu) stop (qemu) xp /4wx 0x021e8084 021e8084: 0x00004027 0x00000784 0x00008000 0x00000a01 (qemu) migrate -d file:vmstate (qemu) q Load the migrated vmstate, before repairing: $ ./build/qemu-system-arm -M sabrelite \ -smp 1 -m 1G -display none -serial null -serial mon:stdio \ -kernel ~/u-boot -incoming file:vmstate (ctrl + a + c) QEMU 11.0.50 monitor - type 'help' for more information (qemu) xp /4wx 0x021e8084 021e8084: 0x00000004 0x00000784 0x00008000 0x00000a01 (qemu) q It can be found that the data for address 0x021e8084 (register of usr2 in i= mx_serial of sabrelite)=20 is not the data before the migration. After being repaired: $ ./build/qemu-system-arm -M sabrelite \ -smp 1 -m 1G -display none -serial null -serial mon:stdio \ -kernel ~/u-boot -incoming file:vmstate (ctrl + a + c) QEMU 11.0.50 monitor - type 'help' for more information (qemu) xp /4wx 0x021e8084 021e8084: 0x00004027 0x00000784 0x00008000 0x00000a01 Signed-off-by: Tao Ding --- hw/char/imx_serial.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/char/imx_serial.c b/hw/char/imx_serial.c index 080b7f6331..fb41ee2ac5 100644 --- a/hw/char/imx_serial.c +++ b/hw/char/imx_serial.c @@ -43,14 +43,15 @@ =20 static const VMStateDescription vmstate_imx_serial =3D { .name =3D TYPE_IMX_SERIAL, - .version_id =3D 3, - .minimum_version_id =3D 3, + .version_id =3D 4, + .minimum_version_id =3D 4, .fields =3D (const VMStateField[]) { VMSTATE_FIFO32(rx_fifo, IMXSerialState), VMSTATE_TIMER(ageing_timer, IMXSerialState), VMSTATE_UINT32(usr1, IMXSerialState), VMSTATE_UINT32(usr2, IMXSerialState), VMSTATE_UINT32(ucr1, IMXSerialState), + VMSTATE_UINT32(ucr2, IMXSerialState), VMSTATE_UINT32(uts1, IMXSerialState), VMSTATE_UINT32(onems, IMXSerialState), VMSTATE_UINT32(ufcr, IMXSerialState), --=20 2.43.0