From patchwork Tue Feb 24 13:15:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Freimann X-Patchwork-Id: 442969 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5240D140159 for ; Wed, 25 Feb 2015 00:21:06 +1100 (AEDT) Received: from localhost ([::1]:49288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQFQ8-0002yi-Ar for incoming@patchwork.ozlabs.org; Tue, 24 Feb 2015 08:21:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQFKy-0001UX-3t for qemu-devel@nongnu.org; Tue, 24 Feb 2015 08:15:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQFKu-0002Lg-9i for qemu-devel@nongnu.org; Tue, 24 Feb 2015 08:15:44 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:33765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQFKt-0002LB-VD for qemu-devel@nongnu.org; Tue, 24 Feb 2015 08:15:40 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Feb 2015 13:15:37 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 24 Feb 2015 13:15:36 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 94E442190046 for ; Tue, 24 Feb 2015 13:15:29 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1ODFah93932504 for ; Tue, 24 Feb 2015 13:15:36 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 t1ODFYBh025135 for ; Tue, 24 Feb 2015 06:15:35 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t1ODFYex025115; Tue, 24 Feb 2015 06:15:34 -0700 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 1122) id 69DC5122445D; Tue, 24 Feb 2015 14:15:34 +0100 (CET) From: Jens Freimann To: Christian Borntraeger , Alexander Graf , Cornelia Huck Date: Tue, 24 Feb 2015 14:15:25 +0100 Message-Id: <1424783731-43426-5-git-send-email-jfrei@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1424783731-43426-1-git-send-email-jfrei@linux.vnet.ibm.com> References: <1424783731-43426-1-git-send-email-jfrei@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15022413-0017-0000-0000-00000323D2A2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.110 Cc: David Hildenbrand , Jens Freimann , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 04/10] s390x/kvm: helper to set the SIGP status in SigpInfo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 1f4a4b1..fb0ce6d 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -1105,6 +1105,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; @@ -1189,9 +1196,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;