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
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200811122252.22129.rusty@rustcorp.com.au>
Date:	Wed, 12 Nov 2008 06:22:21 -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
Subject: [PATCH 1/7] virtio: Don't use PAGE_SIZE in virtio_pci.c

The virtio PCI devices don't depend on the guest page size.  This matters
now PowerPC virtio is gaining ground (they like 64k pages).

Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
---
 drivers/virtio/virtio_pci.c |    2 +-
 include/linux/virtio_pci.h  |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff -r 8014f9c51f4e drivers/virtio/virtio_pci.c
--- a/drivers/virtio/virtio_pci.c	Wed Nov 12 21:12:39 2008 +1030
+++ b/drivers/virtio/virtio_pci.c	Wed Nov 12 21:47:21 2008 +1030
@@ -244,7 +244,7 @@
 	}
 
 	/* activate the queue */
-	iowrite32(virt_to_phys(info->queue) >> PAGE_SHIFT,
+	iowrite32(virt_to_phys(info->queue) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT,
 		  vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN);
 
 	/* create the vring */
diff -r 8014f9c51f4e include/linux/virtio_pci.h
--- a/include/linux/virtio_pci.h	Wed Nov 12 21:12:39 2008 +1030
+++ b/include/linux/virtio_pci.h	Wed Nov 12 21:47:21 2008 +1030
@@ -53,4 +53,8 @@
 
 /* Virtio ABI version, this must match exactly */
 #define VIRTIO_PCI_ABI_VERSION		0
+
+/* How many bits to shift physical queue address written to QUEUE_PFN.
+ * 12 is historical, and due to x86 page size. */
+#define VIRTIO_PCI_QUEUE_ADDR_SHIFT	12
 #endif


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