Can register addresses conversion go through iommu too? probably not..
Mulyadi Santosa
mulyadi.santosa at gmail.com
Thu Sep 30 22:11:06 EDT 2021
Correct
It is done automatically with the help of so called shadow page table
On Thu, Sep 30, 2021, 13:54 <ckim at etri.re.kr> wrote:
> Hello all,
>
> I know when a device does dma to memory, we use functions like
> dma_alloc_coherent to allocate a memory region for the dma and we get the
> kernel virtual address and device virtual address at the same time. The
> iommu hardware converts the device virtual address to physical address
> reducing the processing time.
>
>
>
> I have a question (to make sure my understanding is correct).
>
> To use registers in the device driver, we use ioremap function to get the
> kernel virtual address for the device registers. If the OS is running in
> virtualized environment (a hypervisor under it), this kernel virtual
> address should go under conversion twice
>
> 1. virtual to physical by OS (this physical is not actually physical, an
> intermediate physical?)
>
> 2. intermediate physical to real physical
>
> I thought these two conversions are done by kernel or hypervisor software
> because iommu is for address translation for the addresses that the device
> “uses(or generates)”, not for the kernel to access the device itself.
>
> Is my understanding correct?
>
> Any help will be appreciated.
>
> Thank you!
>
> Chan Kim
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20211001/dd0b8b5f/attachment-0001.html>
More information about the Kernelnewbies
mailing list