]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
virtio: use KVM_S390_VIRTIO_RING_ALIGN instead of relying on pagesize
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 30 Dec 2008 15:26:02 +0000 (09:26 -0600)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 29 Dec 2008 22:56:03 +0000 (09:26 +1030)
This doesn't really matter, since s390 pagesize is 4k anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/include/asm/kvm_virtio.h
drivers/s390/kvm/kvm_virtio.c

index c13568b9351c06ed1dd2114fb6b68e3c04bad09f..0503936f101f0a11b1271005e4662192545e2906 100644 (file)
@@ -50,6 +50,10 @@ struct kvm_vqconfig {
 #define KVM_S390_VIRTIO_RESET          1
 #define KVM_S390_VIRTIO_SET_STATUS     2
 
+/* The alignment to use between consumer and producer parts of vring.
+ * This is pagesize for historical reasons. */
+#define KVM_S390_VIRTIO_RING_ALIGN     4096
+
 #ifdef __KERNEL__
 /* early virtio console setup */
 #ifdef CONFIG_S390_GUEST
index 3d442444c618ccb431d7e4d6b6e1b5bc4f16924b..f5a2dbe755752b49e4b9cc4c8b9fd857ce84f15d 100644 (file)
@@ -188,7 +188,8 @@ static struct virtqueue *kvm_find_vq(struct virtio_device *vdev,
        config = kvm_vq_config(kdev->desc)+index;
 
        err = vmem_add_mapping(config->address,
-                              vring_size(config->num, PAGE_SIZE));
+                              vring_size(config->num,
+                                         KVM_S390_VIRTIO_RING_ALIGN));
        if (err)
                goto out;
 
@@ -209,7 +210,8 @@ static struct virtqueue *kvm_find_vq(struct virtio_device *vdev,
        return vq;
 unmap:
        vmem_remove_mapping(config->address,
-                           vring_size(config->num, PAGE_SIZE));
+                           vring_size(config->num,
+                                      KVM_S390_VIRTIO_RING_ALIGN));
 out:
        return ERR_PTR(err);
 }
@@ -220,7 +222,8 @@ static void kvm_del_vq(struct virtqueue *vq)
 
        vring_del_virtqueue(vq);
        vmem_remove_mapping(config->address,
-                           vring_size(config->num, PAGE_SIZE));
+                           vring_size(config->num,
+                                      KVM_S390_VIRTIO_RING_ALIGN));
 }
 
 /*