On 8/31/26 05:42, Jamin Lin wrote:
The SBC controller register space is 0x1000.
Increase ASPEED_SBC_NR_REGS accordingly to cover the
full register space.

Bump the VMState version to 2.

Which means QEMU cannot load a migration stream from any older QEMU
version. Just add that migration compatibilty is broken.

That's ok, Aspeed machines are not intended for virtualization use
case.

Thanks,

C.


Signed-off-by: Jamin Lin <[email protected]>
---
  include/hw/misc/aspeed_sbc.h | 2 +-
  hw/misc/aspeed_sbc.c         | 6 +++---
  2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/hw/misc/aspeed_sbc.h b/include/hw/misc/aspeed_sbc.h
index 8d3f9207fc..756c612356 100644
--- a/include/hw/misc/aspeed_sbc.h
+++ b/include/hw/misc/aspeed_sbc.h
@@ -17,7 +17,7 @@
  #define TYPE_ASPEED_AST10X0_SBC TYPE_ASPEED_SBC "-ast10x0"
  OBJECT_DECLARE_TYPE(AspeedSBCState, AspeedSBCClass, ASPEED_SBC)
-#define ASPEED_SBC_NR_REGS (0x93c >> 2)
+#define ASPEED_SBC_NR_REGS (0x1000 >> 2)
#define QSR_AES BIT(27)
  #define QSR_RSA1024                 (0x0 << 12)
diff --git a/hw/misc/aspeed_sbc.c b/hw/misc/aspeed_sbc.c
index aa167be4c0..5c193d9086 100644
--- a/hw/misc/aspeed_sbc.c
+++ b/hw/misc/aspeed_sbc.c
@@ -456,15 +456,15 @@ static void aspeed_sbc_realize(DeviceState *dev, Error 
**errp)
      }
memory_region_init_io(&s->iomem, OBJECT(s), &aspeed_sbc_ops, s,
-            TYPE_ASPEED_SBC, 0x1000);
+            TYPE_ASPEED_SBC, ASPEED_SBC_NR_REGS << 2);
sysbus_init_mmio(sbd, &s->iomem);
  }
static const VMStateDescription vmstate_aspeed_sbc = {
      .name = TYPE_ASPEED_SBC,
-    .version_id = 1,
-    .minimum_version_id = 1,
+    .version_id = 2,
+    .minimum_version_id = 2,
      .fields = (const VMStateField[]) {
          VMSTATE_UINT32_ARRAY(regs, AspeedSBCState, ASPEED_SBC_NR_REGS),
          VMSTATE_END_OF_LIST(),


Reply via email to