Commit 480daab4 authored by Rusty Russell's avatar Rusty Russell

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: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 99e0b6c8
...@@ -245,7 +245,7 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index, ...@@ -245,7 +245,7 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
} }
/* activate the queue */ /* 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); vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN);
/* create the vring */ /* create the vring */
......
...@@ -53,4 +53,8 @@ ...@@ -53,4 +53,8 @@
/* Virtio ABI version, this must match exactly */ /* Virtio ABI version, this must match exactly */
#define VIRTIO_PCI_ABI_VERSION 0 #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 #endif
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