qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] lsi_soft_reset: Assertion `!s->current' failed with Windows XP setup
@ 2013-04-12 14:02 Claudio Bley
  2013-04-29 15:54 ` Paolo Bonzini
  0 siblings, 1 reply; 8+ messages in thread
From: Claudio Bley @ 2013-04-12 14:02 UTC (permalink / raw)
  To: qemu-devel

Hi.

I'm using the latest qemu release 1.4.0 and libvirt 1.0.4.

The host system is a Ubuntu 12.04 LTS system, Intel Xeon processor,
4GB RAM.

When trying to install Windows XP I constantly receive this error
(usually right before the graphical Setup is started). Once, I've seen
this error too:

hw/lsi53c895a.c:351: lsi_soft_reset: Assertion `((&s->queue)->tqh_first == ((void *)0))' failed.

I found the thread here
http://lists.gnu.org/archive/html/qemu-devel/2012-11/msg00518.html but
it didn't led me nowhere. 

I recompiled with DEBUG_SCSI and DEBUG_LSI enabled. Here's the command
libvirt put together and the last few lines of output. I can provide
the complete log if you need it.

LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOME=/root USER=root LOGNAME=root QEMU_AUDIO_DRV=none \
/home/build/qemu/x86_64-softmmu/qemu-system-x86_64 -name WindowsXP-pro-xp3-sp3 -S -M pc-1.0 -cpu coreduo -enable-kvm -m 1024 \
-smp 1,sockets=1,cores=1,threads=1 -uuid e54b0ce1-fb1e-3faf-d05e-cfa2ed1837ab -no-user-config -nodefaults \
-chardev socket,id=charmonitor,path=/usr/local/var/lib/libvirt/qemu/WindowsXP-pro-xp3-sp3.monitor,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control -rtc base=localtime -no-reboot -no-shutdown \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
-device lsi,id=scsi0,bus=pci.0,addr=0x4 \
-drive file=/dev/vm-storage/winxpro-de,if=none,id=drive-scsi0-0-0,format=raw \
-device scsi-hd,bus=scsi0.0,scsi-id=0,drive=drive-scsi0-0-0,id=scsi0-0-0,bootindex=2 \
-drive file=/var/lib/libvirt/images/winxpprosp3-de.iso,if=none,id=drive-scsi0-0-1,readonly=on,format=raw \
-device scsi-cd,bus=scsi0.0,scsi-id=1,drive=drive-scsi0-0-1,id=scsi0-0-1,bootindex=1 \
-netdev tap,fd=20,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:05:4f:1b,bus=pci.0,addr=0x3 \
-chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 \
-device usb-tablet,id=input0 -vnc 127.0.0.1:1 -k de -vga std -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5

[...]
lsi_scsi: SCRIPTS dsp=febf0588 opcode e2100004 arg febf0044
lsi_scsi: Store reg 0x10 size 4 addr 0xfebf0044
lsi_scsi: SCRIPTS dsp=febf0590 opcode e1100004 arg febf0048
lsi_scsi: Load reg 0x10 size 4 addr 0xfebf0048 = 0676e308
lsi_scsi: SCRIPTS dsp=febf0598 opcode f25c0004 arg 00000000
lsi_scsi: Load reg 0x10 size 4 addr 0xfebf0048 = 0676e308
lsi_scsi: SCRIPTS dsp=febf0598 opcode f25c0004 arg 00000000
lsi_scsi: Store reg 0x5c size 4 addr 0x0676e308
lsi_scsi: SCRIPTS dsp=febf05a0 opcode f11c0004 arg 00000004
lsi_scsi: Load reg 0x1c size 4 addr 0x0676e30c = 0676e310
lsi_scsi: SCRIPTS dsp=febf05a8 opcode e21c0004 arg febf0048
lsi_scsi: Store reg 0x1c size 4 addr 0xfebf0048
lsi_scsi: SCRIPTS dsp=febf05b0 opcode e1100004 arg febf0044
lsi_scsi: Load reg 0x10 size 4 addr 0xfebf0044 = 0676fe80
lsi_scsi: SCRIPTS dsp=febf05b8 opcode e1dc0004 arg febf0cb8
lsi_scsi: Load reg 0xdc size 4 addr 0xfebf0cb8 = 00000000
lsi_scsi: SCRIPTS dsp=febf05c0 opcode 1e000000 arg 00000028
lsi_scsi: MSG out len=3
lsi_scsi: Select LUN 0
lsi_scsi: SIMPLE queue tag=0x8f
lsi_scsi: SCRIPTS dsp=febf05c8 opcode 828b0000 arg 00000018
lsi_scsi: Compare phase 2 == 2
lsi_scsi: Jump to 0xfebf05e8
lsi_scsi: SCRIPTS dsp=febf05e8 opcode 1a000000 arg 00000020
lsi_scsi: Send command len=10
scsi-disk: Command: lun=0 tag=0x1008f data=0x2a
scsi-disk: Write (sector 418919, count 8)
scsi-disk: Write complete tag=0x1008f more=4096
lsi_scsi: Data ready tag=0x1008f len=4096
lsi_scsi: SCRIPTS dsp=febf05f0 opcode 818b0000 arg 00000020
lsi_scsi: Data ready tag=0x1008f len=4096
lsi_scsi: SCRIPTS dsp=febf05f0 opcode 818b0000 arg 00000020
lsi_scsi: Compare phase 0 == 1
lsi_scsi: Control condition failed
lsi_scsi: SCRIPTS dsp=febf05f8 opcode 808a0000 arg 00000018
lsi_scsi: Compare phase 0 == 0
lsi_scsi: Jump to 0xfebf0618
lsi_scsi: SCRIPTS dsp=febf0618 opcode f11c0004 arg 00000004
lsi_scsi: Load reg 0x1c size 4 addr 0x0676fe84 = 0676feb0
lsi_scsi: SCRIPTS dsp=febf0620 opcode e01c0004 arg febf0634
lsi_scsi: Store reg 0x1c size 4 addr 0xfebf0634
lsi_scsi: SCRIPTS dsp=febf0628 opcode 80000000 arg 00000000
lsi_scsi: NOP
lsi_scsi: SCRIPTS dsp=febf0630 opcode 88080000 arg 0676feb0
lsi_scsi: Call 0x0676feb0
lsi_scsi: SCRIPTS dsp=0676feb0 opcode 98020000 arg 00000020
lsi_scsi: Compare phase 0 != 0
lsi_scsi: Control condition failed
lsi_scsi: SCRIPTS dsp=0676feb8 opcode 08001000 arg 0675b000
lsi_scsi: DMA addr=0x675b000 len=4096
lsi_scsi: SCRIPTS execution stopped
lsi_scsi: Reset
qemu-system-x86_64: hw/lsi53c895a.c:352: lsi_soft_reset: Assertion `!s->current' failed.
2013-04-12 13:13:21.196+0000: shutting down

BTW, I also tried the megasas controller, which gave me a blue screen.

Any directions on how to go about solving this would be great. TIA!

Claudio
-- 
AV-Test GmbH, Henricistraße 20, 04155 Leipzig, Germany
Phone: +49 341 265 310 19
Web:<http://www.av-test.org>

Eingetragen am / Registered at: Amtsgericht Stendal (HRB 114076)
Geschaeftsfuehrer (CEO): Andreas Marx, Guido Habicht, Maik Morgenstern

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] lsi_soft_reset: Assertion `!s->current' failed with Windows XP setup
  2013-04-12 14:02 [Qemu-devel] lsi_soft_reset: Assertion `!s->current' failed with Windows XP setup Claudio Bley
@ 2013-04-29 15:54 ` Paolo Bonzini
  2013-04-30 12:59   ` Claudio Bley
  0 siblings, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2013-04-29 15:54 UTC (permalink / raw)
  To: Claudio Bley; +Cc: qemu-devel

Il 12/04/2013 16:02, Claudio Bley ha scritto:
> Hi.
> 
> I'm using the latest qemu release 1.4.0 and libvirt 1.0.4.
> 
> The host system is a Ubuntu 12.04 LTS system, Intel Xeon processor,
> 4GB RAM.
> 
> When trying to install Windows XP I constantly receive this error
> (usually right before the graphical Setup is started). Once, I've seen
> this error too:
> 
> hw/lsi53c895a.c:351: lsi_soft_reset: Assertion `((&s->queue)->tqh_first == ((void *)0))' failed.
> 
> I found the thread here
> http://lists.gnu.org/archive/html/qemu-devel/2012-11/msg00518.html but
> it didn't led me nowhere. 
> 
> I recompiled with DEBUG_SCSI and DEBUG_LSI enabled. Here's the command
> libvirt put together and the last few lines of output. I can provide
> the complete log if you need it.

Hi, sorry---I just read this now.

Can you please try the patches at
http://cache.gmane.org//gmane/comp/emulators/qemu/208057-001.bin?

Thanks,

Paolo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] lsi_soft_reset: Assertion `!s->current' failed with Windows XP setup
  2013-04-29 15:54 ` Paolo Bonzini
@ 2013-04-30 12:59   ` Claudio Bley
  2013-04-30 13:44     ` Paolo Bonzini
  2013-05-02 17:20     ` Paolo Bonzini
  0 siblings, 2 replies; 8+ messages in thread
