From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQoSd-0004UJ-HH for qemu-devel@nongnu.org; Mon, 30 Sep 2013 21:09:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQoSZ-0005G9-18 for qemu-devel@nongnu.org; Mon, 30 Sep 2013 21:09:11 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:57284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQoSY-0005G2-Qm for qemu-devel@nongnu.org; Mon, 30 Sep 2013 21:09:06 -0400 Received: by mail-lb0-f177.google.com with SMTP id w7so5194703lbi.22 for ; Mon, 30 Sep 2013 18:09:06 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1380556655-22282-4-git-send-email-chouteau@adacore.com> References: <1380556655-22282-1-git-send-email-chouteau@adacore.com> <1380556655-22282-4-git-send-email-chouteau@adacore.com> From: Peter Maydell Date: Tue, 1 Oct 2013 10:08:45 +0900 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 3/4] Refactoring MonitorDef array List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: QEMU Developers , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Luiz Capitulino On 1 October 2013 00:57, Fabien Chouteau 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