diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-30 10:25:57 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-29 17:55:58 -0500 |
commit | 498af14783935af487d17dbee4ac451783cbc2b7 (patch) | |
tree | db7a61d88f8eee05e65ac832f571440640299869 /drivers/virtio | |
parent | 5f0d1d7f2286c8a02dab69f5f0bd51681fab161e (diff) |
virtio: Don't use PAGE_SIZE for vring alignment in virtio_pci.
That doesn't work for non-4k guests which are now appearing.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/virtio')
-rw-r--r-- | drivers/virtio/virtio_pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index c2cd69ba0a8c..f28643f3a4e8 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c | |||
@@ -237,7 +237,7 @@ static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index, | |||
237 | info->queue_index = index; | 237 | info->queue_index = index; |
238 | info->num = num; | 238 | info->num = num; |
239 | 239 | ||
240 | size = PAGE_ALIGN(vring_size(num, PAGE_SIZE)); | 240 | size = PAGE_ALIGN(vring_size(num, VIRTIO_PCI_VRING_ALIGN)); |
241 | info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO); | 241 | info->queue = alloc_pages_exact(size, GFP_KERNEL|__GFP_ZERO); |
242 | if (info->queue == NULL) { | 242 | if (info->queue == NULL) { |
243 | err = -ENOMEM; | 243 | err = -ENOMEM; |
@@ -290,7 +290,7 @@ static void vp_del_vq(struct virtqueue *vq) | |||
290 | iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); | 290 | iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); |
291 | iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); | 291 | iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN); |
292 | 292 | ||
293 | size = PAGE_ALIGN(vring_size(info->num, PAGE_SIZE)); | 293 | size = PAGE_ALIGN(vring_size(info->num, VIRTIO_PCI_VRING_ALIGN)); |
294 | free_pages_exact(info->queue, size); | 294 | free_pages_exact(info->queue, size); |
295 | kfree(info); | 295 | kfree(info); |
296 | } | 296 | } |