From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP6qU-0001os-EG for qemu-devel@nongnu.org; Wed, 03 Sep 2014 05:27:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XP6qM-0005Ru-Vc for qemu-devel@nongnu.org; Wed, 03 Sep 2014 05:27:18 -0400 Received: from cantor2.suse.de ([195.135.220.15]:39659 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP6qM-0005RV-NL for qemu-devel@nongnu.org; Wed, 03 Sep 2014 05:27:10 -0400 Message-ID: <5406DEEE.6080705@suse.de> Date: Wed, 03 Sep 2014 11:27:10 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1409320338-63098-1-git-send-email-jfrei@linux.vnet.ibm.com> <1409320338-63098-2-git-send-email-jfrei@linux.vnet.ibm.com> <5404F5A5.6020102@suse.de> <54056CAA.2000201@de.ibm.com> In-Reply-To: <54056CAA.2000201@de.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [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 , Jens Freimann , Cornelia Huck Cc: David Hildenbrand , qemu-devel@nongnu.org On 02.09.14 09:07, Christian Borntraeger wrote: > On 02/09/14 00:39, Alexander Graf wrote: >> >> >> On 29.08.14 15:52, Jens Freimann wrote: >>> From: David Hildenbrand >>> >>> When reading/writing the psw mask, the condition code may only be touched if >>> running on tcg. >> >> Why? Shouldn't we be able to set CC from gdb as well? >> > > You can. What this patch does (and the patch description is a bit vague here) is to not modify the PSW it gets from KVM when passing it to gdb: > The qemu core gets the PSW from KVM. Without this patch, we use cc_op to calculate the current CC of the PSW (No idea of TCG, I guess its evaluated lazy - at least this is how valgrind works). This is wrong for the KVM case, as cc_op does not contain any useful data for the KVM case. With this patch we simply pass the psw from KVM to gdb and back. > > The symptom was that the cc was always shown as zero. Ah, I see. I agree with the patch, but the patch description does not actually describe what the patch does. Please rework it. I also wouldn't mind if instead of hard coding this logic in the gdbstub, we'd extract it as helper functions to read and write the PSW.MASK in cpu.h. Alex