}
};
+static bool mseccfg_needed(void *opaque)
+{
+ RISCVCPU *cpu = opaque;
+
+ return cpu->cfg.ext_smepmp || cpu->cfg.ext_zkr
+ || cpu->cfg.ext_smmpm || cpu->cfg.ext_zicfilp;
+}
+
+static const VMStateDescription vmstate_mseccfg = {
+ .name = "cpu/mseccfg",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = mseccfg_needed,
+ .fields = (const VMStateField[]) {
+ VMSTATE_UINTTL(env.mseccfg, RISCVCPU),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
const VMStateDescription vmstate_riscv_cpu = {
.name = "cpu",
.version_id = 11,
&vmstate_ssp,
&vmstate_ctr,
&vmstate_sstc,
+ &vmstate_mseccfg,
NULL
}
};