Received: from eggs.gnu.org ([2001:4830:134:3::10]:37037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpEnd-0006Ar-MU for qemu-devel@nongnu.org; Wed, 28 Sep 2016 09:21:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpEnZ-0003Bk-H0 for qemu-devel@nongnu.org; Wed, 28 Sep 2016 09:21:25 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:35273) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpEnZ-0003BR-4b for qemu-devel@nongnu.org; Wed, 28 Sep 2016 09:21:21 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= Date: Wed, 28 Sep 2016 15:21:19 +0200 Message-ID: <874m50yxbk.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [RFC] Tracing guest register usage List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Peter Crosthwaite , Richard Henderson Hi! I've kept working on extending the guest instruction tracing features, and added support to trace which registers are read/written by guest instructions (when executing with TCG). I've basically extended "tcg_global_mem_new_*" to associate global TCG registers with a guest (vCPU) register number (*), and track all TCG opcodes that access the values of these global TCG registers. (*) This "mapping" is necessary because targets like i386 have multiple global TCG registers (cc_dst, cc_src, ...) that correspond to a single guest register (eflags). While enough, I'm wondering if extending "tcg_global_mem_new_*" to set that mapping is the proper way to go. For example, gdbstub also has some form of guest (vCPU) register descriptors, but only for some of the targets. So the question is wether it's worth generalizing this to some register descriptors in CPUClass, that can be used by all QEMU's subsystems. Cheers, Lluis