From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52410 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfFCB-0006cE-Qn for qemu-devel@nongnu.org; Tue, 18 Jan 2011 12:18:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfFBy-0007sG-8z for qemu-devel@nongnu.org; Tue, 18 Jan 2011 12:18:14 -0500 Received: from mail-pw0-f45.google.com ([209.85.160.45]:50631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfFBy-0007rz-3q for qemu-devel@nongnu.org; Tue, 18 Jan 2011 12:18:02 -0500 Received: by pwj6 with SMTP id 6so1519336pwj.4 for ; Tue, 18 Jan 2011 09:18:01 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4D355D75.6070004@gmail.com> References: <4D355D75.6070004@gmail.com> From: Blue Swirl Date: Tue, 18 Jan 2011 17:17:41 +0000 Message-ID: Subject: Re: [Qemu-devel] Changing the content of target cpu registers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Bonifazi Cc: QEMU Developers On Tue, Jan 18, 2011 at 9:29 AM, Stefano Bonifazi wrote: > Hi all! > =C2=A0I 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 stor= ed > 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.