diff options
author | Peter Maydell | 2015-05-10 22:40:54 +0200 |
---|---|---|
committer | Peter Maydell | 2015-05-10 22:40:55 +0200 |
commit | fc85cf4a8199a657fdfd5fb902f1835973406454 (patch) | |
tree | a335b5fcfd32f32d675e98fae220a934cca26f02 /target-s390x/machine.c | |
parent | hw/ptimer: Do not artificially limit timers when using icount (diff) | |
parent | s390x/kvm: migrate vcpu interrupt state (diff) | |
download | qemu-fc85cf4a8199a657fdfd5fb902f1835973406454.tar.gz qemu-fc85cf4a8199a657fdfd5fb902f1835973406454.tar.xz qemu-fc85cf4a8199a657fdfd5fb902f1835973406454.zip |
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20150508' into staging
Assorted s390x patches:
- updates for virtio-ccw and s390-virtio, making them more similar
to virtio-pci
- improvements regarding per-vcpu interrupts and migration
# gpg: Signature made Fri May 8 09:45:09 2015 BST using RSA key ID C6F02FAF
# gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
* remotes/cohuck/tags/s390x-20150508:
s390x/kvm: migrate vcpu interrupt state
s390x: move fpu regs into a subsection of the vmstate
s390x/kvm: use ioctl KVM_S390_IRQ for vcpu interrupts
virtio-ccw: implement ->device_plugged
virtio-ccw: change realization sequence
s390-virtio: clear {used,avail}_event_idx on reset as well
s390-virtio: use common features
s390-virtio: Accommodate guests using virtqueues too early
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-s390x/machine.c')
-rw-r--r-- | target-s390x/machine.c | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/target-s390x/machine.c b/target-s390x/machine.c index bd4cea726d..7853e3c989 100644 --- a/target-s390x/machine.c +++ b/target-s390x/machine.c @@ -28,17 +28,25 @@ static int cpu_post_load(void *opaque, int version_id) */ if (kvm_enabled()) { kvm_s390_set_cpu_state(cpu, cpu->env.cpu_state); + return kvm_s390_vcpu_interrupt_post_load(cpu); } return 0; } +static void cpu_pre_save(void *opaque) +{ + S390CPU *cpu = opaque; -const VMStateDescription vmstate_s390_cpu = { - .name = "cpu", - .post_load = cpu_post_load, - .version_id = 2, - .minimum_version_id = 2, - .fields = (VMStateField[]) { + if (kvm_enabled()) { + kvm_s390_vcpu_interrupt_pre_save(cpu); + } +} + +const VMStateDescription vmstate_fpu = { + .name = "cpu/fpu", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField[]) { VMSTATE_UINT64(env.fregs[0].ll, S390CPU), VMSTATE_UINT64(env.fregs[1].ll, S390CPU), VMSTATE_UINT64(env.fregs[2].ll, S390CPU), @@ -55,11 +63,27 @@ const VMStateDescription vmstate_s390_cpu = { VMSTATE_UINT64(env.fregs[13].ll, S390CPU), VMSTATE_UINT64(env.fregs[14].ll, S390CPU), VMSTATE_UINT64(env.fregs[15].ll, S390CPU), + VMSTATE_UINT32(env.fpc, S390CPU), + VMSTATE_END_OF_LIST() + } +}; + +static inline bool fpu_needed(void *opaque) +{ + return true; +} + +const VMStateDescription vmstate_s390_cpu = { + .name = "cpu", + .post_load = cpu_post_load, + .pre_save = cpu_pre_save, + .version_id = 4, + .minimum_version_id = 3, + .fields = (VMStateField[]) { VMSTATE_UINT64_ARRAY(env.regs, S390CPU, 16), VMSTATE_UINT64(env.psw.mask, S390CPU), VMSTATE_UINT64(env.psw.addr, S390CPU), VMSTATE_UINT64(env.psa, S390CPU), - VMSTATE_UINT32(env.fpc, S390CPU), VMSTATE_UINT32(env.todpr, S390CPU), VMSTATE_UINT64(env.pfault_token, S390CPU), VMSTATE_UINT64(env.pfault_compare, S390CPU), @@ -72,6 +96,17 @@ const VMStateDescription vmstate_s390_cpu = { VMSTATE_UINT64_ARRAY(env.cregs, S390CPU, 16), VMSTATE_UINT8(env.cpu_state, S390CPU), VMSTATE_UINT8(env.sigp_order, S390CPU), + VMSTATE_UINT32_V(irqstate_saved_size, S390CPU, 4), + VMSTATE_VBUFFER_UINT32(irqstate, S390CPU, 4, NULL, 0, + irqstate_saved_size), VMSTATE_END_OF_LIST() }, + .subsections = (VMStateSubsection[]) { + { + .vmsd = &vmstate_fpu, + .needed = fpu_needed, + } , { + /* empty */ + } + }, }; |