qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Xin Tong <xerox.time.tech@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] cpu_regs in target-i386
Date: Sun, 27 Nov 2011 15:53:43 +0100	[thread overview]
Message-ID: <4ED24EF7.4050704@suse.de> (raw)
In-Reply-To: <CALKntY1nt2RSFAZwv98AZ2KLcELSTfioWyMjsinWGFMeGwGB_w@mail.gmail.com>

Am 27.11.2011 15:36, schrieb Xin Tong:
> If i understand correctly here, those are just array of offsets for
> the emulated registers such that the tcg can easily get access to the
> address of the emulated registers. This is, however, different from
> the env (CPUx86State) variable which will always have a host register
> pointing to it ( host register is made to point to env in the tb enter
> prologue).

Yes:

host register pointed to by cpu_env contains address of env
+
offset stored in cpu_* variable
=
address of corresponding struct member in env

Andreas

> On Sun, Nov 27, 2011 at 9:12 AM, Andreas Färber <afaerber@suse.de> wrote:
>> Am 27.11.2011 14:46, schrieb Xin Tong:
>>> When the x86 vcpu is initialized, a CPUX86State is qemu_mallocz'ed.
>>> env is used to point to it and modifications to the CPUX86State can
>>> thereby be done via the register that contains the env. I do not get
>>> what the cpu_regs[CPU_NB_REGS] are for, do not we already have a set
>>> of emulated x86 registers when we allocate the CPUX86State ?
>>
>> I assume in i386, too, it will be a TCGv array and will be initialized
>> to point to individual memory offsets inside CPU*State.
>> So they're for convenience and readability.
>>
>> HTE,
>> Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2011-11-27 14:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-27 13:46 [Qemu-devel] cpu_regs in target-i386 Xin Tong
2011-11-27 14:12 ` Andreas Färber
2011-11-27 14:36   ` Xin Tong
2011-11-27 14:53     ` Andreas Färber [this message]
2011-11-27 15:23       ` Xin Tong
2011-11-27 15:43         ` Peter Maydell
2011-11-27 16:17           ` Xin Tong
2011-11-27 20:59             ` Peter Maydell
2011-11-27 23:07               ` Xin Tong
2011-11-27 23:33                 ` Peter Maydell
2011-11-28  0:32                   ` Xin Tong
2011-11-28  1:00                     ` Xin Tong
2011-11-27 16:10         ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ED24EF7.4050704@suse.de \
    --to=afaerber@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=xerox.time.tech@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).