Received: from eggs.gnu.org ([2001:4830:134:3::10]:43398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVFfw-0002sH-S3 for qemu-devel@nongnu.org; Tue, 10 Mar 2015 04:38:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVFfq-0000m5-9I for qemu-devel@nongnu.org; Tue, 10 Mar 2015 04:38:04 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:51978) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVFfp-0000lR-W8 for qemu-devel@nongnu.org; Tue, 10 Mar 2015 04:37:58 -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, 10 Mar 2015 08:37:56 -0000 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 E7766219005E for ; Tue, 10 Mar 2015 08:37:45 +0000 (GMT) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t2A8bs5G11862306 for ; Tue, 10 Mar 2015 08:37:54 GMT Received: from d06av06.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t2A3X2mg007979 for ; Mon, 9 Mar 2015 23:33:02 -0400 From: Christian Borntraeger Date: Tue, 10 Mar 2015 09:37:58 +0100 Message-Id: <1425976693-18087-6-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1425976693-18087-1-git-send-email-borntraeger@de.ibm.com> References: <1425976693-18087-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PULL 05/20] s390x/kvm: helper to set the SIGP status in SigpInfo List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Christian Borntraeger , qemu-devel , Alexander Graf , David Hildenbrand , Jens Freimann , Cornelia Huck , Richard Henderson From: David Hildenbrand Whenever we set the SIGP status in the status register, we have to wipe out the lower 4 bytes and keep the higher 4 bytes. Also the condition code will always be set to STATUS_STORED. Let's introduce the wrapper for SigpInfo, as this will avoid most duplicate code in the future. Reviewed-by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Jens Freimann Signed-off-by: David Hildenbrand Message-Id: <1424783731-43426-5-git-send-email-jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger --- target-s390x/kvm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index aaf703e..28d26c1 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -1118,6 +1118,13 @@ typedef struct SigpInfo { uint64_t *status_reg; } SigpInfo; +static void set_sigp_status(SigpInfo *si, uint64_t status) +{ + *si->status_reg &= 0xffffffff00000000ULL; + *si->status_reg |= status; + si->cc = SIGP_CC_STATUS_STORED; +} + static void sigp_start(void *arg) { SigpInfo *si = arg; @@ -1202,9 +1209,7 @@ static int handle_sigp_single_dst(S390CPU *dst_cpu, uint8_t order, break; default: DPRINTF("KVM: unknown SIGP: 0x%x\n", order); - *status_reg &= 0xffffffff00000000ULL; - *status_reg |= SIGP_STAT_INVALID_ORDER; - si.cc = SIGP_CC_STATUS_STORED; + set_sigp_status(&si, SIGP_STAT_INVALID_ORDER); } return si.cc; -- 2.3.0