From: Claudio Bley @ 2013-04-30 12:59 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

At Mon, 29 Apr 2013 17:54:37 +0200,
Paolo Bonzini wrote:
> 
> Il 12/04/2013 16:02, Claudio Bley ha scritto:
> > Hi.
> > 
> > I'm using the latest qemu release 1.4.0 and libvirt 1.0.4.
> > 
> > The host system is a Ubuntu 12.04 LTS system, Intel Xeon processor,
> > 4GB RAM.
> > 
> > When trying to install Windows XP I constantly receive this error
> > (usually right before the graphical Setup is started). Once, I've seen
> > this error too:
> > 
> > hw/lsi53c895a.c:351: lsi_soft_reset: Assertion `((&s->queue)->tqh_first == ((void *)0))' failed.
> > 
> > I found the thread here
> > http://lists.gnu.org/archive/html/qemu-devel/2012-11/msg00518.html but
> > it didn't led me nowhere. 
> > 
> > I recompiled with DEBUG_SCSI and DEBUG_LSI enabled. Here's the command
> > libvirt put together and the last few lines of output. I can provide
> > the complete log if you need it.
> 
> Hi, sorry---I just read this now.
> 
> Can you please try the patches at
> http://cache.gmane.org//gmane/comp/emulators/qemu/208057-001.bin?

I gave it a shot and this fixed the bug for me.

I've applied the patches to git tag v1.4.1 with minor modifications:

- skipped patch 1 and 2 since they already had been applied upstream
  in the meantime, AFAICS

- s/vists/visits/ in subject line of patch 3

- updated patch 3 and 4 in order to adjust for moved-around files and
  some code changes since 1.3.0

Thanks!

Here are the updated patches:

------- >8 ---------------------------------------------
From e33168365eae0d6610762ebafd22f26a7a6168e1 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Mon, 17 Dec 2012 10:37:02 +0100
Subject: [PATCH 1/2] qdev: allow both pre- and post-order visits in qdev
 walking functions


Resetting should be done in post-order, not pre-order.  However,
qdev_walk_children and qbus_walk_children do not allow this.  Fix
it by adding two extra arguments to the functions.

---
 hw/qdev-core.h |   13 +++++++++----
 hw/qdev.c      |   45 +++++++++++++++++++++++++++++++++------------
 2 files changed, 42 insertions(+), 16 deletions(-)

diff --git a/hw/qdev-core.h b/hw/qdev-core.h
index 2486f36..a0d05ca 100644
--- a/hw/qdev-core.h
+++ b/hw/qdev-core.h
@@ -237,10 +237,15 @@ BusState *qbus_create(const char *typename, DeviceState *parent, const char *nam
 /* Returns > 0 if either devfn or busfn skip walk somewhere in cursion,
  *         < 0 if either devfn or busfn terminate walk somewhere in cursion,
  *           0 otherwise. */
-int qbus_walk_children(BusState *bus, qdev_walkerfn *devfn,
-                       qbus_walkerfn *busfn, void *opaque);
-int qdev_walk_children(DeviceState *dev, qdev_walkerfn *devfn,
-                       qbus_walkerfn *busfn, void *opaque);
+int qbus_walk_children(BusState *bus,
+                       qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn,
+                       qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn,
+                       void *opaque);
+int qdev_walk_children(DeviceState *dev,
+                       qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn,
+                       qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn,
+                       void *opaque);
+
 void qdev_reset_all(DeviceState *dev);
 
 /**
diff --git a/hw/qdev.c b/hw/qdev.c
index 689cd54..772cfe0 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -224,12 +224,12 @@ static int qbus_reset_one(BusState *bus, void *opaque)
 
 void qdev_reset_all(DeviceState *dev)
 {
-    qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL);
+    qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL);
 }
 
 void qbus_reset_all(BusState *bus)
 {
-    qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL);
+    qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL);
 }
 
 void qbus_reset_all_fn(void *opaque)
@@ -327,49 +327,70 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name)
     return NULL;
 }
 
-int qbus_walk_children(BusState *bus, qdev_walkerfn *devfn,
-                       qbus_walkerfn *busfn, void *opaque)
+int qbus_walk_children(BusState *bus,
+                       qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn,
+                       qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn,
+                       void *opaque)
 {
     BusChild *kid;
     int err;
 
-    if (busfn) {
-        err = busfn(bus, opaque);
+    if (pre_busfn) {
+        err = pre_busfn(bus, opaque);
         if (err) {
             return err;
         }
     }
 
     QTAILQ_FOREACH(kid, &bus->children, sibling) {
-        err = qdev_walk_children(kid->child, devfn, busfn, opaque);
+        err = qdev_walk_children(kid->child,
+                                 pre_devfn, pre_busfn,
+                                 post_devfn, post_busfn, opaque);
         if (err < 0) {
             return err;
         }
     }
 
+    if (post_busfn) {
+        err = post_busfn(bus, opaque);
+        if (err) {
+            return err;
+        }
+    }
+
     return 0;
 }
 
-int qdev_walk_children(DeviceState *dev, qdev_walkerfn *devfn,
-                       qbus_walkerfn *busfn, void *opaque)
+int qdev_walk_children(DeviceState *dev,
+                       qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn,
+                       qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn,
+                       void *opaque)
 {
     BusState *bus;
     int err;
 
-    if (devfn) {
-        err = devfn(dev, opaque);
+    if (pre_devfn) {
+        err = pre_devfn(dev, opaque);
         if (err) {
             return err;
         }
     }
 
     QLIST_FOREACH(bus, &dev->child_bus, sibling) {
-        err = qbus_walk_children(bus, devfn, busfn, opaque);
+        err = qbus_walk_children(bus, pre_devfn, pre_busfn,
+                                 post_devfn, post_busfn, opaque);
         if (err < 0) {
             return err;
         }
     }
 
+    if (post_devfn) {
+        err = post_devfn(dev, opaque);
+        if (err) {
+            return err;
+        }
+    }
+
     return 0;
 }
 
-- 
1.7.9.5


From 79abbbbf1666452552876878dc16fd973eb41ee3 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Tue, 30 Apr 2013 14:36:23 +0200
Subject: [PATCH 2/2] qdev: switch reset to post-order


Post-order is the only sensible direction for the reset signals.
For example, suppose pre-order is used and the parent has some data
structures that cache children state (for example a list of active
requests).  When the reset method is invoked on the parent, these caches
could be in any state.

If post-order is used, on the other hand, these will be in a known state
when the reset method is invoked on the parent.

This change means that it is no longer possible to block the visit of
the devices, so the callback is changed to return void.  This is not
a problem, because PCI was returning 1 exactly in order to achieve the
same ordering that this patch implements.

PCI can then rely on the qdev core having sent a "reset signal" (whatever
that means) to the device, and only do the PCI-specific initialization
with pci_do_device_reset.

---
 hw/pci/pci.c   |   31 ++++++++++++++++---------------
 hw/qdev-core.h |    2 +-
 hw/qdev.c      |    6 +++---
 3 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 2f45c8f..2fcf69d 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -45,7 +45,7 @@
 static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent);
 static char *pcibus_get_dev_path(DeviceState *dev);
 static char *pcibus_get_fw_dev_path(DeviceState *dev);
-static int pcibus_reset(BusState *qbus);
+static void pcibus_reset(BusState *qbus);
 
 static Property pci_props[] = {
     DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1),
@@ -164,16 +164,10 @@ void pci_device_deassert_intx(PCIDevice *dev)
     }
 }
 
-/*
- * This function is called on #RST and FLR.
- * FLR if PCI_EXP_DEVCTL_BCR_FLR is set
- */
-void pci_device_reset(PCIDevice *dev)
+static void pci_do_device_reset(PCIDevice *dev)
 {
     int r;
 
-    qdev_reset_all(&dev->qdev);
-
     dev->irq_state = 0;
     pci_update_irq_status(dev);
     pci_device_deassert_intx(dev);
@@ -206,8 +200,19 @@ void pci_device_reset(PCIDevice *dev)
 }
 
 /*
+ * This function is called on #RST and FLR.
+ * FLR if PCI_EXP_DEVCTL_BCR_FLR is set
+ */
+void pci_device_reset(PCIDevice *dev)
+{
+    qdev_reset_all(&dev->qdev);
+    pci_do_device_reset(dev);
+}
+
+/*
  * Trigger pci bus reset under a given bus.
- * To be called on RST# assert.
+ * Called via qbus_reset_all on RST# assert, after the devices
+ * have been reset qdev_reset_all-ed already.
  */
 void pci_bus_reset(PCIBus *bus)
 {
@@ -218,18 +223,14 @@ void pci_bus_reset(PCIBus *bus)
     }
     for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) {
         if (bus->devices[i]) {
-            pci_device_reset(bus->devices[i]);
+            pci_do_device_reset(bus->devices[i]);
         }
     }
 }
 
-static int pcibus_reset(BusState *qbus)
+static void pcibus_reset(BusState *qbus)
 {
     pci_bus_reset(DO_UPCAST(PCIBus, qbus, qbus));
-
-    /* topology traverse is done by pci_bus_reset().
-       Tell qbus/qdev walker not to traverse the tree */
-    return 1;
 }
 
 static void pci_host_bus_register(int domain, PCIBus *bus)
diff --git a/hw/qdev-core.h b/hw/qdev-core.h
index a0d05ca..9be24db 100644
--- a/hw/qdev-core.h
+++ b/hw/qdev-core.h
@@ -144,7 +144,7 @@ struct BusClass {
      * bindings can be found at http://playground.sun.com/1275/bindings/.
      */
     char *(*get_fw_dev_path)(DeviceState *dev);
-    int (*reset)(BusState *bus);
+    void (*reset)(BusState *bus);
     /* maximum devices allowed on the bus, 0: no limit. */
     int max_dev;
 };
diff --git a/hw/qdev.c b/hw/qdev.c
index 772cfe0..cd8ecf8 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -217,19 +217,19 @@ static int qbus_reset_one(BusState *bus, void *opaque)
 {
     BusClass *bc = BUS_GET_CLASS(bus);
     if (bc->reset) {
-        return bc->reset(bus);
+        bc->reset(bus);
     }
     return 0;
 }
 
 void qdev_reset_all(DeviceState *dev)
 {
-    qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL);
+    qdev_walk_children(dev, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL);
 }
 
 void qbus_reset_all(BusState *bus)
 {
-    qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL);
+    qbus_walk_children(bus, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL);
 }
 
 void qbus_reset_all_fn(void *opaque)
-- 
1.7.9.5

-- 
AV-Test GmbH, Henricistraße 20, 04155 Leipzig, Germany
Phone: +49 341 265 310 19
Web:<http://www.av-test.org>

Eingetragen am / Registered at: Amtsgericht Stendal (HRB 114076)
Geschaeftsfuehrer (CEO): Andreas Marx, Guido Habicht, Maik Morgenstern

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] lsi_soft_reset: Assertion `!s->current' failed with Windows XP setup
  2013-04-30 12:59   ` Claudio Bley
@ 2013-04-30 13:44     ` Paolo Bonzini
  2013-05-02 17:20     ` Paolo Bonzini
  1 sibling, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2013-04-30 13:44 UTC (permalink / raw)
  To: Claudio Bley; +Cc: qemu-devel

Il 30/04/2013 14:59, Claudio Bley ha scritto:
> At Mon, 29 Apr 2013 17:54:37 +0200,
> Paolo Bonzini wrote:
>>
>> Il 12/04/2013 16:02, Claudio Bley ha scritto:
>>> Hi.
>>>
>>> I'm using the latest qemu release 1.4.0 and libvirt 1.0.4.
>>>
>>> The host system is a Ubuntu 12.04 LTS system, Intel Xeon processor,
>>> 4GB RAM.
>>>
>>> When trying to install Windows XP I constantly receive this error
>>> (usually right before the graphical Setup is started). Once, I've seen
>>> this error too:
>>>
>>> hw/lsi53c895a.c:351: lsi_soft_reset: Assertion `((&s->queue)->tqh_first == ((void *)0))' failed.
>>>
>>> I found the thread here
>>> http://lists.gnu.org/archive/html/qemu-devel/2012-11/msg00518.html but
>>> it didn't led me nowhere. 
>>>
>>> I recompiled with DEBUG_SCSI and DEBUG_LSI enabled. Here's the command
>>> libvirt put together and the last few lines of output. I can provide
>>> the complete log if you need it.
>>
>> Hi, sorry---I just read this now.
>>
>> Can you please try the patches at
>> http://cache.gmane.org//gmane/comp/emulators/qemu/208057-001.bin?
> 
> I gave it a shot and this fixed the bug for me.

