From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGqwS-0002lu-Gv for qemu-devel@nongnu.org; Thu, 29 Jan 2015 10:23:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGqwP-0005js-SZ for qemu-devel@nongnu.org; Thu, 29 Jan 2015 10:23:36 -0500 Received: from smtp.citrix.com ([66.165.176.89]:24309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGqwP-0005je-M2 for qemu-devel@nongnu.org; Thu, 29 Jan 2015 10:23:33 -0500 Date: Thu, 29 Jan 2015 15:23:11 +0000 From: Stefano Stabellini In-Reply-To: <87egqd39tf.fsf@blackfin.pond.sub.org> Message-ID: References: <87egqd39tf.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Subject: Re: [Qemu-devel] -device xen-platform crashes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, stefano.stabellini@eu.citrix.com On Thu, 29 Jan 2015, Markus Armbruster wrote: > Reproducer: qemu -nodefaults -S -display none -device xen-platform > > Yes, xen-platform makes no sense without Xen, but it shouldn't crash. Is it just a matter of doing the following? diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index 28b324a..40ae1f3 100644 --- a/hw/i386/xen/xen_platform.c +++ b/hw/i386/xen/xen_platform.c @@ -177,6 +177,10 @@ static void platform_fixed_ioport_writeb(void *opaque, uint32_t addr, uint32_t v { PCIXenPlatformState *s = opaque; + if (!xen_enabled()) { + return; + } + switch (addr) { case 0: /* Platform flags */ { hvmmem_type_t mem_type = (val & PFFLAG_ROM_LOCK) ? > Backtrace: > > #0 0x00007fffef5a677c in hypercall_buffer_cache_lock () > from /lib64/libxenctrl.so.4.3 > #1 0x00007fffef5a68f1 in xc.hypercall_buffer_alloc_pages () > from /lib64/libxenctrl.so.4.3 > #2 0x00007fffef5a6a61 in xc.hypercall_buffer_alloc () > from /lib64/libxenctrl.so.4.3 > #3 0x00007fffef59da54 in xc_hvm_set_mem_type () from /lib64/libxenctrl.so.4.3 > #4 0x00005555556d5bcd in platform_fixed_ioport_writeb (opaque=0x5555564713b0, > addr=0, val=0) at /work/armbru/qemu/hw/i386/xen/xen_platform.c:184 > #5 0x00005555556d5ca4 in platform_fixed_ioport_reset (opaque=0x5555564713b0) > at /work/armbru/qemu/hw/i386/xen/xen_platform.c:238 > #6 0x00005555556d608c in platform_reset (dev=0x5555564713b0) > at /work/armbru/qemu/hw/i386/xen/xen_platform.c:417 > #7 0x00005555557e915b in device_reset (dev=0x5555564713b0) > at /work/armbru/qemu/hw/core/qdev.c:1269 > #8 0x00005555557e6a7b in qdev_reset_one (dev=0x5555564713b0, opaque=0x0) > at /work/armbru/qemu/hw/core/qdev.c:329 > #9 0x00005555557e7608 in qdev_walk_children (dev=0x5555564713b0, > pre_devfn=0x0, pre_busfn=0x0, post_devfn=0x5555557e6a5f , > post_busfn=0x5555557e6a82 , opaque=0x0) > at /work/armbru/qemu/hw/core/qdev.c:643 > #10 0x00005555557e74fb in qbus_walk_children (bus=0x5555563b1f00, > pre_devfn=0x0, pre_busfn=0x0, post_devfn=0x5555557e6a5f , > post_busfn=0x5555557e6a82 , opaque=0x0) > at /work/armbru/qemu/hw/core/qdev.c:601 > #11 0x00005555557e75cc in qdev_walk_children (dev=0x5555563d67d0, > pre_devfn=0x0, pre_busfn=0x0, post_devfn=0x5555557e6a5f , > post_busfn=0x5555557e6a82 , opaque=0x0) > at /work/armbru/qemu/hw/core/qdev.c:635 > #12 0x00005555557e74fb in qbus_walk_children (bus=0x5555563bd3c0, > pre_devfn=0x0, pre_busfn=0x0, post_devfn=0x5555557e6a5f , > post_busfn=0x5555557e6a82 , opaque=0x0) > at /work/armbru/qemu/hw/core/qdev.c:601 > #13 0x00005555557e6b57 in qbus_reset_all (bus=0x5555563bd3c0) > at /work/armbru/qemu/hw/core/qdev.c:350 > #14 0x00005555557e6b79 in qbus_reset_all_fn (opaque=0x5555563bd3c0) > at /work/armbru/qemu/hw/core/qdev.c:356 > #15 0x00005555557587b9 in qemu_devices_reset () at /work/armbru/qemu/vl.c:1614 > #16 0x0000555555758845 in qemu_system_reset (report=false) > at /work/armbru/qemu/vl.c:1627 > #17 0x0000555555760739 in main (argc=7, argv=0x7fffffffe0f8, > envp=0x7fffffffe138) at /work/armbru/qemu/vl.c:4315 > > Sorry, no libxenctrl symbols installed. >