Commit d6a29ca67e for qemu.org
commit d6a29ca67e9c19d4639bee22b0a5e21517ad408d
Author: Peter Maydell <peter.maydell@linaro.org>
Date: Tue Nov 24 10:23:08 2026 +0000
hw/ssi/aspeed_smc: Correct minimum_version_id in vmstate
In commit 29139270d8ad70f2 we made an incompatible change to the
migration state for the aspeed_smc device, and bumped the version_id
and minimum_version_id: this is because we increased ASPEED_SMC_R_MAX
and so the regs array is bigger.
However, the old vmstate was handling migration from a range of
vmstate versions, with version_id = 3 and minimum_version_id = 1.
The change to ASPEED_SMC_R_MAX is (intentionally) not compatible with
any of those older versions, and so it should have moved
minimum_version_id up to 4 (matching the new version_id), not merely
increment it.
The effect of this is that trying a migration save on v11.1.3 and
then a load on the current head of git fails in a confusing way
("Missing section footer for aspeed.smc") rather than clearly ("error
while loading state for instance 0x0 of device 'aspeed.smc':
aspeed.smc: incoming version_id 3 is too old for local minimum
version_id 5").
Since we now don't need to try to handle migration from versions 2
and 3 at all, we can drop the complications in the vmstate struct (an
unused field, and field only present in version 3 and up). Clean
these up and set the version_id and minimum_version_id to 5
accordingly.
Fixes: 29139270d8ad70f2 ("hw/ssi/aspeed_smc: Add Data FIFO-based flash access support for AST2700")
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4880
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-id: 20261119171425.3186790-1-peter.maydell@linaro.org
diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c
index ec9ad0f747..f82947e752 100644
--- a/hw/ssi/aspeed_smc.c
+++ b/hw/ssi/aspeed_smc.c
@@ -1218,12 +1218,11 @@ static void aspeed_smc_realize(DeviceState *dev, Error **errp)
static const VMStateDescription vmstate_aspeed_smc = {
.name = "aspeed.smc",
- .version_id = 4,
- .minimum_version_id = 2,
+ .version_id = 5,
+ .minimum_version_id = 5,
.fields = (const VMStateField[]) {
VMSTATE_UINT32_ARRAY(regs, AspeedSMCState, ASPEED_SMC_R_MAX),
- VMSTATE_UNUSED_V(2, 2), /* was snoop_index/snoop_dummies */
- VMSTATE_BOOL_V(unselect, AspeedSMCState, 3),
+ VMSTATE_BOOL(unselect, AspeedSMCState),
VMSTATE_END_OF_LIST()
}
};