All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Fabien Chouteau <chouteau@adacore.com>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"Luiz Capitulino" <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/4] Refactoring MonitorDef array
Date: Tue, 1 Oct 2013 10:08:45 +0900	[thread overview]
Message-ID: <CAFEAcA-6PDPwxwL00DP805PpwWqRC41dOy2ZXrHDquqzdMzoGg@mail.gmail.com> (raw)
In-Reply-To: <1380556655-22282-4-git-send-email-chouteau@adacore.com>

On 1 October 2013 00:57, Fabien Chouteau <chouteau@adacore.com> wrote:

> +#define MD_I64 0
> +#define MD_I32 1

> -#define MD_TLONG 0
> -#define MD_I32   1

> -    { "eax", offsetof(CPUX86State, regs[0]) },
> -    { "ecx", offsetof(CPUX86State, regs[1]) },

> +    { "eax", offsetof(CPUX86State, regs[0]) },
> +    { "ecx", offsetof(CPUX86State, regs[1]) },

I like this generally, but this detail is wrong. These changes
mean that these registers (and many others) are now described
as being int64_t wide rather than target_long wide, so you'll
find that on 32 bit x86 they will read/write incorrectly.
This is why I suggested that you need to have target-i386/monitor.c
do an
#if TARGET_LONG_BITS == 32
#define MD_TLONG MD_I32
#else
#define MD_TLONG MD_I64
#endif

and then specifically mark these fields as MD_TLONG.

(We could also get rid of that awkward mon_get_cpu()
which is the only thing in monitor.h that has to be guarded
by NEED_CPU_H, by having the function prototype for
the callback functions just take a CPUState* (nb: not
a CPUArchState*) rather than having them all call
mon_get_cpu. But we can do that in another patch
I guess.)

-- PMM

  reply	other threads:[~2013-10-01  1:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-30 15:57 [Qemu-devel] [PATCH 0/4] Few minor improvements of monitor disas command (v3) Fabien Chouteau
2013-09-30 15:57 ` [Qemu-devel] [PATCH 1/4] Fix coding style Fabien Chouteau
2013-09-30 15:57 ` [Qemu-devel] [PATCH 2/4] Improve Monitor disas with symbol lookup Fabien Chouteau
2013-09-30 15:57 ` [Qemu-devel] [PATCH 3/4] Refactoring MonitorDef array Fabien Chouteau
2013-10-01  1:08   ` Peter Maydell [this message]
2013-10-01 14:23     ` Fabien Chouteau
2013-10-01 14:49       ` Peter Maydell
2013-10-01  2:00   ` Richard Henderson
2013-10-01 14:28     ` Fabien Chouteau
2013-10-01 15:13       ` Richard Henderson
2013-10-01 15:21         ` Peter Maydell
2013-10-01 16:13           ` Fabien Chouteau
2013-09-30 15:57 ` [Qemu-devel] [PATCH 4/4] Add ARM registers definitions for Monitor commands Fabien Chouteau
2013-10-01  1:12   ` Peter Maydell
2013-10-04 16:56 [Qemu-devel] [PATCH 0/4] Few minor improvements of monitor disas command (v4) Fabien Chouteau
2013-10-04 16:57 ` [Qemu-devel] [PATCH 3/4] Refactoring MonitorDef array Fabien Chouteau
2013-10-04 17:49   ` Peter Maydell
2013-10-04 17:55     ` Andreas Färber
2013-10-07 10:11     ` Fabien Chouteau
2013-10-07 11:45       ` Peter Maydell
2013-10-07 13:06         ` Fabien Chouteau
2013-10-07 13:29           ` Peter Maydell
2013-10-07 14:40             ` Fabien Chouteau

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=CAFEAcA-6PDPwxwL00DP805PpwWqRC41dOy2ZXrHDquqzdMzoGg@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=afaerber@suse.de \
    --cc=chouteau@adacore.com \
    --cc=lcapitulino@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.