* [PATCH 5/7] virtio: use KVM_S390_VIRTIO_RING_ALIGN instead of relying on pagesize
@ 2008-11-12 12:23 Rusty Russell
0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2008-11-12 12:23 UTC (permalink / raw)
To: linux-kernel
Cc: Hollis Blanchard, aliguori, markmc, kvm, Christian Borntraeger
This doesn't really matter, since s390 pagesize is 4k anyway.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
arch/s390/include/asm/kvm_virtio.h | 3 +++
drivers/s390/kvm/kvm_virtio.c | 9 ++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff -r 5c9c0cc58458 arch/s390/include/asm/kvm_virtio.h
--- a/arch/s390/include/asm/kvm_virtio.h Wed Nov 12 22:05:59 2008 +1030
+++ b/arch/s390/include/asm/kvm_virtio.h Wed Nov 12 22:10:29 2008 +1030
@@ -50,6 +50,9 @@
#define KVM_S390_VIRTIO_RESET 1
#define KVM_S390_VIRTIO_SET_STATUS 2
+/* Overkill: we have the consumer and producer writing to separate pages. */
+#define KVM_S390_VIRTIO_RING_ALIGN 4096
+
#ifdef __KERNEL__
/* early virtio console setup */
#ifdef CONFIG_S390_GUEST
diff -r 5c9c0cc58458 drivers/s390/kvm/kvm_virtio.c
--- a/drivers/s390/kvm/kvm_virtio.c Wed Nov 12 22:05:59 2008 +1030
+++ b/drivers/s390/kvm/kvm_virtio.c Wed Nov 12 22:10:29 2008 +1030
@@ -188,7 +188,8 @@
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 @@
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 @@
vring_del_virtqueue(vq);
vmem_remove_mapping(config->address,
- vring_size(config->num, PAGE_SIZE));
+ vring_size(config->num,
+ KVM_S390_VIRTIO_RING_ALIGN));
}
/*
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-11-12 12:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-12 12:23 [PATCH 5/7] virtio: use KVM_S390_VIRTIO_RING_ALIGN instead of relying on pagesize Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox