From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBjjL-0004hE-FR for qemu-devel@nongnu.org; Mon, 18 Apr 2011 04:22:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QBjjK-0003DO-Ct for qemu-devel@nongnu.org; Mon, 18 Apr 2011 04:22:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBjjK-0003DH-4R for qemu-devel@nongnu.org; Mon, 18 Apr 2011 04:22:46 -0400 Message-ID: <4DABF4D0.1020602@redhat.com> Date: Mon, 18 Apr 2011 11:22:40 +0300 From: Avi Kivity MIME-Version: 1.0 References: <150737c6da67c205a17f0e9c5c8861e3d0a79531.1300266238.git.yamahata@valinux.co.jp> <4DAAE87F.6020603@redhat.com> <20110417135045.GA8741@valinux.co.jp> <4DAB0CE8.8090204@redhat.com> <20110418074731.GC21865@valinux.co.jp> In-Reply-To: <20110418074731.GC21865@valinux.co.jp> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 24/26] acpi, acpi_piix: factor out GPE logic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: qemu-devel@nongnu.org, Juan Quintela On 04/18/2011 10:47 AM, Isaku Yamahata wrote: > Hmm but it seems that there is another issue. > With the previous patch, I confirmed sts and en are saved as expected. > > The related VMStateDescription are defined in acpi_piix.c in > the following order. > vmstate_acpi calls vmstate_gpe. and&vmstate_gpe< &vmstate_acpi. > (gdb) p &vmstate_gpe $1 = (const VMStateDescription *) 0x6f0b00 (gdb) p &vmstate_acpi $2 = (const VMStateDescription *) 0x6f0aa0 So no. > However, your call trace shows something different. > (I'm assuming the stack trace is correct. gdb or compiler optimization?) > > static const VMStateDescription vmstate_gpe = { > ... > > static const VMStateDescription vmstate_acpi = { > .fields = (VMStateField []) { > ... > VMSTATE_STRUCT(gpe, PIIX4PMState, 2, vmstate_gpe, ACPIGPE), > > > > > > #0 0x000000000049aff4 in qemu_put_be16s (f=0x2427490, pv=0x1ae7580, > > size=2) at hw/hw.h:108 > > #1 put_uint16 (f=0x2427490, pv=0x1ae7580, size=2) at savevm.c:855 > > #2 0x000000000049c3e4 in vmstate_save_state (f=0x2427490, > > vmsd=0x6f0b00, opaque=0x21f5ef0) at savevm.c:1436 > > vmsd = 0x6f0b00 =&vmstate_gpe<<<<<< correct??? Correct. > opaque = 0x21f5ef0 =&PIIX4PMState->gpe > > > #3 0x000000000049c3b6 in vmstate_save_state (f=0x2427490, > > vmsd=0x6f0aa0, opaque=0x21f5b90) at savevm.c:1434 > > vmsd = 0x6f0aa0 =&vmstate_acpi<<<<<<<<<<<<< correct? Correct. > opaque = 0x21f5b90 =&PIIX4PMState > > opaque seems correct as > 0x21f5b90 - 0x21f5ef0 = 0x348 = offsetof(PIIX4PMState, gpe) > > > On my environment the stack trace looks like > (gdb) where > #0 vmstate_save_state (f=0x25d16d0, vmsd=0x695940, opaque=0x283a218) > at savevm.c:1374 > #1 0x00000000004bb4f7 in vmstate_save_state (f=0x25d16d0, vmsd=0x695a40, > opaque=0x2839ed0) at savevm.c:1412 > ... > > (gdb) print&vmstate_gpe > $32 = (const VMStateDescription *) 0x695940 > (gdb) print&vmstate_acpi > $33 = (const VMStateDescription *) 0x695a40 > Are you using qemu-kvm.git or qemu.git? I think there are indeed two issues, your patch fixes the first and there is another that is specific to qemu-kvm. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.