From d5692cc94fbf79acd6499f3fa44808f8bd9331f5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 30 Dec 2008 09:25:56 -0600 Subject: [PATCH] --- yaml --- r: 123973 b: refs/heads/master c: 480daab42c4dd74b3c07031ddf9031251c530c77 h: refs/heads/master i: 123971: bc4b40615832828c020287ee8339194678bc9030 v: v3 --- [refs] | 2 +- trunk/drivers/virtio/virtio_pci.c | 2 +- trunk/include/linux/virtio_pci.h | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 252a0ab6440b..1972c1abef59 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 99e0b6c8e3f30602383bcfe3f574537a02ee2bea +refs/heads/master: 480daab42c4dd74b3c07031ddf9031251c530c77 diff --git a/trunk/drivers/virtio/virtio_pci.c b/trunk/drivers/virtio/virtio_pci.c index e37d686edfe0..c2cd69ba0a8c 100644 --- a/trunk/drivers/virtio/virtio_pci.c +++ b/trunk/drivers/virtio/virtio_pci.c @@ -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 */ diff --git a/trunk/include/linux/virtio_pci.h b/trunk/include/linux/virtio_pci.h index cdef35742932..e13d7ebcf576 100644 --- a/trunk/include/linux/virtio_pci.h +++ b/trunk/include/linux/virtio_pci.h @@ -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