Received: from eggs.gnu.org ([2001:4830:134:3::10]:45080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0DpB-0004zs-Su for qemu-devel@nongnu.org; Wed, 03 Jun 2015 14:55:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0Dp7-0004sl-RH for qemu-devel@nongnu.org; Wed, 03 Jun 2015 14:55:37 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:52544) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Dp7-0004sY-Hq for qemu-devel@nongnu.org; Wed, 03 Jun 2015 14:55:33 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 3 Jun 2015 19:55:32 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1AC5F2190046 for ; Wed, 3 Jun 2015 19:55:10 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t53ItUal24576032 for ; Wed, 3 Jun 2015 18:55:30 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t53ItTN2026076 for ; Wed, 3 Jun 2015 12:55:30 -0600 From: Christian Borntraeger Date: Wed, 3 Jun 2015 20:55:20 +0200 Message-Id: <1433357720-75778-4-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1433357720-75778-1-git-send-email-borntraeger@de.ibm.com> References: <1433357720-75778-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PATCH 3/3] s390x/kvm: always ignore empty vcpu interrupt state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: "Michael S. Tsirkin" , Alexander Graf , Christian Borntraeger , Jens Freimann , "Jason J. Herne" , 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