From b853d4cbf2062813e84f9bb880feff8daf467e05 Mon Sep 17 00:00:00 2001 From: Sascha Silbe Date: Tue, 2 Jun 2015 18:51:00 +0200 Subject: s390x/kvm: always ignore empty vcpu interrupt state kvm_s390_vcpu_interrupt_pre_save() and kvm_s390_vcpu_interrupt_post_load() are essentially no-ops on hosts without KVM_CAP_S390_IRQ_STATE. Move the capability check after the check for saved IRQ state in kvm_s390_vcpu_interrupt_post_load() so that migration between hosts without KVM_CAP_S390_IRQ_STATE (including save / restore on the same host) continues to work. Fixes: 3cda44f7bae5 ("s390x/kvm: migrate vcpu interrupt state") Signed-off-by: Sascha Silbe Reviewed-by: David Hildenbrand Reviewed-by: Jens Freimann Signed-off-by: Christian Borntraeger --- target-s390x/kvm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'target-s390x') diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 6de7759..070f995 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -2175,13 +2175,14 @@ int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu) struct kvm_s390_irq_state irq_state; int r; + if (cpu->irqstate_saved_size == 0) { + return 0; + } + if (!kvm_check_extension(kvm_state, KVM_CAP_S390_IRQ_STATE)) { return -ENOSYS; } - if (cpu->irqstate_saved_size == 0) { - return 0; - } irq_state.buf = (uint64_t) cpu->irqstate; irq_state.len = cpu->irqstate_saved_size; -- cgit v1.1 From 6028ef075791913228c36f10cb270f1f52e9f076 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Mon, 8 Jun 2015 12:21:24 +0200 Subject: s390x/migration: add comment about floating point migration commit 46c804def4bd ("s390x: move fpu regs into a subsection of the vmstate") moved the fprs into a subsection and bumped the version number. This will allow to not transfer fprs in the future if necessary. Add a comment to mark the return true as intentional. CC: Juan Quintela CC: David Hildenbrand Signed-off-by: Christian Borntraeger Message-Id: <1433758884-2997-1-git-send-email-borntraeger@de.ibm.com> Reviewed-by: Juan Quintela --- target-s390x/machine.c | 1 + 1 file changed, 1 insertion(+) (limited to 'target-s390x') diff --git a/target-s390x/machine.c b/target-s390x/machine.c index e52d760..0044749 100644 --- a/target-s390x/machine.c +++ b/target-s390x/machine.c @@ -70,6 +70,7 @@ const VMStateDescription vmstate_fpu = { static inline bool fpu_needed(void *opaque) { + /* This looks odd, but we might want to NOT transfer fprs in the future */ return true; } -- cgit v1.1