Skip to content

Commit

Permalink
virtqueue: Also use virtqueue metal_io_region for mapping
Browse files Browse the repository at this point in the history
The virtqueue memory should always be covered by the shm_io region we
setup the virtqueue with.  In practice, vq->shm_io and sg[x].io should
be the same.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
  • Loading branch information
galak authored and wjliang committed May 29, 2018
1 parent ecc6419 commit 08443a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/virtio/virtqueue.c
Expand Up @@ -407,7 +407,7 @@ static uint16_t vq_ring_add_buffer(struct virtqueue *vq,
"premature end of free desc chain");

dp = &desc[idx];
dp->addr = metal_io_virt_to_phys(sg[i].io, sg[i].virt);
dp->addr = metal_io_virt_to_phys(vq->shm_io, sg[i].virt);
dp->len = sg[i].len;
dp->flags = 0;

Expand Down

0 comments on commit 08443a2

Please sign in to comment.