qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for-1.6 0/4] pci,virtio fixes for 1.6
@ 2013-08-12 12:02 Michael S. Tsirkin
  2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 1/4] pc: disable pci-info " Michael S. Tsirkin
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-08-12 12:02 UTC (permalink / raw)
  To: qemu-devel, Anthony Liguori; +Cc: mst, kraxel, afaerber, stefanha, qemu-stable

From: Michael S. Tsirkin <mst@redhat.com>

The following changes since commit 6fdf98f281f85ae6e2883bed2f691bcfe33b1f9f:

  fw_cfg: the I/O port variant expects little-endian (2013-08-07 12:48:15 -0500)

are available in the git repository at:

  git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_anthony

for you to fetch changes up to 3561ba14188b3c1e54246ed6db97896bbc082d2f:

  vhost: clear signalled_used_valid on vhost stop (2013-08-12 12:25:17 +0300)

----------------------------------------------------------------
pci,virtio fixes for 1.6

This includes some last-minute bugfixes for 1.6.
All very small patches that also look very safe to me.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
Gerd Hoffmann (1):
      i82801b11: Fix i82801b11 PCI host bridge config space

Michael S. Tsirkin (2):
      pc: disable pci-info for 1.6
      vhost: clear signalled_used_valid on vhost stop

Stefan Hajnoczi (1):
      virtio: clear signalled_used_valid when switching from dataplane

 hw/i386/pc_piix.c           | 9 +++++++--
 hw/i386/pc_q35.c            | 9 +++++++--
 hw/pci-bridge/i82801b11.c   | 1 +
 hw/virtio/dataplane/vring.c | 1 +
 hw/virtio/vhost.c           | 1 +
 hw/virtio/virtio.c          | 5 +++++
 include/hw/virtio/virtio.h  | 1 +
 7 files changed, 23 insertions(+), 4 deletions(-)

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

* [Qemu-devel] [PULL for-1.6 1/4] pc: disable pci-info for 1.6
  2013-08-12 12:02 [Qemu-devel] [PULL for-1.6 0/4] pci,virtio fixes for 1.6 Michael S. Tsirkin
@ 2013-08-12 12:02 ` Michael S. Tsirkin
  2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 2/4] i82801b11: Fix i82801b11 PCI host bridge config space Michael S. Tsirkin
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-08-12 12:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori

The BIOS that we ship in 1.6 does not use pci info
from host (yet). Several issues turned up
(e.g. around winXP boot crashes). So it's safest to disable that
interface for 1.6 machine types for now, leave it on for 1.7
as we have enough time to fix issues if any.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/pc_piix.c | 9 +++++++--
 hw/i386/pc_q35.c  | 9 +++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index ab25458..95c45b8 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -249,12 +249,17 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
              initrd_filename, cpu_model, 1, 1);
 }
 
-static void pc_init_pci_1_5(QEMUMachineInitArgs *args)
+static void pc_init_pci_1_6(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
     pc_init_pci(args);
 }
 
+static void pc_init_pci_1_5(QEMUMachineInitArgs *args)
+{
+    pc_init_pci_1_6(args);
+}
+
 static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
 {
     has_pvpanic = false;
@@ -340,7 +345,7 @@ static QEMUMachine pc_i440fx_machine_v1_6 = {
     .name = "pc-i440fx-1.6",
     .alias = "pc",
     .desc = "Standard PC (i440FX + PIIX, 1996)",
-    .init = pc_init_pci,
+    .init = pc_init_pci_1_6,
     .hot_add_cpu = pc_hot_add_cpu,
     .max_cpus = 255,
     .is_default = 1,
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 2f35d12..6bfc2ca 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -217,12 +217,17 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
     }
 }
 
-static void pc_q35_init_1_5(QEMUMachineInitArgs *args)
+static void pc_q35_init_1_6(QEMUMachineInitArgs *args)
 {
     has_pci_info = false;
     pc_q35_init(args);
 }
 
+static void pc_q35_init_1_5(QEMUMachineInitArgs *args)
+{
+    pc_q35_init_1_6(args);
+}
+
 static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
 {
     has_pvpanic = false;
@@ -234,7 +239,7 @@ static QEMUMachine pc_q35_machine_v1_6 = {
     .name = "pc-q35-1.6",
     .alias = "q35",
     .desc = "Standard PC (Q35 + ICH9, 2009)",
-    .init = pc_q35_init,
+    .init = pc_q35_init_1_6,
     .hot_add_cpu = pc_hot_add_cpu,
     .max_cpus = 255,
     DEFAULT_MACHINE_OPTIONS,
-- 
MST

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

* [Qemu-devel] [PULL for-1.6 2/4] i82801b11: Fix i82801b11 PCI host bridge config space
  2013-08-12 12:02 [Qemu-devel] [PULL for-1.6 0/4] pci,virtio fixes for 1.6 Michael S. Tsirkin
  2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 1/4] pc: disable pci-info " Michael S. Tsirkin
@ 2013-08-12 12:02 ` Michael S. Tsirkin
  2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 3/4] virtio: clear signalled_used_valid when switching from dataplane Michael S. Tsirkin
  2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 4/4] vhost: clear signalled_used_valid on vhost stop Michael S. Tsirkin
  3 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-08-12 12:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, =?UTF-8?q?Andreas=20F=C3=A4rber?=, qemu-stable

