From patchwork Tue Feb 24 13:15:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Freimann X-Patchwork-Id: 442961 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 60541140159 for ; Wed, 25 Feb 2015 00:16:29 +1100 (AEDT) Received: from localhost ([::1]:49249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQFLf-0002vm-HM for incoming@patchwork.ozlabs.org; Tue, 24 Feb 2015 08:16:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQFL2-0001V5-54 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 1YQFKv-0002ND-3G for qemu-devel@nongnu.org; Tue, 24 Feb 2015 08:15:48 -0500 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:46124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQFKu-0002MA-Qc for qemu-devel@nongnu.org; Tue, 24 Feb 2015 08:15:41 -0500 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Feb 2015 13:15:39 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 24 Feb 2015 13:15:36 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 4AFB11B08061 for ; Tue, 24 Feb 2015 13:15:51 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1ODFa4h1704306 for ; Tue, 24 Feb 2015 13:15:36 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t1ODFZ5B027352 for ; Tue, 24 Feb 2015 06:15:36 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t1ODFYtB027323; Tue, 24 Feb 2015 06:15:34 -0700 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 1122) id 63F54122442C; 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:22 +0100 Message-Id: <1424783731-43426-2-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-0021-0000-0000-000002FFF295 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.111 Cc: David Hildenbrand , Jens Freimann , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 01/10] s390x: introduce defines for SIGP condition codes 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 This patch introduces defines for the SIGP condition codes and replaces all occurrences of numeral condition codes with the new defines. Reviewed-by: Cornelia Huck Signed-off-by: Jens Freimann Signed-off-by: David Hildenbrand --- target-s390x/cpu.h | 9 ++++++++- target-s390x/kvm.c | 14 +++++++------- target-s390x/misc_helper.c | 4 ++-- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index 2e2554c..e6edb72 100644 --- a/target-s390x/cpu.h +++ b/target-s390x/cpu.h @@ -856,6 +856,7 @@ struct sysib_322 { #define SK_F (0x1 << 3) #define SK_ACC_MASK (0xf << 4) +/* SIGP order codes */ #define SIGP_SENSE 0x01 #define SIGP_EXTERNAL_CALL 0x02 #define SIGP_EMERGENCY 0x03 @@ -869,7 +870,13 @@ struct sysib_322 { #define SIGP_STORE_STATUS_ADDR 0x0e #define SIGP_SET_ARCH 0x12 -/* cpu status bits */ +/* SIGP condition codes */ +#define SIGP_CC_ORDER_CODE_ACCEPTED 0 +#define SIGP_CC_STATUS_STORED 1 +#define SIGP_CC_BUSY 2 +#define SIGP_CC_NOT_OPERATIONAL 3 + +/* SIGP status bits */ #define SIGP_STAT_EQUIPMENT_CHECK 0x80000000UL #define SIGP_STAT_INCORRECT_STATE 0x00000200UL #define SIGP_STAT_INVALID_PARAMETER 0x00000100UL diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 6f2d5b4..91b0257 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -1165,37 +1165,37 @@ static int handle_sigp(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) cpu_addr = env->regs[ipa1 & 0x0f]; target_cpu = s390_cpu_addr2state(cpu_addr); if (target_cpu == NULL) { - cc = 3; /* not operational */ + cc = SIGP_CC_NOT_OPERATIONAL; goto out; } switch (order_code) { case SIGP_START: run_on_cpu(CPU(target_cpu), sigp_cpu_start, CPU(target_cpu)); - cc = 0; + cc = SIGP_CC_ORDER_CODE_ACCEPTED; break; case SIGP_RESTART: run_on_cpu(CPU(target_cpu), sigp_cpu_restart, CPU(target_cpu)); - cc = 0; + cc = SIGP_CC_ORDER_CODE_ACCEPTED; break; case SIGP_SET_ARCH: *statusreg &= 0xffffffff00000000UL; *statusreg |= SIGP_STAT_INVALID_PARAMETER; - cc = 1; /* status stored */ + cc = SIGP_CC_STATUS_STORED; break; case SIGP_INITIAL_CPU_RESET: run_on_cpu(CPU(target_cpu), sigp_initial_cpu_reset, CPU(target_cpu)); - cc = 0; + cc = SIGP_CC_ORDER_CODE_ACCEPTED; break; case SIGP_CPU_RESET: run_on_cpu(CPU(target_cpu), sigp_cpu_reset, CPU(target_cpu)); - cc = 0; + cc = SIGP_CC_ORDER_CODE_ACCEPTED; break; default: DPRINTF("KVM: unknown SIGP: 0x%x\n", order_code); *statusreg &= 0xffffffff00000000UL; *statusreg |= SIGP_STAT_INVALID_ORDER; - cc = 1; /* status stored */ + cc = SIGP_CC_STATUS_STORED; break; } diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c index ef9758a..bfd9809 100644 --- a/target-s390x/misc_helper.c +++ b/target-s390x/misc_helper.c @@ -427,7 +427,7 @@ uint32_t HELPER(stsi)(CPUS390XState *env, uint64_t a0, uint32_t HELPER(sigp)(CPUS390XState *env, uint64_t order_code, uint32_t r1, uint64_t cpu_addr) { - int cc = 0; + int cc = SIGP_CC_ORDER_CODE_ACCEPTED; HELPER_LOG("%s: %016" PRIx64 " %08x %016" PRIx64 "\n", __func__, order_code, r1, cpu_addr); @@ -461,7 +461,7 @@ uint32_t HELPER(sigp)(CPUS390XState *env, uint64_t order_code, uint32_t r1, default: /* unknown sigp */ fprintf(stderr, "XXX unknown sigp: 0x%" PRIx64 "\n", order_code); - cc = 3; + cc = SIGP_CC_NOT_OPERATIONAL; } return cc;