Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2217534/?format=api
{ "id": 2217534, "url": "http://patchwork.ozlabs.org/api/patches/2217534/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260330053008.2721532-1-zhao1.liu@intel.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260330053008.2721532-1-zhao1.liu@intel.com>", "list_archive_url": null, "date": "2026-03-30T05:30:08", "name": "[for,v11.0] hw/acpi: Do not save/load cpuhp state unconditionally", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "be53ae29d46426e3222676573edd5e2f68f4e06b", "submitter": { "id": 86545, "url": "http://patchwork.ozlabs.org/api/people/86545/?format=api", "name": "Zhao Liu", "email": "zhao1.liu@intel.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260330053008.2721532-1-zhao1.liu@intel.com/mbox/", "series": [ { "id": 497953, "url": "http://patchwork.ozlabs.org/api/series/497953/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=497953", "date": "2026-03-30T05:30:08", "name": "[for,v11.0] hw/acpi: Do not save/load cpuhp state unconditionally", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497953/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2217534/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2217534/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=AvA+SGUN;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fkfMP3X69z1xrn\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 16:05:20 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w74nZ-0008Uc-8Q; Mon, 30 Mar 2026 01:04:25 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <zhao1.liu@intel.com>)\n id 1w74nP-0008UJ-Jp\n for qemu-devel@nongnu.org; Mon, 30 Mar 2026 01:04:15 -0400", "from mgamail.intel.com ([192.198.163.8])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <zhao1.liu@intel.com>)\n id 1w74nM-0000tk-Ko\n for qemu-devel@nongnu.org; Mon, 30 Mar 2026 01:04:15 -0400", "from fmviesa010.fm.intel.com ([10.60.135.150])\n by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 29 Mar 2026 22:04:06 -0700", "from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39])\n by fmviesa010.fm.intel.com with ESMTP; 29 Mar 2026 22:04:04 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1774847052; x=1806383052;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=uB5hZL02kf+UCJUlzQM8BF3GydpZBlRmoe2BMjmxlsI=;\n b=AvA+SGUNiffDcaJqVpHGFucYLJ+d7hMNjthYVnciL7jwtAog42mh2N6D\n t/nkAGo9UF6q1GJYNhG8NJ87JsjUGtx+LSSPEErCd+W5f71GQOH1EVVPL\n A8/r0onSysjqsbNoI7HC+B+7wnSTG8eL4sEL4S6XlJu6LLJVJcs5gndBL\n sZZXRBugtcKGGZFGY80p0hFSC5MeVLmmq86I0g83LBx9pj5CkB1Ys28hW\n SzvrSi64Nyvj8RrB9nZYsnx69Gf1KJi5AStCqZOP6eE0OfQWtxyrPnur5\n pRYk0NUYlOc5V49nLFUjipdjI167Z8wf4AEG5u7dBJ/5azrQpynqbkMSD Q==;", "X-CSE-ConnectionGUID": [ "s94FMtI9SRGDCEIEytoW1A==", "SUP2hOa6Q2aQQouqXL9Eog==" ], "X-CSE-MsgGUID": [ "/AoxKB54QNS23MT6IcB2qA==", "23G4wYxrS96onc0sYqKpjQ==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6800,10657,11743\"; a=\"93410530\"", "E=Sophos;i=\"6.23,149,1770624000\"; d=\"scan'208\";a=\"93410530\"", "E=Sophos;i=\"6.23,149,1770624000\"; d=\"scan'208\";a=\"221547545\"" ], "X-ExtLoop1": "1", "From": "Zhao Liu <zhao1.liu@intel.com>", "To": "Igor Mammedov <imammedo@redhat.com>,\n \"Michael S . Tsirkin\" <mst@redhat.com>,\n Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, =?utf-8?q?Philippe_Mathieu-D?=\n\t=?utf-8?q?aud=C3=83?= <philmd@linaro.org>, Ani Sinha <anisinha@redhat.com>,\n Aurelien Jarno <aurelien@aurel32.net>,\n Peter Maydell <peter.maydell@linaro.org>", "Cc": "qemu-devel@nongnu.org,\n\tZhao Liu <zhao1.liu@intel.com>", "Subject": "[PATCH for v11.0] hw/acpi: Do not save/load cpuhp state\n unconditionally", "Date": "Mon, 30 Mar 2026 13:30:08 +0800", "Message-Id": "<20260330053008.2721532-1-zhao1.liu@intel.com>", "X-Mailer": "git-send-email 2.34.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=192.198.163.8; envelope-from=zhao1.liu@intel.com;\n helo=mgamail.intel.com", "X-Spam_score_int": "-28", "X-Spam_score": "-2.9", "X-Spam_bar": "--", "X-Spam_report": "(-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=1, SPF_HELO_NONE=0.001,\n 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 <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "Commit 7aa563630b6b (\"pc: Start with modern CPU hotplug interface\nby default\") removed the .needed callback (vmstate_test_use_cpuhp)\nfrom vmstate_cpuhp_state in both piix4.c and ich9.c.\n\nHowever, PIIX4 is also used by non-PC boards - MIPS Malta, which does\nnot select CONFIG_ACPI_CPU_HOTPLUG. For MIPS Malta, the linker resolves\nvmstate_cpu_hotplug to the stub one in acpi-cpu-hotplug-stub.c, which is\na zero-initialized VMStateDescription with .fields == NULL.\n\nBefore commit 7aa563630b6b, .needed() of PIIX4's vmstate_cpuhp_state\nreturned false for MIPS Malta since PIIX4PMState always initialized the\nfield cpu_hotplug_legacy as true. Malta implicitly relies on this\ninitial value to bypass vmstate_cpuhp_state. However, this is unstable\nbecause Malta itself does not support CPU hotplugging, whether via the\nlegacy way or the modern way.\n\nCommit 7aa563630b6b removed .needed() check for vmstate_cpuhp_state,\nthis broke the existing dependency that Malta had relied on, forcing\nMalta to save and load vmstate_cpuhp_state during the save/load process,\nwhich in turn caused a segmentation fault due to NULL fields in the\nstub-compiled code.\n\nFix this by bringing back the .needed = cpuhp_needed callback for\nvmstate_cpuhp_state of PIIX4, that checks\nMachineClass::has_hotpluggable_cpus. Boards that do not support CPU\nhotplug (only MIPS Malta) will skip this subsection entirely, which\nis both correct and consistent with the previous behavior.\n\nAt the same time, add a similar .needed() check to ICH9. Although no\nboards with ICH9 are affected by this issue, this helps avoid potential\nissues in the future.\n\nReproducer (MIPS Malta):\n $ qemu-img create -f qcow2 dummy.qcow2 32M\n $ qemu-system-mipsel -nographic \\\n -drive if=none,format=qcow2,file=dummy.qcow2\n [Type \"C-a c\" to get the \"(qemu)\" monitor prompt)]\n (qemu) savevm foo # segfault\n\nReported-by: Peter Maydell <peter.maydell@linaro.org>\nFixes: 7aa563630b6b (\"pc: Start with modern CPU hotplug interface by default\")\nSigned-off-by: Zhao Liu <zhao1.liu@intel.com>\n---\nTested with the following cases:\n * savevm for MIPS Malta\n * i386 migration:\n pc v10.2 (before 7aa563) <-> pc v10.2 (with this fix)\n q35 v10.2 (before 7aa563) <-> q35 v10.2 (with this fix)\n pc v10.2 (w/o this fix) <-> pc v10.2 (with this fix)\n q35 v10.2 (w/o this fix) <-> q35 v10.2 (with this fix)\n pc v11.0 (w/o this fix) <-> pc v11.0 (with this fix)\n q35 v11.0 (w/o this fix) <-> q35 v11.0 (with this fix)\n---\n hw/acpi/ich9.c | 8 ++++++++\n hw/acpi/piix4.c | 8 ++++++++\n 2 files changed, 16 insertions(+)", "diff": "diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c\nindex bbb1bd60a206..5c7dfb2c69db 100644\n--- a/hw/acpi/ich9.c\n+++ b/hw/acpi/ich9.c\n@@ -184,10 +184,18 @@ static const VMStateDescription vmstate_tco_io_state = {\n }\n };\n \n+static bool cpuhp_needed(void *opaque)\n+{\n+ MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());\n+\n+ return mc->has_hotpluggable_cpus;\n+}\n+\n static const VMStateDescription vmstate_cpuhp_state = {\n .name = \"ich9_pm/cpuhp\",\n .version_id = 1,\n .minimum_version_id = 1,\n+ .needed = cpuhp_needed,\n .fields = (const VMStateField[]) {\n VMSTATE_CPU_HOTPLUG(cpuhp_state, ICH9LPCPMRegs),\n VMSTATE_END_OF_LIST()\ndiff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c\nindex 43860d122780..9b7f50c7afac 100644\n--- a/hw/acpi/piix4.c\n+++ b/hw/acpi/piix4.c\n@@ -195,10 +195,18 @@ static const VMStateDescription vmstate_memhp_state = {\n }\n };\n \n+static bool cpuhp_needed(void *opaque)\n+{\n+ MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());\n+\n+ return mc->has_hotpluggable_cpus;\n+}\n+\n static const VMStateDescription vmstate_cpuhp_state = {\n .name = \"piix4_pm/cpuhp\",\n .version_id = 1,\n .minimum_version_id = 1,\n+ .needed = cpuhp_needed,\n .fields = (const VMStateField[]) {\n VMSTATE_CPU_HOTPLUG(cpuhp_state, PIIX4PMState),\n VMSTATE_END_OF_LIST()\n", "prefixes": [ "for", "v11.0" ] }