aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/virtio
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2019-07-26 19:16:02 +0000
committerKristof Provost <kp@FreeBSD.org>2019-07-26 19:16:02 +0000
commit776d3d5924745cbc54a77017b81716d7e92d145e (patch)
tree17eec19de07f5c0ffbb4f7bca580c55a6baa48ed /sys/dev/virtio
parented3bf015996599712173e2d600384a52cf5b8854 (diff)
downloadsrc-776d3d5924745cbc54a77017b81716d7e92d145e.tar.gz
src-776d3d5924745cbc54a77017b81716d7e92d145e.zip
virtio: Fix running on machines with memory above 0xffffffff
We want to allocate a contiguous memory block anywhere in memory, but expressed this as having to be between 0 and 0xffffffff. This limits us on 64-bit machines, and outright breaks on machines where memory is mapped above that address range. Allow the full address range to be used for this allocation. Sponsored by: Axiado
Notes
Notes: svn path=/head/; revision=350364
Diffstat (limited to 'sys/dev/virtio')
-rw-r--r--sys/dev/virtio/mmio/virtio_mmio.c2
-rw-r--r--sys/dev/virtio/pci/virtio_pci.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/virtio/mmio/virtio_mmio.c b/sys/dev/virtio/mmio/virtio_mmio.c
index 0b3168d3f1f7..95eb86470529 100644
--- a/sys/dev/virtio/mmio/virtio_mmio.c
+++ b/sys/dev/virtio/mmio/virtio_mmio.c
@@ -440,7 +440,7 @@ vtmmio_alloc_virtqueues(device_t dev, int flags, int nvqs,
size = vtmmio_read_config_4(sc, VIRTIO_MMIO_QUEUE_NUM_MAX);
error = virtqueue_alloc(dev, idx, size,
- VIRTIO_MMIO_VRING_ALIGN, 0xFFFFFFFFUL, info, &vq);
+ VIRTIO_MMIO_VRING_ALIGN, ~(vm_paddr_t)0, info, &vq);
if (error) {
device_printf(dev,
"cannot allocate virtqueue %d: %d\n",
diff --git a/sys/dev/virtio/pci/virtio_pci.c b/sys/dev/virtio/pci/virtio_pci.c
index a203b09178c6..d63a3ddedb66 100644
--- a/sys/dev/virtio/pci/virtio_pci.c
+++ b/sys/dev/virtio/pci/virtio_pci.c
@@ -505,7 +505,7 @@ vtpci_alloc_virtqueues(device_t dev, int flags, int nvqs,
size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM);
error = virtqueue_alloc(dev, idx, size, VIRTIO_PCI_VRING_ALIGN,
- 0xFFFFFFFFUL, info, &vq);
+ ~(vm_paddr_t)0, info, &vq);
if (error) {
device_printf(dev,
"cannot allocate virtqueue %d: %d\n", idx, error);