From nobody Fri Aug 28 00:12:50 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=quarantine dis=none) header.from=openvz.org ARC-Seal: i=1; a=rsa-sha256; t=1786732792; cv=none; d=zohomail.com; s=zohoarc; b=mrm0kgWUun6Eh4wDQ21RI8KZ7ciS5nq6OU3DbHvTp2QosEXtEWQYnbUroeu9uaRnj0HuKUOi/zZnok8lq+Tz4Xu4/cNXKEE3mZHX2tZDVFWOT74bjT49Ugr3ttN4P+b4DqpPlmkIzq7tIBk18Qcl+cAEVkojG6D3/tCMTKnUKME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1786732792; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=W2Mx3aydHoSpb8gvA1hKFXObL3SKPHYA2L1UoMCL1VU=; b=m5onasQAYzTvAB7Wa+vfDR0KbiKaugZ6BRq+3KhQI+yNv96pljmRgfh3JXwx8Z94dizKk8A8bIc0Q44IeVvncbxWmHIu05D686STghBoEHZcN0I8g+l+5QK47Zo2aLLJIFqQinAKYcOYGnZtXCNg6gaENq1oMd4tT7nAG5DJZQw= 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=quarantine dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1786732792968729.7274232193291; Fri, 14 Aug 2026 11:39:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wuwoG-0007pi-A2; Fri, 14 Aug 2026 14:39:16 -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 1wuwoD-0007oJ-LE for qemu-devel@nongnu.org; Fri, 14 Aug 2026 14:39:13 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wuwoA-0007F0-95 for qemu-devel@nongnu.org; Fri, 14 Aug 2026 14:39:13 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-49800c6a846so14457505e9.3 for ; Fri, 14 Aug 2026 11:39:04 -0700 (PDT) Received: from athena.sw.ru ([2a06:5b06:b600:300:4baa:5b4e:5d38:b960]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-499877d5548sm61175825e9.1.2026.08.14.11.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 11:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz.org; s=google; t=1786732742; x=1787337542; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=W2Mx3aydHoSpb8gvA1hKFXObL3SKPHYA2L1UoMCL1VU=; b=SQrcIBr/alN9+YsOFlQM8X8IVp23qV0Dgak+VK6PbUhQwHiZBx+eSpHZLLqEattsjx opfnQYuub4P0fhVdgJFKZika9RhUvBpT8NIpj9SZm9Ue1kzCiUArYE19AXi2LMj+Oe+K BNDvd1k20tBsTHQK67G4tGu5gRlX8cv44mlg50+pJN3pFmuXjqhi8aNsAhKzVxyRVKcA wxzHf9cgpFtstHZbP+XOsRdJmYeCTENniTY1VQL4FK7eq8l9GPgIADUBUL6oASLW1Tvo Mw9tfRnr+zmGT4++xOjciAzUUFdG9TxHRLzsdbbAcyBIHm3dE/IXEEIn8fmShbtg1zj3 e0jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786732742; x=1787337542; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=W2Mx3aydHoSpb8gvA1hKFXObL3SKPHYA2L1UoMCL1VU=; b=AXJQBTrGBDx84lfpqsNmqjrnvfqSB3qqNoviBEALjmzHpRIt+qYq56Tsg7LlKttKy7 5t+MyzKdpF+aWlZjLO8TffjWAmKd6n2/K7GNcyI4SDcAqLeroHXIU1u1SBDgzjKG4wUr 4pqwsL5KL9jBcItNSXyQc9VG8HRQvu2tCULfmHa5GLM3WUbFPyWkdE1PmZK+h1j9/4Gm shDxPyrYKLSPGL1YL4fRyxJR4WYeYy8udhUf4KFCzZ133v9m2tBmKdPW3ibf8zcsUGAJ cYrIRw5QdEnmxhBHsG3dVugo/nw3yguHbKFVIKP+RxXsAMAHTOCKcaKOzLpT3pdhGdzq Wtww== X-Gm-Message-State: AOJu0YxZCkm26YASnbOM7Xvjxs4vwC7zBGiHyaOlS+mCoPW+j8UAa+CZ ZOEQ/BNZSvI4bVEYAtG91PeelU5rZl+iC2qWiSkijbh+t4ks6XOUMxyAHkTs1Lisr/mJuY1KBcV vGufK X-Gm-Gg: AR+sD12S7c3P4+so7vKXbrhayB8neJHjEUdqjcgpef0OF/dE7tSafp1/sYw3/1qgMQ/ gfJaYUzhmh9pdBK0N2xanr7JDJVZT/yiTTV1XSwLRvO8gQeHjuJlhT4KBaWJ/a2vJq7cLmVq+VR 3r3Mn3ofAatDQfsS4WocdNe9JJ+4vL26tirm9qzAhRHh4aQ6t/17RsX76836PsRwlwv9yfbnMDa 91wVRN3jomRn1PaiJpaJuPNv8cMmZr0Cfs+7/WOTzMdjuNvG6No0imlV+jj9vK8O0cvpnQxowjE XXyshtFkxXNVHPrd0lBvU8oAIXKepZvCZ3HzTg4Lz1yqbdkQRKT1P2rsw8m9rv2F6BX4j3gEyvF 074ZkmwzZXXXTJQ/GHHjjoH5pKsOmaAVei89rsmOZxcFYrVBN/C3MwD7oounvmbdYUkQ8B3iRt6 P0zY0C3FyAFDQYRQN7xQOosUpZY8ZZWptJrbj/O0OcRToMfJQLPQLrs91/fYQNOjrmHrRo X-Received: by 2002:a05:600c:a4d:b0:496:ca1f:a428 with SMTP id 5b1f17b1804b1-49987981e52mr116300975e9.19.1786732742024; Fri, 14 Aug 2026 11:39:02 -0700 (PDT) From: "Denis V. Lunev" To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bin Meng , Jan Kiszka , Peter Xu , Fabiano Rosas , "Denis V. Lunev" Subject: [PATCH] hw/sd: give the RPMB vmstate subsection a name of its own Date: Fri, 14 Aug 2026 20:38:59 +0200 Message-ID: <20260814183859.4034017-1-den@openvz.org> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=den@openvz.org; helo=mail-wm1-x32c.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=unavailable 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 @openvz.org) X-ZM-MESSAGEID: 1786732795532158500 Content-Type: text/plain; charset="utf-8" From: Denis V. Lunev emmc_rpmb_vmstate and emmc_extcsd_vmstate are both called "sd-card/ext_csd_modes-state" and both sit in sd_vmstate.subsections, so a card with an RPMB partition sends two subsections under one name: 192 bytes of ext_csd_rw and 353 bytes of RPMB state. vmstate_get_subsection() returns the first entry whose name matches, so the destination parses both of them as emmc_extcsd_vmstate. The RPMB section is 161 bytes longer than the fields being loaded from it, the stream is left mid-section, and the load fails: (qemu) migrate file:vm.mig ... on the destination: load of migration failed: Invalid argument: Section footer error, section_id: 38 Reproduced with qemu-system-x86_64 -M q35 -device sdhci-pci,id=3Dmmc \ -drive if=3Dnone,id=3Dd0,file=3Demmc.raw,format=3Draw \ -device emmc,bus=3Dsd-bus,drive=3Dd0,rpmb-partition-size=3D131072 Name it "sd-card/rpmb-state". A stream written by an affected version cannot be loaded by any version, this one included, so there is no working format to stay compatible with. Cc: qemu-stable@nongnu.org Fixes: 8ef4260a3f ("hw/sd/sdcard: Add basic support for RPMB partition") Signed-off-by: Denis V. Lunev Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index a30c541df0..674ca09b49 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1022,7 +1022,7 @@ static bool vmstate_needed_for_rpmb(void *opaque) } =20 static const VMStateDescription emmc_rpmb_vmstate =3D { - .name =3D "sd-card/ext_csd_modes-state", + .name =3D "sd-card/rpmb-state", .version_id =3D 1, .minimum_version_id =3D 1, .needed =3D vmstate_needed_for_rpmb, --=20 2.53.0