<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:"\B9D1\C740 \ACE0\B515";
panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
{font-family:"\@\B9D1\C740 \ACE0\B515";
panose-1:2 11 5 3 2 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
text-autospace:none;
word-break:break-hangul;
font-size:10.0pt;
font-family:"\B9D1\C740 \ACE0\B515";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"\B9D1\C740 \ACE0\B515";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"\B9D1\C740 \ACE0\B515";}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:3.0cm 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=KO link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hello all,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>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. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I have a question (to make sure my understanding is correct).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>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 <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>1. virtual to physical by OS (this physical is not actually physical, an intermediate physical?)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>2. intermediate physical to real physical<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>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. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Is my understanding correct?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Any help will be appreciated.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Thank you!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Chan Kim<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>