From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: [PATCH 3/6] KVM: s390: fix sigp sense running condition code handling Date: Tue, 26 Jun 2012 16:06:38 +0200 Message-ID: <1340719601-11867-4-git-send-email-cornelia.huck@de.ibm.com> References: <1340719601-11867-1-git-send-email-cornelia.huck@de.ibm.com> Cc: Christian Borntraeger , Carsten Otte , Alexander Graf , Heiko Carstens , Martin Schwidefsky , KVM , linux-s390 To: Avi Kivity , Marcelo Tosatti Return-path: Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:44807 "EHLO e06smtp17.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757574Ab2FZOG5 (ORCPT ); Tue, 26 Jun 2012 10:06:57 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 26 Jun 2012 15:06:54 +0100 In-Reply-To: <1340719601-11867-1-git-send-email-cornelia.huck@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: From: Heiko Carstens Only if the sensed cpu is not running a status is stored, which is reflected by condition code 1. If the cpu is running, condition code 0 should be returned. Just the opposite of what the code is doing. Acked-by: Cornelia Huck Signed-off-by: Heiko Carstens Signed-off-by: Cornelia Huck --- arch/s390/kvm/sigp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c index fda1d64..caccc0e 100644 --- a/arch/s390/kvm/sigp.c +++ b/arch/s390/kvm/sigp.c @@ -268,12 +268,12 @@ static int __sigp_sense_running(struct kvm_vcpu *vcpu, u16 cpu_addr, if (atomic_read(fi->local_int[cpu_addr]->cpuflags) & CPUSTAT_RUNNING) { /* running */ - rc = 1; + rc = 0; } else { /* not running */ *reg &= 0xffffffff00000000UL; *reg |= SIGP_STATUS_NOT_RUNNING; - rc = 0; + rc = 1; } } spin_unlock(&fi->lock); -- 1.7.10.4