From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNMbk-0002e5-8p for qemu-devel@nongnu.org; Fri, 29 Aug 2014 09:53:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XNMbb-00027E-6Q for qemu-devel@nongnu.org; Fri, 29 Aug 2014 09:52:52 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:36298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XNMba-000277-Sj for qemu-devel@nongnu.org; Fri, 29 Aug 2014 09:52:43 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 29 Aug 2014 14:52:41 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 654F02190046 for ; Fri, 29 Aug 2014 14:52:21 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s7TDqdv319071030 for ; Fri, 29 Aug 2014 13:52:39 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s7TDqd6J019061 for ; Fri, 29 Aug 2014 07:52:39 -0600 From: Jens Freimann Date: Fri, 29 Aug 2014 15:52:14 +0200 Message-Id: <1409320338-63098-2-git-send-email-jfrei@linux.vnet.ibm.com> In-Reply-To: <1409320338-63098-1-git-send-email-jfrei@linux.vnet.ibm.com> References: <1409320338-63098-1-git-send-email-jfrei@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1/5] s390x/gdb: don't touch the cc if tcg is not enabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger , Alexander Graf , Cornelia Huck Cc: David Hildenbrand , Jens Freimann , qemu-devel@nongnu.org From: David Hildenbrand When reading/writing the psw mask, the condition code may only be touched if running on tcg. Signed-off-by: David Hildenbrand Signed-off-by: Jens Freimann --- target-s390x/gdbstub.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/target-s390x/gdbstub.c b/target-s390x/gdbstub.c index a129742..8d55006 100644 --- a/target-s390x/gdbstub.c +++ b/target-s390x/gdbstub.c @@ -31,9 +31,13 @@ int s390_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n) switch (n) { case S390_PSWM_REGNUM: - cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst, env->cc_vr); - val = deposit64(env->psw.mask, 44, 2, cc_op); - return gdb_get_regl(mem_buf, val); + if (tcg_enabled()) { + cc_op = calc_cc(env, env->cc_op, env->cc_src, env->cc_dst, + env->cc_vr); + val = deposit64(env->psw.mask, 44, 2, cc_op); + return gdb_get_regl(mem_buf, val); + } + return gdb_get_regl(mem_buf, env->psw.mask); case S390_PSWA_REGNUM: return gdb_get_regl(mem_buf, env->psw.addr); case S390_R0_REGNUM ... S390_R15_REGNUM: @@ -62,7 +66,9 @@ int s390_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n) switch (n) { case S390_PSWM_REGNUM: env->psw.mask = tmpl; - env->cc_op = extract64(tmpl, 44, 2); + if (tcg_enabled()) { + env->cc_op = extract64(tmpl, 44, 2); + } break; case S390_PSWA_REGNUM: env->psw.addr = tmpl; -- 1.8.5.5