Linux PCI subsystem development
 help / color / mirror / Atom feed
* How are iommu-mappings set up in guest-OS for dma_alloc_coherent
@ 2025-09-18 17:54 Ajay Garg
  2025-09-19 16:41 ` Alex Williamson
  0 siblings, 1 reply; 6+ messages in thread
From: Ajay Garg @ 2025-09-18 17:54 UTC (permalink / raw)
  To: iommu, linux-pci, Linux Kernel Mailing List

Hi everyone.

Let's say we have a following setup :

i)
x86_64 host-os, booted up with iommu enabled and pass-through mode.

ii)
x86_64 guest-os, booted up using vfio+qemu+kvm and a pci-device attached to it.

iii)
A guest-os-device-driver calls "dma_alloc_coherent", after which the
returned dma-address / iova is programmed to the pci-device's
mmio-register.


In the above case, how are the IOMMU mappings set up during the
guest-os-device-driver's "dma_alloc_coherent" call?
Does :

a)
The VMM / KVM intercept the "dma_alloc_coherent" call, and use the
host-iommu to set up things?

OR

b)
There is no interception from VMM / KVM, but rather the guest-OS
itself has a view of the IOMMU (through the regular ACPI tables
populated during guest boot up)?

OR

c)
Anything else under the hood?


Will be grateful for clearing the haze.


Thanks and Regards,
Ajay

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-09-22 16:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18 17:54 How are iommu-mappings set up in guest-OS for dma_alloc_coherent Ajay Garg
2025-09-19 16:41 ` Alex Williamson
2025-09-20  3:04   ` Ajay Garg
2025-09-20 14:34     ` Alex Williamson
     [not found]       ` <CAHP4M8WOkDvEf6DYe6w+V9PVHkqcu2-8YrKa7jwLBYRAqLVS+g@mail.gmail.com>
2025-09-22 14:32         ` Alex Williamson
2025-09-22 16:21           ` Ajay Garg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox