Skip to content

question upon RtlCopyMemory inside the BalloonFill #970

Answered by viktor-prutyanov
jshen28 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @jshen28

MDL has guest physical addresses, but we must pass DMA addresses (or logical address in Windows DMA API terminology) to hypervisor.

The difference between these kinds of addresses will appear if you have an IOMMU device enabled in QEMU, for example intel-iommu, and DMA remapping enabled in Windows. IOMMU translates DMA addresses (by which devices do memory access) to physical addresses about the same as MMU translates virtual addresses to physical ones.

VirtIOWdfDeviceGetPhysicalAddress finds DMA address for a buffer obtained with DMA API in AllocateCommonBuffer. In DMA API, for WDFCOMMONBUFFER we can call WdfCommonBufferGetAlignedVirtualAddress to obtain the buffer's virtual …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by viktor-prutyanov
Comment options

You must be logged in to vote
1 reply
@viktor-prutyanov
Comment options

Comment options

You must be logged in to vote
2 replies
@jshen28
Comment options

@vrozenfe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants