From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOR7v-0001cz-07 for qemu-devel@nongnu.org; Mon, 01 Sep 2014 08:54:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOR7g-00056H-SA for qemu-devel@nongnu.org; Mon, 01 Sep 2014 08:54:30 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:48672) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOR7g-00055R-Ji for qemu-devel@nongnu.org; Mon, 01 Sep 2014 08:54:16 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Sep 2014 13:54:15 +0100 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 CDC612190046 for ; Mon, 1 Sep 2014 13:53:54 +0100 (BST) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s81CsDrZ39583744 for ; Mon, 1 Sep 2014 12:54:13 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s81CsCXw013859 for ; Mon, 1 Sep 2014 06:54:13 -0600 From: Christian Borntraeger Date: Mon, 1 Sep 2014 14:54:27 +0200 Message-Id: <1409576070-55803-17-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1409576070-55803-1-git-send-email-borntraeger@de.ibm.com> References: <1409576070-55803-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PULL 16/19] 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: Peter Maydell Cc: Christian Borntraeger , qemu-devel , Alexander Graf , David Hildenbrand , Jens Freimann , Anthony Liguori , Cornelia Huck , Richard Henderson 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 Signed-off-by: Christian Borntraeger --- 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.4.2