All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/4] s390x/virtio-ccw: migration and virtio for 2.4
@ 2015-06-09  8:39 Christian Borntraeger
  2015-06-09  8:39 ` [Qemu-devel] [PULL 1/4] virtio-ccw: add support for 9pfs Christian Borntraeger
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Christian Borntraeger @ 2015-06-09  8:39 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Cornelia Huck, Christian Borntraeger, Jens Freimann, qemu-devel,
	Alexander Graf

Peter,

The following changes since commit 42d58e7c6760cb9c55627c28ae538e27dcf2f144:

  Merge remote-tracking branch 'remotes/sstabellini/tags/xen-15-06-02-tag' into staging (2015-06-02 16:47:31 +0100)

are available in the git repository at:

  git://github.com/borntraeger/qemu.git tags/s390x-20150609

for you to fetch changes up to 6028ef075791913228c36f10cb270f1f52e9f076:

  s390x/migration: add comment about floating point migration (2015-06-09 09:54:57 +0200)

----------------------------------------------------------------
s390x/virtio-ccw: migration and virtio for 2.4

1. Migration fixups
2. virtio 9pfs

----------------------------------------------------------------
Christian Borntraeger (1):
      s390x/migration: add comment about floating point migration

Jason J. Herne (1):
      virtio-ccw/migration: Migrate config vector for virtio devices

Pierre Morel (1):
      virtio-ccw: add support for 9pfs

Sascha Silbe (1):
      s390x/kvm: always ignore empty vcpu interrupt state

 hw/s390x/virtio-ccw.c  | 60 +++++++++++++++++++++++++++++++++++++++++++++++++-
 hw/s390x/virtio-ccw.h  | 18 ++++++++++++++-
 target-s390x/kvm.c     |  7 +++---
 target-s390x/machine.c |  1 +
 4 files changed, 81 insertions(+), 5 deletions(-)

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

* [Qemu-devel] [PULL 1/4] virtio-ccw: add support for 9pfs
  2015-06-09  8:39 [Qemu-devel] [PULL 0/4] s390x/virtio-ccw: migration and virtio for 2.4 Christian Borntraeger
@ 2015-06-09  8:39 ` Christian Borntraeger
  2015-06-09  8:39 ` [Qemu-devel] [PULL 2/4] virtio-ccw/migration: Migrate config vector for virtio devices Christian Borntraeger
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Christian Borntraeger @ 2015-06-09  8:39 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Pierre Morel, qemu-devel, Alexander Graf, Christian Borntraeger,
	Jens Freimann, Cornelia Huck

From: Pierre Morel <pmorel@linux.vnet.ibm.com>

This patch adds 9pfs support for virtio-ccw
by registering the virtio_ccw_9p_info type
and adding associated callbacks.

Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 hw/s390x/virtio-ccw.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 hw/s390x/virtio-ccw.h | 18 ++++++++++++++++-
 2 files changed, 72 insertions(+), 2 deletions(-)

diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index ef90fed..ab629fe 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1,8 +1,9 @@
 /*
  * virtio ccw target implementation
  *
- * Copyright 2012,2014 IBM Corp.
+ * Copyright 2012,2015 IBM Corp.
  * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
+ *            Pierre Morel <pmorel@linux.vnet.ibm.com>
  *
  * This work is licensed under the terms of the GNU GPL, version 2 or (at
  * your option) any later version. See the COPYING file in the top-level
@@ -1730,6 +1731,56 @@ static const TypeInfo virtio_ccw_bus_info = {
     .class_init = virtio_ccw_bus_class_init,
 };
 
+#ifdef CONFIG_VIRTFS
+static Property virtio_ccw_9p_properties[] = {
+    DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
+    DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
+            VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
+    DEFINE_PROP_END_OF_LIST(),
+};
+
+static void virtio_ccw_9p_realize(VirtioCcwDevice *ccw_dev, Error **errp)
+{
+    V9fsCCWState *dev = VIRTIO_9P_CCW(ccw_dev);
+    DeviceState *vdev = DEVICE(&dev->vdev);
+    Error *err = NULL;
+
+    qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));
+    object_property_set_bool(OBJECT(vdev), true, "realized", &err);
+    if (err) {
+        error_propagate(errp, err);
+    }
+}
+
+static void virtio_ccw_9p_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+    VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
+
+    k->exit = virtio_ccw_exit;
+    k->realize = virtio_ccw_9p_realize;
+    dc->reset = virtio_ccw_reset;
+    dc->props = virtio_ccw_9p_properties;
+    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
+}
+
+static void virtio_ccw_9p_instance_init(Object *obj)
+{
+    V9fsCCWState *dev = VIRTIO_9P_CCW(obj);
+
+    virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
+                                TYPE_VIRTIO_9P);
+}
+
+static const TypeInfo virtio_ccw_9p_info = {
+    .name          = TYPE_VIRTIO_9P_CCW,
+    .parent        = TYPE_VIRTIO_CCW_DEVICE,
+    .instance_size = sizeof(V9fsCCWState),
+    .instance_init = virtio_ccw_9p_instance_init,
+    .class_init    = virtio_ccw_9p_class_init,
+};
+#endif
+
 static void virtio_ccw_register(void)
 {
     type_register_static(&virtio_ccw_bus_info);
@@ -1745,6 +1796,9 @@ static void virtio_ccw_register(void)
 #endif
     type_register_static(&virtio_ccw_rng);
     type_register_static(&virtual_css_bridge_info);
+#ifdef CONFIG_VIRTFS
+    type_register_static(&virtio_ccw_9p_info);
+#endif
 }
 
 type_init(virtio_ccw_register)
diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index ad3af76..d729263 100644
--- a/hw/s390x/virtio-ccw.h
+++ b/hw/s390x/virtio-ccw.h
@@ -1,8 +1,9 @@
 /*
  * virtio ccw target definitions
  *
- * Copyright 2012 IBM Corp.
+ * Copyright 2012,2015 IBM Corp.
  * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
+ *            Pierre Morel <pmorel@linux.vnet.ibm.com>
  *
  * This work is licensed under the terms of the GNU GPL, version 2 or (at
  * your option) any later version. See the COPYING file in the top-level
@@ -189,4 +190,19 @@ typedef struct VirtIORNGCcw {
 VirtualCssBus *virtual_css_bus_init(void);
 void virtio_ccw_device_update_status(SubchDev *sch);
 VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch);
+
+#ifdef CONFIG_VIRTFS
+#include "hw/9pfs/virtio-9p.h"
+
+#define TYPE_VIRTIO_9P_CCW "virtio-9p-ccw"
+#define VIRTIO_9P_CCW(obj) \
+    OBJECT_CHECK(V9fsCCWState, (obj), TYPE_VIRTIO_9P_CCW)
+
+typedef struct V9fsCCWState {
+    VirtioCcwDevice parent_obj;
+    V9fsState vdev;
+} V9fsCCWState;
+
+#endif /* CONFIG_VIRTFS */
+
 #endif
-- 
2.3.0

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

* [Qemu-devel] [PULL 2/4] virtio-ccw/migration: Migrate config vector for virtio devices
  2015-06-09  8:39 [Qemu-devel] [PULL 0/4] s390x/virtio-ccw: migration and virtio for 2.4 Christian Borntraeger
  2015-06-09  8:39 ` [Qemu-devel] [PULL 1/4] virtio-ccw: add support for 9pfs Christian Borntraeger