From: Gerd Hoffmann <kraxel@redhat.com>

pci_bridge_write_config() was not being used.

Cc: qemu-stable@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/pci-bridge/i82801b11.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
index 8a5e426..14cd7fd 100644
--- a/hw/pci-bridge/i82801b11.c
+++ b/hw/pci-bridge/i82801b11.c
@@ -90,6 +90,7 @@ static void i82801b11_bridge_class_init(ObjectClass *klass, void *data)
     k->device_id = PCI_DEVICE_ID_INTEL_82801BA_11;
     k->revision = ICH9_D2P_A2_REVISION;
     k->init = i82801b11_bridge_initfn;
+    k->config_write = pci_bridge_write_config;
     set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
-- 
MST

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

* [Qemu-devel] [PULL for-1.6 3/4] virtio: clear signalled_used_valid when switching from dataplane
  2013-08-12 12:02 [Qemu-devel] [PULL for-1.6 0/4] pci,virtio fixes for 1.6 Michael S. Tsirkin
  2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 1/4] pc: disable pci-info " Michael S. Tsirkin
  2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 2/4] i82801b11: Fix i82801b11 PCI host bridge config space Michael S. Tsirkin
@ 2013-08-12 12:02 ` Michael S. Tsirkin
  2013-08-13 14:26   ` Michael Roth
  2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 4/4] vhost: clear signalled_used_valid on vhost stop Michael S. Tsirkin
  3 siblings, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-08-12 12:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi

From: Stefan Hajnoczi <stefanha@redhat.com>

When the dataplane thread stops, its vring.c implementation synchronizes
vring state back to virtio.c so we can continue emulating the virtio
device.

This patch ensures that virtio.c's signalled_used_valid flag is reset so
that we do not suppress guest notifications due to stale signalled_used
values.

Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/dataplane/vring.c | 1 +
 hw/virtio/virtio.c          | 5 +++++
 include/hw/virtio/virtio.h  | 1 +
 3 files changed, 7 insertions(+)

diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
index 82cc151..351a343 100644
--- a/hw/virtio/dataplane/vring.c
+++ b/hw/virtio/dataplane/vring.c
@@ -52,6 +52,7 @@ bool vring_setup(Vring *vring, VirtIODevice *vdev, int n)
 void vring_teardown(Vring *vring, VirtIODevice *vdev, int n)
 {
     virtio_queue_set_last_avail_idx(vdev, n, vring->last_avail_idx);
+    virtio_queue_invalidate_signalled_used(vdev, n);
 
     hostmem_finalize(&vring->hostmem);
 }
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 09f62c6..706bdf4 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1059,6 +1059,11 @@ void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t idx)
     vdev->vq[n].last_avail_idx = idx;
 }
 
+void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n)
+{
+    vdev->vq[n].signalled_used_valid = false;
+}
+
 VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n)
 {
     return vdev->vq + n;
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index d7e9e0f..a90522d 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -237,6 +237,7 @@ hwaddr virtio_queue_get_used_size(VirtIODevice *vdev, int n);
 hwaddr virtio_queue_get_ring_size(VirtIODevice *vdev, int n);
 uint16_t virtio_queue_get_last_avail_idx(VirtIODevice *vdev, int n);
 void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t idx);
