#include "qemu/osdep.h"
#include "hw/hw.h"
#include "cpu.h"
+#include "internal.h"
+#include "kvm_s390x.h"
#include "sysemu/kvm.h"
static int cpu_post_load(void *opaque, int version_id)
return 0;
}
-static void cpu_pre_save(void *opaque)
+
+static int cpu_pre_save(void *opaque)
{
S390CPU *cpu = opaque;
if (kvm_enabled()) {
kvm_s390_vcpu_interrupt_pre_save(cpu);
}
+
+ return 0;
}
static inline bool fpu_needed(void *opaque)
}
};
+static bool exval_needed(void *opaque)
+{
+ S390CPU *cpu = opaque;
+ return cpu->env.ex_value != 0;
+}
+
+const VMStateDescription vmstate_exval = {
+ .name = "cpu/exval",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = exval_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT64(env.ex_value, S390CPU),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
+static bool gscb_needed(void *opaque)
+{
+ return s390_has_feat(S390_FEAT_GUARDED_STORAGE);
+}
+
+const VMStateDescription vmstate_gscb = {
+ .name = "cpu/gscb",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = gscb_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT64_ARRAY(env.gscb, S390CPU, 4),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
+static bool bpbc_needed(void *opaque)
+{
+ return s390_has_feat(S390_FEAT_BPB);
+}
+
+const VMStateDescription vmstate_bpbc = {
+ .name = "cpu/bpbc",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = bpbc_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_BOOL(env.bpbc, S390CPU),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
const VMStateDescription vmstate_s390_cpu = {
.name = "cpu",
.post_load = cpu_post_load,
&vmstate_fpu,
&vmstate_vregs,
&vmstate_riccb,
+ &vmstate_exval,
+ &vmstate_gscb,
+ &vmstate_bpbc,
NULL
},
};