From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39527 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfG3s-0002kI-Du for qemu-devel@nongnu.org; Tue, 18 Jan 2011 13:13:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfG3r-00022i-A5 for qemu-devel@nongnu.org; Tue, 18 Jan 2011 13:13:44 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:62902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfG3r-00022Z-15 for qemu-devel@nongnu.org; Tue, 18 Jan 2011 13:13:43 -0500 Received: by wwi18 with SMTP id 18so6303510wwi.10 for ; Tue, 18 Jan 2011 10:13:39 -0800 (PST) Message-ID: <4D35D84F.5070501@gmail.com> Date: Tue, 18 Jan 2011 19:13:35 +0100 From: Stefano Bonifazi MIME-Version: 1.0 Subject: Re: [Qemu-devel] Changing the content of target cpu registers References: <4D355D75.6070004@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: QEMU Developers On 01/18/2011 06:17 PM, Blue Swirl wrote: > On Tue, Jan 18, 2011 at 9:29 AM, Stefano Bonifazi > wrote: >> Hi all! >> I am working on qemu-user (qemu-ppc). >> I'd like to edit the values of target registers during the execution. Can I >> do that by simply changing the content of env->gpr[] or do these only >> contain a copy of the values of the registers? >> In this last case, where are the real values of the target registers stored >> so that by modifying them I can alter the behavior of the target code >> execution? > env->gpr is the canonical location, but the translator assigns TCG > variables to them (cpu_gpr[] in translate.c), so GPR contents may be > cached to these. But when helpers are called or the TB finishes, > env->gpr should be valid again. Hi! Thank you for your answer! So if I understand well if I set env->gpr in a code section where there is no TCG translation on progress, I can edit directly the target CPU register right? Best Regards! Stefano B.