Skip to contentSkip to conversation

(0.12) S390 patches

PATCH New Alexander Graf 1 participant 4 messages Dec 17, 2009

lore
Share & tools
lore
#0 lore raw

cover (0.12) S390 patches

While trying out 0.12-rc2 on my S390x, I stumbled over several issues.

This set fixes them, making KVM on S390x work great again.

Alexander Graf (3):
S390: Loop through virtio console devices add default virtcon initialization
S390: Don't tell guest we're updating config space

 hw/s390-virtio-bus.c |    2 +-
 hw/s390-virtio.c     |    6 +++++-
 vl.c                 |    2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)
#1 lore raw

PATCH 1/3 S390: Loop through virtio console devices

We used to always create one single virtio console device. This breaks when either zero of multiple virtio console devices are requested, so let's use the same code as on x86.

---
 hw/s390-virtio.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
hw/s390-virtio.c +5 -1
index b57fa9c..e54ef0e 100644
@@ -201,7 +201,11 @@ static void s390_init(ram_addr_t ram_size,
     }
 
     /* Create VirtIO console */
-    qdev_init_nofail(qdev_create((BusState *)s390_bus, "virtio-console-s390"));
+    for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) {
+        if (virtcon_hds[i]) {
+            qdev_init_nofail(qdev_create((BusState *)s390_bus, "virtio-console-s390"));
+        }
+    }
 
     /* Create VirtIO network adapters */
     for(i = 0; i < nb_nics; i++) {
Signature · 1 line
1.6.0.2
#2 lore raw

PATCH 2/3 add default virtcon initialization

In reply to Alexander Graf

When going through the default devices, we don't initialize the virtio console, unless we're doing -nographic.

I suppose that's just a leftover from the recent code restructuring, so let's put it in.

---
 vl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
vl.c +2 -0
index c0d98f5..4973512 100644
@@ -5712,6 +5712,8 @@ int main(int argc, char **argv, char **envp)
             add_device_config(DEV_PARALLEL, "vc:80Cx24C");
         if (default_monitor)
             monitor_parse("vc:80Cx24C", "readline");
+        if (default_virtcon)
+            add_device_config(DEV_VIRTCON, "vc:80Cx24C");
     }
     if (default_vga)
         vga_interface_type = VGA_CIRRUS;
Signature · 1 line
1.6.0.2
#3 lore raw

PATCH 3/3 S390: Don't tell guest we're updating config space

In reply to Alexander Graf

Currently we always set the "config space changed" bit to 1 when triggering any virtio interrupt. While that worked in 2.6.27, newer kernels interpret that value as "only the config space changed and nothing else happened".

Since we usually trigger interrupts to tell the guest that something did happen, we just not tell it the config space changed for now until we implement the correct callback for that.

---
 hw/s390-virtio-bus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/s390-virtio-bus.c +1 -1
index 493e4da..dc154ed 100644
@@ -307,7 +307,7 @@ static void virtio_s390_notify(void *opaque, uint16_t vector)
     uint64_t token = s390_virtio_device_vq_token(dev, vector);
 
     /* XXX kvm dependency! */
-    kvm_s390_virtio_irq(s390_cpu_addr2state(0), 1, token);
+    kvm_s390_virtio_irq(s390_cpu_addr2state(0), 0, token);
 }
 
 /**************** S390 Virtio Bus Device Descriptions *******************/
Signature · 1 line
1.6.0.2