+void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n);
 VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n);
 uint16_t virtio_get_queue_index(VirtQueue *vq);
 int virtio_queue_get_id(VirtQueue *vq);
-- 
MST

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

* [Qemu-devel] [PULL for-1.6 4/4] vhost: clear signalled_used_valid on vhost stop
  2013-08-12 12:02 [Qemu-devel] [PULL for-1.6 0/4] pci,virtio fixes for 1.6 Michael S. Tsirkin
                   ` (2 preceding siblings ...)
  2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 3/4] virtio: clear signalled_used_valid when switching from dataplane Michael S. Tsirkin
@ 2013-08-12 12:02 ` Michael S. Tsirkin
  3 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-08-12 12:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable

When vhost device stops, its implementation synchronizes kernel state
back to virtio.c so we can continue emulating the device
in userspace.

This patch ensures that virtio.c's signalled_used_valid flag is reset so
that userspace does not suppress guest notifications due to stale
signalled_used values.

Cc: qemu-stable@nongnu.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/vhost.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 8f6ab13..9e336ad 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -762,6 +762,7 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev,
         fflush(stderr);
     }
     virtio_queue_set_last_avail_idx(vdev, idx, state.num);
+    virtio_queue_invalidate_signalled_used(vdev, idx);
     assert (r >= 0);
     cpu_physical_memory_unmap(vq->ring, virtio_queue_get_ring_size(vdev, idx),
                               0, virtio_queue_get_ring_size(vdev, idx));
-- 
MST

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

* Re: [Qemu-devel] [PULL for-1.6 3/4] virtio: clear signalled_used_valid when switching from dataplane
  2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 3/4] virtio: clear signalled_used_valid when switching from dataplane Michael S. Tsirkin
@ 2013-08-13 14:26   ` Michael Roth
  2013-08-13 14:41     ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Roth @ 2013-08-13 14:26 UTC (permalink / raw)
  To: Michael S. Tsirkin, qemu-devel; +Cc: Anthony Liguori, Stefan Hajnoczi

Quoting Michael S. Tsirkin (2013-08-12 07:02:42)
> From: Stefan Hajnoczi <stefanha@redhat.com>
> 
> When the dataplane thread stops, its vring.c implementation synchronizes
> vring state back to virtio.c so we can continue emulating the virtio
> device.
> 
> This patch ensures that virtio.c's signalled_used_valid flag is reset so
> that we do not suppress guest notifications due to stale signalled_used
> values.
> 
> Suggested-by: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Is this applicable for qemu-stable? It's a dependency of 4/4 of this series
which I'm planning on pulling in.

> ---
>  hw/virtio/dataplane/vring.c | 1 +
>  hw/virtio/virtio.c          | 5 +++++
>  include/hw/virtio/virtio.h  | 1 +
>  3 files changed, 7 insertions(+)
> 
> diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
> index 82cc151..351a343 100644
> --- a/hw/virtio/dataplane/vring.c
> +++ b/hw/virtio/dataplane/vring.c
> @@ -52,6 +52,7 @@ bool vring_setup(Vring *vring, VirtIODevice *vdev, int n)
>  void vring_teardown(Vring *vring, VirtIODevice *vdev, int n)
>  {
>      virtio_queue_set_last_avail_idx(vdev, n, vring->last_avail_idx);
> +    virtio_queue_invalidate_signalled_used(vdev, n);
> 
>      hostmem_finalize(&vring->hostmem);
>  }
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index 09f62c6..706bdf4 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -1059,6 +1059,11 @@ void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t idx)
>      vdev->vq[n].last_avail_idx = idx;
>  }
> 
> +void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n)
> +{
> +    vdev->vq[n].signalled_used_valid = false;
> +}
> +
>  VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n)
>  {
>      return vdev->vq + n;
> diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> index d7e9e0f..a90522d 100644
> --- a/include/hw/virtio/virtio.h
> +++ b/include/hw/virtio/virtio.h
> @@ -237,6 +237,7 @@ hwaddr virtio_queue_get_used_size(VirtIODevice *vdev, int n);
>  hwaddr virtio_queue_get_ring_size(VirtIODevice *vdev, int n);
>  uint16_t virtio_queue_get_last_avail_idx(VirtIODevice *vdev, int n);
>  void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t idx);
> +void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n);
>  VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n);
>  uint16_t virtio_get_queue_index(VirtQueue *vq);
>  int virtio_queue_get_id(VirtQueue *vq);
> -- 
> MST

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

* Re: [Qemu-devel] [PULL for-1.6 3/4] virtio: clear signalled_used_valid when switching from dataplane
  2013-08-13 14:26   ` Michael Roth