@ 2015-06-09  8:39 ` Christian Borntraeger
  2015-06-09  8:39 ` [Qemu-devel] [PULL 3/4] s390x/kvm: always ignore empty vcpu interrupt state Christian Borntraeger
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Christian Borntraeger @ 2015-06-09  8:39 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-devel, Alexander Graf, Christian Borntraeger, Jens Freimann,
	Jason J. Herne, Cornelia Huck

From: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>

virtio_ccw_{save|load}_config are missing code to save and restore a vdev's
config_vector value. This causes some virtio devices to become disabled
following a migration.

This patch fixes a bug whereby the qmp/hmp balloon command (virsh setmem)
silently fails to update the guest's available memory because the device was not
properly migrated.

This will break compatibility, but vmstate_s390_cpu was bumped from
version 2 to version 4 between v2.3.0 and v2.4.0 without a compat
handler. Furthermore, there is no production environment yet so
migration is fenced anyway between any relevant version of 2.3 and 2.4.

Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Message-Id: <1433343843-803-1-git-send-email-jjherne@linux.vnet.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 hw/s390x/virtio-ccw.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index ab629fe..ab5fc7f 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1311,6 +1311,7 @@ static void virtio_ccw_save_config(DeviceState *d, QEMUFile *f)
 {
     VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);
     SubchDev *s = dev->sch;
+    VirtIODevice *vdev = virtio_ccw_get_vdev(s);
 
     subch_device_save(s, f);
     if (dev->indicators != NULL) {
@@ -1334,6 +1335,7 @@ static void virtio_ccw_save_config(DeviceState *d, QEMUFile *f)
         qemu_put_be32(f, 0);
         qemu_put_be64(f, 0UL);
     }
+    qemu_put_be16(f, vdev->config_vector);
     qemu_put_be64(f, dev->routes.adapter.ind_offset);
     qemu_put_byte(f, dev->thinint_isc);
 }
@@ -1342,6 +1344,7 @@ static int virtio_ccw_load_config(DeviceState *d, QEMUFile *f)
 {
     VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);
     SubchDev *s = dev->sch;
+    VirtIODevice *vdev = virtio_ccw_get_vdev(s);
     int len;
 
     s->driver_data = dev;
@@ -1367,6 +1370,7 @@ static int virtio_ccw_load_config(DeviceState *d, QEMUFile *f)
         qemu_get_be64(f);
         dev->summary_indicator = NULL;
     }
+    qemu_get_be16s(f, &vdev->config_vector);
     dev->routes.adapter.ind_offset = qemu_get_be64(f);
     dev->thinint_isc = qemu_get_byte(f);
     if (s->thinint_active) {
-- 
2.3.0

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

* [Qemu-devel] [PULL 3/4] s390x/kvm: always ignore empty vcpu interrupt state
  2015-06-09  8:39 [Qemu-devel] [PULL 0/4] s390x/virtio-ccw: migration and virtio for 2.4 Christian Borntraeger
  2015-06-09  8:39 ` [Qemu-devel] [PULL 1/4] virtio-ccw: add support for 9pfs Christian Borntraeger
  2015-06-09  8:39 ` [Qemu-devel] [PULL 2/4] virtio-ccw/migration: Migrate config vector for virtio devices Christian Borntraeger
@ 2015-06-09  8:39 ` Christian Borntraeger
  2015-06-09  8:39 ` [Qemu-devel] [PULL 4/4] s390x/migration: add comment about floating point migration Christian Borntraeger
  2015-06-09 12:52 ` [Qemu-devel] [PULL 0/4] s390x/virtio-ccw: migration and virtio for 2.4 Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Christian Borntraeger @ 2015-06-09  8:39 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-devel, Alexander Graf, Christian Borntraeger, Jens Freimann,
	Cornelia Huck, Sascha Silbe

From: Sascha Silbe <silbe@linux.vnet.ibm.com>

kvm_s390_vcpu_interrupt_pre_save() and
kvm_s390_vcpu_interrupt_post_load() are essentially no-ops on hosts
without KVM_CAP_S390_IRQ_STATE. Move the capability check after the
check for saved IRQ state in kvm_s390_vcpu_interrupt_post_load() so that
migration between hosts without KVM_CAP_S390_IRQ_STATE (including save /
restore on the same host) continues to work.

Fixes: 3cda44f7bae5 ("s390x/kvm: migrate vcpu interrupt state")
Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 target-s390x/kvm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 6de7759..070f995 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -2175,13 +2175,14 @@ int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu)
     struct kvm_s390_irq_state irq_state;
     int r;
 
+    if (cpu->irqstate_saved_size == 0) {
+        return 0;
+    }
+
     if (!kvm_check_extension(kvm_state, KVM_CAP_S390_IRQ_STATE)) {
         return -ENOSYS;
     }
 
-    if (cpu->irqstate_saved_size == 0) {
-        return 0;
-    }
     irq_state.buf = (uint64_t) cpu->irqstate;
     irq_state.len = cpu->irqstate_saved_size;
 
-- 
2.3.0

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

* [Qemu-devel] [PULL 4/4] s390x/migration: add comment about floating point migration
  2015-06-09  8:39 [Qemu-devel] [PULL 0/4] s390x/virtio-ccw: migration and virtio for 2.4 Christian Borntraeger
                   ` (2 preceding siblings ...)
  2015-06-09  8:39 ` [Qemu-devel] [PULL 3/4] s390x/kvm: always ignore empty vcpu interrupt state Christian Borntraeger
@ 2015-06-09  8:39 ` Christian Borntraeger
  2015-06-09 12:52 ` [Qemu-devel] [PULL 0/4] s390x/virtio-ccw: migration and virtio for 2.4 Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Christian Borntraeger @ 2015-06-09  8:39 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Juan Quintela, qemu-devel, Alexander Graf, Christian Borntraeger,
	Jens Freimann, Cornelia Huck, David Hildenbrand

commit 46c804def4bd ("s390x: move fpu regs into a subsection
of the vmstate") moved the fprs into a subsection and bumped
the version number. This will allow to not transfer fprs in
the future if necessary. Add a comment to mark the return true
as intentional.

CC: Juan Quintela <quintela@redhat.com>
CC: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-Id: <1433758884-2997-1-git-send-email-borntraeger@de.ibm.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
---
 target-s390x/machine.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target-s390x/machine.c b/target-s390x/machine.c
index e52d760..0044749 100644
--- a/target-s390x/machine.c
+++ b/target-s390x/machine.c
@@ -70,6 +70,7 @@ const VMStateDescription vmstate_fpu = {
 
 static inline bool fpu_needed(void *opaque)
 {
+    /* This looks odd, but we might want to NOT transfer fprs in the future */
     return true;
 }
 
-- 
2.3.0

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

* Re: [Qemu-devel] [PULL 0/4] s390x/virtio-ccw: migration and virtio for 2.4
  2015-06-09  8:39 [Qemu-devel] [PULL 0/4] s390x/virtio-ccw: migration and virtio for 2.4 Christian Borntraeger
                   ` (3 preceding siblings ...)
  2015-06-09  8:39 ` [Qemu-devel] [PULL 4/4] s390x/migration: add comment about floating point migration Christian Borntraeger
@ 2015-06-09 12:52 ` Peter Maydell
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2015-06-09 12:52 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Cornelia Huck, Jens Freimann, qemu-devel, Alexander Graf

On 9 June 2015 at 09:39, Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> Peter,
>
> The following changes since commit 42d58e7c6760cb9c55627c28ae538e27dcf2f144:
>
>   Merge remote-tracking branch 'remotes/sstabellini/tags/xen-15-06-02-tag' into staging (2015-06-02 16:47:31 +0100)
>
> are available in the git repository at:
>
>   git://github.com/borntraeger/qemu.git tags/s390x-20150609
>
> for you to fetch changes up to 6028ef075791913228c36f10cb270f1f52e9f076:
>
>   s390x/migration: add comment about floating point migration (2015-06-09 09:54:57 +0200)
>
> ----------------------------------------------------------------
> s390x/virtio-ccw: migration and virtio for 2.4
>
> 1. Migration fixups
> 2. virtio 9pfs

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2015-06-09 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-09  8:39 [Qemu-devel] [PULL 0/4] s390x/virtio-ccw: migration and virtio for 2.4 Christian Borntraeger
2015-06-09  8:39 ` [Qemu-devel] [PULL 1/4] virtio-ccw: add support for 9pfs Christian Borntraeger
2015-06-09  8:39 ` [Qemu-devel] [PULL 2/4] virtio-ccw/migration: Migrate config vector for virtio devices Christian Borntraeger
2015-06-09  8:39 ` [Qemu-devel] [PULL 3/4] s390x/kvm: always ignore empty vcpu interrupt state Christian Borntraeger
2015-06-09  8:39 ` [Qemu-devel] [PULL 4/4] s390x/migration: add comment about floating point migration Christian Borntraeger
2015-06-09 12:52 ` [Qemu-devel] [PULL 0/4] s390x/virtio-ccw: migration and virtio for 2.4 Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.