]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
virtio: Don't use PAGE_SIZE in virtio_pci.c
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 30 Dec 2008 15:25:56 +0000 (09:25 -0600)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 29 Dec 2008 22:55:57 +0000 (09:25 +1030)
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@rustcorp.com.au>
drivers/virtio/virtio_pci.c
include/linux/virtio_pci.h

index e37d686edfe07047e33298d5b3b93dae4d77560a..c2cd69ba0a8cd79e611abc1544a621797c410ab6 100644 (file)
@@ -245,7 +245,7 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
        }
 
        /* 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 */
index cdef3574293274eb7fa61d7a34c9315cfbe6ab88..e13d7ebcf576bef6fd04f773f63a24b006b275ce 100644 (file)
@@ -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