Commit db405988 authored by Rusty Russell's avatar Rusty Russell

virtio: use KVM_S390_VIRTIO_RING_ALIGN instead of relying on pagesize

This doesn't really matter, since s390 pagesize is 4k anyway.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Acked-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent 2966af73
...@@ -50,6 +50,10 @@ struct kvm_vqconfig { ...@@ -50,6 +50,10 @@ struct kvm_vqconfig {
#define KVM_S390_VIRTIO_RESET 1 #define KVM_S390_VIRTIO_RESET 1
#define KVM_S390_VIRTIO_SET_STATUS 2 #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__ #ifdef __KERNEL__
/* early virtio console setup */ /* early virtio console setup */
#ifdef CONFIG_S390_GUEST #ifdef CONFIG_S390_GUEST
......
...@@ -188,7 +188,8 @@ static struct virtqueue *kvm_find_vq(struct virtio_device *vdev, ...@@ -188,7 +188,8 @@ static struct virtqueue *kvm_find_vq(struct virtio_device *vdev,
config = kvm_vq_config(kdev->desc)+index; config = kvm_vq_config(kdev->desc)+index;
err = vmem_add_mapping(config->address, err = vmem_add_mapping(config->address,
vring_size(config->num, PAGE_SIZE)); vring_size(config->num,
KVM_S390_VIRTIO_RING_ALIGN));
if (err) if (err)
goto out; goto out;
...@@ -209,7 +210,8 @@ static struct virtqueue *kvm_find_vq(struct virtio_device *vdev, ...@@ -209,7 +210,8 @@ static struct virtqueue *kvm_find_vq(struct virtio_device *vdev,
return vq; return vq;
unmap: unmap:
vmem_remove_mapping(config->address, vmem_remove_mapping(config->address,
vring_size(config->num, PAGE_SIZE)); vring_size(config->num,
KVM_S390_VIRTIO_RING_ALIGN));
out: out:
return ERR_PTR(err); return ERR_PTR(err);
} }
...@@ -220,7 +222,8 @@ static void kvm_del_vq(struct virtqueue *vq) ...@@ -220,7 +222,8 @@ static void kvm_del_vq(struct virtqueue *vq)
vring_del_virtqueue(vq); vring_del_virtqueue(vq);
vmem_remove_mapping(config->address, vmem_remove_mapping(config->address,
vring_size(config->num, PAGE_SIZE)); vring_size(config->num,
KVM_S390_VIRTIO_RING_ALIGN));
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment