lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 12 Nov 2008 06:23:02 -0600 From: Rusty Russell <rusty@...tcorp.com.au> To: linux-kernel@...r.kernel.org Cc: Hollis Blanchard <hollisb@...ibm.com>, aliguori@...ibm.com, markmc@...hat.com, kvm@...r.kernel.org, Christian Borntraeger <borntraeger@...ibm.com> Subject: [PATCH 5/7] 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: Rusty Russell <rusty@...tcorp.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)); } /* -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists