summaryrefslogtreecommitdiff
path: root/drivers/virtio/virtio_ring.c
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2016-09-14 17:33:26 +0100
committerMichael S. Tsirkin <mst@redhat.com>2016-10-31 00:21:39 +0200
commita0be1db4304f51c99af6b6e515549794182a94df (patch)
treef21a49bccbc96339dd0037ed6facec7079fe2006 /drivers/virtio/virtio_ring.c
parenta909d3e636995ba7c349e2ca5dbb528154d4ac30 (diff)
virtio_pci: Limit DMA mask to 44 bits for legacy virtio devices
Legacy virtio defines the virtqueue base using a 32-bit PFN field, with a read-only register indicating a fixed page size of 4k. This can cause problems for DMA allocators that allocate top down from the DMA mask, which is set to 64 bits. In this case, the addresses are silently truncated to 44-bit, leading to IOMMU faults, failure to read from the queue or data corruption. This patch restricts the coherent DMA mask for legacy PCI virtio devices to 44 bits, which matches the specification. Cc: stable@vger.kernel.org Cc: Andy Lutomirski <luto@kernel.org> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Benjamin Serebrin <serebrin@google.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/virtio/virtio_ring.c')
0 files changed, 0 insertions, 0 deletions