qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] xtensa: new target architecture for qemu
Date: Sat, 30 Apr 2011 11:25:21 +0100	[thread overview]
Message-ID: <BANLkTimET7v1b0XjBkYDsBHbkem9bVdrPA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTi=Z+RZV2pRYeqLSYe_Cofp0QRWnCQ@mail.gmail.com>

On 30 April 2011 10:06, Blue Swirl <blauwirbel@gmail.com> wrote:
> On Sat, Apr 30, 2011 at 11:24 AM, Max Filippov <jcmvbkbc@gmail.com> wrote:
>> Is it worth keeping patches as small as they are now (as they only
>> reflect development chronology), or maybe it's better to consolidate
>> them on some other basis?
>
> Small patches are nicer for review.

A couple of other patch series structuring hints:
 * avoid having a patch which implements X and then a later patch
   which fixes a bug in X
 * make sure everything compiles at all points in the series, not
   just at the end; usually "enable target in configure" comes last

>> What is the reason for that? DisasContext itself has a pointer to env.
>> Can it be used instead?
>
> DisasContext shouldn't have that pointer. Some of the decisions during
> translation are made based on CPU model/features which don't change
> during execution. Other decisions should be made based on the current
> CPU state, however usually here we should not rely on env but on
> tb_flags. Not using env during disas_insn tries to enforce that.
> Please take a look at other targets how this should be handled.

Some targets are better choices to copy than others. target-arm
passes CPUState around way too much still (it only relies on things
it is OK to, but it would be nicer not to have CPUState quite so
conveniently available.) I think the ideal is that none of the
functions implementing decode logic (in your case disas_xtensa_insn())
are directly passed a CPUState pointer.

The reason for all this is that the CPUState you get during
translation may not be the state of the CPU at the start
of the code you are translating, so if you rely on bits of
it that can change you'll run into problems.

> I'd put CPU doc pointers to translate.c and chipset pointers to
> corresponding device file.

We also have a wiki page for CPU docs:
http://wiki.qemu.org/Documentation/ISAManuals

-- PMM

  reply	other threads:[~2011-04-30 10:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29 21:08 [Qemu-devel] xtensa: new target architecture for qemu Max Filippov
2011-04-30  7:07 ` Blue Swirl
2011-04-30  8:24   ` Max Filippov
2011-04-30  9:06     ` Blue Swirl
2011-04-30 10:25       ` Peter Maydell [this message]
2011-04-30 12:47         ` Max Filippov
2011-04-30 12:42       ` Max Filippov

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=BANLkTimET7v1b0XjBkYDsBHbkem9bVdrPA@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=blauwirbel@gmail.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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).