Thanks very much.  It is late for 1.5 now, but these will be in 1.5.1
and 1.6.

Paolo

> I've applied the patches to git tag v1.4.1 with minor modifications:
> 
> - skipped patch 1 and 2 since they already had been applied upstream
>   in the meantime, AFAICS
> 
> - s/vists/visits/ in subject line of patch 3
> 
> - updated patch 3 and 4 in order to adjust for moved-around files and
>   some code changes since 1.3.0
> 
> Thanks!
> 
> Here are the updated patches:
> 
> ------- >8 ---------------------------------------------
> From e33168365eae0d6610762ebafd22f26a7a6168e1 Mon Sep 17 00:00:00 2001
> From: Paolo Bonzini <pbonzini@redhat.com>
> Date: Mon, 17 Dec 2012 10:37:02 +0100
> Subject: [PATCH 1/2] qdev: allow both pre- and post-order visits in qdev
>  walking functions
> 
> 
> Resetting should be done in post-order, not pre-order.  However,
> qdev_walk_children and qbus_walk_children do not allow this.  Fix
> it by adding two extra arguments to the functions.
> 
> ---
>  hw/qdev-core.h |   13 +++++++++----
>  hw/qdev.c      |   45 +++++++++++++++++++++++++++++++++------------
>  2 files changed, 42 insertions(+), 16 deletions(-)
> 
> diff --git a/hw/qdev-core.h b/hw/qdev-core.h
> index 2486f36..a0d05ca 100644
> --- a/hw/qdev-core.h
> +++ b/hw/qdev-core.h
> @@ -237,10 +237,15 @@ BusState *qbus_create(const char *typename, DeviceState *parent, const char *nam
>  /* Returns > 0 if either devfn or busfn skip walk somewhere in cursion,
>   *         < 0 if either devfn or busfn terminate walk somewhere in cursion,
>   *           0 otherwise. */
> -int qbus_walk_children(BusState *bus, qdev_walkerfn *devfn,
> -                       qbus_walkerfn *busfn, void *opaque);
> -int qdev_walk_children(DeviceState *dev, qdev_walkerfn *devfn,
> -                       qbus_walkerfn *busfn, void *opaque);
> +int qbus_walk_children(BusState *bus,
> +                       qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn,
> +                       qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn,
> +                       void *opaque);
> +int qdev_walk_children(DeviceState *dev,
> +                       qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn,
> +                       qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn,
> +                       void *opaque);
> +
>  void qdev_reset_all(DeviceState *dev);
>  
>  /**
> diff --git a/hw/qdev.c b/hw/qdev.c
> index 689cd54..772cfe0 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -224,12 +224,12 @@ static int qbus_reset_one(BusState *bus, void *opaque)
>  
>  void qdev_reset_all(DeviceState *dev)
>  {
> -    qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL);
> +    qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL);
>  }
>  
>  void qbus_reset_all(BusState *bus)
>  {
> -    qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL);
> +    qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL);
>  }
>  
>  void qbus_reset_all_fn(void *opaque)
> @@ -327,49 +327,70 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name)
>      return NULL;
>  }
>  
> -int qbus_walk_children(BusState *bus, qdev_walkerfn *devfn,
> -                       qbus_walkerfn *busfn, void *opaque)
> +int qbus_walk_children(BusState *bus,
> +                       qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn,
> +                       qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn,
> +                       void *opaque)
>  {
>      BusChild *kid;
>      int err;
>  
> -    if (busfn) {
> -        err = busfn(bus, opaque);
> +    if (pre_busfn) {
> +        err = pre_busfn(bus, opaque);
>          if (err) {
>              return err;
>          }
>      }
>  
>      QTAILQ_FOREACH(kid, &bus->children, sibling) {
> -        err = qdev_walk_children(kid->child, devfn, busfn, opaque);
> +        err = qdev_walk_children(kid->child,
> +                                 pre_devfn, pre_busfn,
> +                                 post_devfn, post_busfn, opaque);
>          if (err < 0) {
>              return err;
>          }
>      }
>  
> +    if (post_busfn) {
> +        err = post_busfn(bus, opaque);
> +        if (err) {
> +            return err;
> +        }
> +    }
> +
>      return 0;
>  }
>  
> -int qdev_walk_children(DeviceState *dev, qdev_walkerfn *devfn,
> -                       qbus_walkerfn *busfn, void *opaque)
> +int qdev_walk_children(DeviceState *dev,
> +                       qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn,
> +                       qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn,
> +                       void *opaque)
>  {
>      BusState *bus;
>      int err;
>  
> -    if (devfn) {
> -        err = devfn(dev, opaque);
> +    if (pre_devfn) {
> +        err = pre_devfn(dev, opaque);
>          if (err) {
>              return err;
>          }
>      }
>  
>      QLIST_FOREACH(bus, &dev->child_bus, sibling) {
> -        err = qbus_walk_children(bus, devfn, busfn, opaque);
> +        err = qbus_walk_children(bus, pre_devfn, pre_busfn,
> +                                 post_devfn, post_busfn, opaque);
>          if (err < 0) {
>              return err;
>          }
>      }
>  
> +    if (post_devfn) {
> +        err = post_devfn(dev, opaque);
> +        if (err) {
> +            return err;
> +        }
> +    }
> +
>      return 0;
>  }
>  
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] lsi_soft_reset: Assertion `!s->current' failed with Windows XP setup
  2013-04-30 12:59   ` Claudio Bley
  2013-04-30 13:44     ` Paolo Bonzini
@ 2013-05-02 17:20     ` Paolo Bonzini
  2013-07-29 13:31       ` Claudio Bley
  1 sibling, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2013-05-02 17:20 UTC (permalink / raw)
  To: Claudio Bley; +Cc: Jan Kiszka, qemu-devel

Il 30/04/2013 14:59, Claudio Bley ha scritto:
> At Mon, 29 Apr 2013 17:54:37 +0200,
> Paolo Bonzini wrote:
>>
>> Il 12/04/2013 16:02, Claudio Bley ha scritto:
>>> Hi.
>>>
>>> I'm using the latest qemu release 1.4.0 and libvirt 1.0.4.
>>>
>>> The host system is a Ubuntu 12.04 LTS system, Intel Xeon processor,
>>> 4GB RAM.
>>>
>>> When trying to install Windows XP I constantly receive this error
>>> (usually right before the graphical Setup is started). Once, I've seen
>>> this error too:
>>>
>>> hw/lsi53c895a.c:351: lsi_soft_reset: Assertion `((&s->queue)->tqh_first == ((void *)0))' failed.
>>>
>>> I found the thread here
>>> http://lists.gnu.org/archive/html/qemu-devel/2012-11/msg00518.html but
>>> it didn't led me nowhere. 
>>>
>>> I recompiled with DEBUG_SCSI and DEBUG_LSI enabled. Here's the command
>>> libvirt put together and the last few lines of output. I can provide
>>> the complete log if you need it.
>>
>> Hi, sorry---I just read this now.
>>
>> Can you please try the patches at
>> http://cache.gmane.org//gmane/comp/emulators/qemu/208057-001.bin?
> 
> I gave it a shot and this fixed the bug for me.
> 
> I've applied the patches to git tag v1.4.1 with minor modifications:
> 
> - skipped patch 1 and 2 since they already had been applied upstream
>   in the meantime, AFAICS
> 
> - s/vists/visits/ in subject line of patch 3
> 
> - updated patch 3 and 4 in order to adjust for moved-around files and
>   some code changes since 1.3.0
> 
> Thanks!
> 
> Here are the updated patches:

Thanks.  These will have to wait for 1.6 though.

This should work for all current releases.

Paolo

diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index c601b29..0648c77 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -348,6 +348,7 @@ static void lsi_soft_reset(LSIState *s)
     s->sbc = 0;
     s->csbc = 0;
     s->sbr = 0;
+    qbus_reset_all(&s->bus.qbus);
     assert(QTAILQ_EMPTY(&s->queue));
     assert(!s->current);
 }

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] lsi_soft_reset: Assertion `!s->current' failed with Windows XP setup
  2013-05-02 17:20     ` Paolo Bonzini
@ 2013-07-29 13:31       ` Claudio Bley
       [not found]         ` <51F6797F.9060007@redhat.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Claudio Bley @ 2013-07-29 13:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jan Kiszka

Hi.

At Thu, 02 May 2013 19:20:58 +0200,
Paolo Bonzini wrote:
> 
> Il 30/04/2013 14:59, Claudio Bley ha scritto:
> > At Mon, 29 Apr 2013 17:54:37 +0200,
> > Paolo Bonzini wrote:
> >>
> >> Can you please try the patches at
> >> http://cache.gmane.org//gmane/comp/emulators/qemu/208057-001.bin?
> > 
> > I gave it a shot and this fixed the bug for me.
> > 
> > I've applied the patches to git tag v1.4.1 with minor modifications:
> > 
> > - skipped patch 1 and 2 since they already had been applied upstream
> >   in the meantime, AFAICS
> > 
> > - s/vists/visits/ in subject line of patch 3
> > 
> > - updated patch 3 and 4 in order to adjust for moved-around files and
> >   some code changes since 1.3.0
> > 
> > Here are the updated patches:
> 
> Thanks.  These will have to wait for 1.6 though.

I just wanted to check in on you whether you still have this on your
radar for 1.6? I cannot seem to find any commits in this regard, yet.

Full discussion:
http://lists.gnu.org/archive/html/qemu-devel/2013-04/threads.html#02521

Claudio
-- 
AV-Test GmbH, Henricistraße 20, 04155 Leipzig, Germany
Phone: +49 341 265 310 19
Web:<http://www.av-test.org>

Eingetragen am / Registered at: Amtsgericht Stendal (HRB 114076)
Geschaeftsfuehrer (CEO): Andreas Marx, Guido Habicht, Maik Morgenstern

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] lsi_soft_reset: Assertion `!s->current' failed with Windows XP setup
       [not found]         ` <51F6797F.9060007@redhat.com>
@ 2013-10-10 13:41           ` Claudio Bley
  2013-10-10 13:42             ` Paolo Bonzini
  0 siblings, 1 reply; 8+ messages in thread
From: Claudio Bley @ 2013-10-10 13:41 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Jan Kiszka, qemu-devel


At Mon, 29 Jul 2013 16:17:35 +0200,
Paolo Bonzini wrote:
> 
> Il 29/07/2013 15:31, Claudio Bley ha scritto:
> > Hi.
> > 
> > At Thu, 02 May 2013 19:20:58 +0200,
> > Paolo Bonzini wrote:
> >>
> >> Il 30/04/2013 14:59, Claudio Bley ha scritto:
> >>> At Mon, 29 Apr 2013 17:54:37 +0200,
> >>> Paolo Bonzini wrote:
> >>>>
> >>>> Can you please try the patches at
> >>>> http://cache.gmane.org//gmane/comp/emulators/qemu/208057-001.bin?
> >>>
> >>> I gave it a shot and this fixed the bug for me.
> >>>
> >>> I've applied the patches to git tag v1.4.1 with minor modifications:
> >>>
> >>> - skipped patch 1 and 2 since they already had been applied upstream
> >>>   in the meantime, AFAICS
> >>>
> >>> - s/vists/visits/ in subject line of patch 3
> >>>
> >>> - updated patch 3 and 4 in order to adjust for moved-around files and
> >>>   some code changes since 1.3.0
> >>>
> >>> Here are the updated patches:
> >>
> >> Thanks.  These will have to wait for 1.6 though.
> > 
> > I just wanted to check in on you whether you still have this on your
> > radar for 1.6? I cannot seem to find any commits in this regard, yet.
> > 
> > Full discussion:
> > http://lists.gnu.org/archive/html/qemu-devel/2013-04/threads.html#02521
> 
> No, I had other stuff to do, sorry.  Thanks for reminding me though.

Sorry for being a pain in the neck... but, since it's been two months
now and 1.6.0 is released, as well as 1.6.1 and this bug is still out
there (AFAIS, it's not fixed looking through the git history) I just
wanted to check what's going on.

Why is there so little interest in getting this fixed?

BTW, the workaround you proposed here[1] works fine for me. What's
blocking the inclusion into qemu's git?

Kind regards.

[1] http://lists.gnu.org/archive/html/qemu-devel/2013-05/msg00248.html

-- 
Claudio

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] lsi_soft_reset: Assertion `!s->current' failed with Windows XP setup
  2013-10-10 13:41           ` Claudio Bley
@ 2013-10-10 13:42             ` Paolo Bonzini
  0 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2013-10-10 13:42 UTC (permalink / raw)
  To: Claudio Bley; +Cc: Jan Kiszka, qemu-devel

Il 10/10/2013 15:41, Claudio Bley ha scritto:
>> > 
>> > No, I had other stuff to do, sorry.  Thanks for reminding me though.
> Sorry for being a pain in the neck... but, since it's been two months
> now and 1.6.0 is released, as well as 1.6.1 and this bug is still out
> there (AFAIS, it's not fixed looking through the git history) I just
> wanted to check what's going on.

The patch is posted, waiting for review.

> BTW, the workaround you proposed here[1] works fine for me. What's
> blocking the inclusion into qemu's git?

I prefer to get the root cause fixed.

Paolo

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-10-10 13:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12 14:02 [Qemu-devel] lsi_soft_reset: Assertion `!s->current' failed with Windows XP setup Claudio Bley
2013-04-29 15:54 ` Paolo Bonzini
2013-04-30 12:59   ` Claudio Bley
2013-04-30 13:44     ` Paolo Bonzini
2013-05-02 17:20     ` Paolo Bonzini
2013-07-29 13:31       ` Claudio Bley
     [not found]         ` <51F6797F.9060007@redhat.com>
2013-10-10 13:41           ` Claudio Bley
2013-10-10 13:42             ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).