[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/4] Refactoring MonitorDef array

From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 3/4] Refactoring MonitorDef array
Date: Tue, 1 Oct 2013 10:08:45 +0900

On 1 October 2013 00:57, Fabien Chouteau <address@hidden> 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
#define MD_TLONG MD_I32
#define MD_TLONG MD_I64

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 via email to

[Prev in Thread] Current Thread [Next in Thread]