qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Questions about virtio DMA operations


From: Arnabjyoti Kalita
Subject: Questions about virtio DMA operations
Date: Sat, 28 Aug 2021 17:31:37 +0530

Hello all,

I am trying to understand how a virtio-block device updates "used" buffers in the virtqueue. I intend to 'mimic' this process without the actual disk event happening, by storing the used buffers and then re-using them later. I can see that the function virtqueue_fill is primarily responsible for filling up the virtqueue which eventually updates the guest memory. vring_used_write eventually does a memcpy to write the used buffer contents to the memory.

I do not understand what is the primary role of the virtqueue_unmap_sg function. I have a few questions.

- What does this function do?

- Does it in any way modify the guest's physical memory?

- Why do we need to map and unmap the in_sg and out_sg into/out of the DMA address space? Is this for updating the IOMMU and destroying the address mappings that existed before?

- What happens if unmapping does not happen?

If there are good articles that describe this process of DMA address space mapping/unmapping, feel free to point me to them and I would love to read them too.

Thank you very much.
Best Regards,
Arnabjyoti Kalita

reply via email to

[Prev in Thread] Current Thread [Next in Thread]