@ 2013-08-13 14:41     ` Michael S. Tsirkin
  0 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2013-08-13 14:41 UTC (permalink / raw)
  To: Michael Roth; +Cc: Anthony Liguori, qemu-devel, Stefan Hajnoczi

On Tue, Aug 13, 2013 at 09:26:39AM -0500, Michael Roth wrote:
> Quoting Michael S. Tsirkin (2013-08-12 07:02:42)
> > From: Stefan Hajnoczi <stefanha@redhat.com>
> > 
> > When the dataplane thread stops, its vring.c implementation synchronizes
> > vring state back to virtio.c so we can continue emulating the virtio
> > device.
> > 
> > This patch ensures that virtio.c's signalled_used_valid flag is reset so
> > that we do not suppress guest notifications due to stale signalled_used
> > values.
> > 
> > Suggested-by: Kevin Wolf <kwolf@redhat.com>
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> 
> Is this applicable for qemu-stable? It's a dependency of 4/4 of this series
> which I'm planning on pulling in.

Certainly does no harm there.

> > ---
> >  hw/virtio/dataplane/vring.c | 1 +
> >  hw/virtio/virtio.c          | 5 +++++
> >  include/hw/virtio/virtio.h  | 1 +
> >  3 files changed, 7 insertions(+)
> > 
> > diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
> > index 82cc151..351a343 100644
> > --- a/hw/virtio/dataplane/vring.c
> > +++ b/hw/virtio/dataplane/vring.c
> > @@ -52,6 +52,7 @@ bool vring_setup(Vring *vring, VirtIODevice *vdev, int n)
> >  void vring_teardown(Vring *vring, VirtIODevice *vdev, int n)
> >  {
> >      virtio_queue_set_last_avail_idx(vdev, n, vring->last_avail_idx);
> > +    virtio_queue_invalidate_signalled_used(vdev, n);
> > 
> >      hostmem_finalize(&vring->hostmem);
> >  }
> > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> > index 09f62c6..706bdf4 100644
> > --- a/hw/virtio/virtio.c
> > +++ b/hw/virtio/virtio.c
> > @@ -1059,6 +1059,11 @@ void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t idx)
> >      vdev->vq[n].last_avail_idx = idx;
> >  }
> > 
> > +void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n)
> > +{
> > +    vdev->vq[n].signalled_used_valid = false;
> > +}
> > +
> >  VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n)
> >  {
> >      return vdev->vq + n;
> > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
> > index d7e9e0f..a90522d 100644
> > --- a/include/hw/virtio/virtio.h
> > +++ b/include/hw/virtio/virtio.h
> > @@ -237,6 +237,7 @@ hwaddr virtio_queue_get_used_size(VirtIODevice *vdev, int n);
> >  hwaddr virtio_queue_get_ring_size(VirtIODevice *vdev, int n);
> >  uint16_t virtio_queue_get_last_avail_idx(VirtIODevice *vdev, int n);
> >  void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t idx);
> > +void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n);
> >  VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n);
> >  uint16_t virtio_get_queue_index(VirtQueue *vq);
> >  int virtio_queue_get_id(VirtQueue *vq);
> > -- 
> > MST

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

end of thread, other threads:[~2013-08-13 14:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-12 12:02 [Qemu-devel] [PULL for-1.6 0/4] pci,virtio fixes for 1.6 Michael S. Tsirkin
2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 1/4] pc: disable pci-info " Michael S. Tsirkin
2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 2/4] i82801b11: Fix i82801b11 PCI host bridge config space Michael S. Tsirkin
2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 3/4] virtio: clear signalled_used_valid when switching from dataplane Michael S. Tsirkin
2013-08-13 14:26   ` Michael Roth
2013-08-13 14:41     ` Michael S. Tsirkin
2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 4/4] vhost: clear signalled_used_valid on vhost stop Michael S. Tsirkin

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).