From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2F4B-0006gQ-Lv for qemu-devel@nongnu.org; Tue, 09 Jun 2015 04:39:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2F45-0007jz-4l for qemu-devel@nongnu.org; Tue, 09 Jun 2015 04:39:27 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:46678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2F44-0007hN-RW for qemu-devel@nongnu.org; Tue, 09 Jun 2015 04:39:21 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Jun 2015 09:39:18 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 943D31B08077 for ; Tue, 9 Jun 2015 09:40:13 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t598dGxw24903742 for ; Tue, 9 Jun 2015 08:39:16 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t598dFt5016677 for ; Tue, 9 Jun 2015 02:39:15 -0600 From: Christian Borntraeger Date: Tue, 9 Jun 2015 10:39:36 +0200 Message-Id: <1433839177-59505-4-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1433839177-59505-1-git-send-email-borntraeger@de.ibm.com> References: <1433839177-59505-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PULL 3/4] s390x/kvm: always ignore empty vcpu interrupt state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel , Alexander Graf , Christian Borntraeger , Jens Freimann , Cornelia Huck , Sascha Silbe From: Sascha Silbe 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(-) 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; -- 2.3.0