<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)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi Yong,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">That has been submitted. <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">MC address is the address sent to memory controller bus to address the physical memory. In many places it is also called physical address.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Logical address is the address before it is translated to physical address. The translation can be either linear or through page table. Under VMID0, logical address of some apertures (AGP, FB) are linearly mapped to MC address. (I think
in our driver implementation, logical address == MC address). But Gart aperture is mapped through gpuvm (gart) page table – the mapped address can also be called virtual address.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Under VMID1~15, it is user space virtual address (can also be called logical address), mapped through gpuvm page tables.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So virtual address is one type of logical address. Virtual address is usually mapped through page table/vm.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Just my understanding.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Oak<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Zhao, Yong <Yong.Zhao@amd.com> <br>
<b>Sent:</b> Thursday, November 7, 2019 12:16 PM<br>
<b>To:</b> Alex Deucher <alexdeucher@gmail.com>; Zeng, Oak <Oak.Zeng@amd.com><br>
<b>Cc:</b> Kuehling, Felix <Felix.Kuehling@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: Add comments to gmc structure<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">If this is not submitted, I would like to see some comments regarding the explanation of MC address and logical address, which I prefer to mention as GPU physical/virtual address.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Regards,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Yong<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> amd-gfx <</span><a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a><span style="color:black">> on behalf of Alex Deucher
<</span><a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a><span style="color:black">><br>
<b>Sent:</b> Thursday, November 7, 2019 9:02 AM<br>
<b>To:</b> Zeng, Oak <</span><a href="mailto:Oak.Zeng@amd.com">Oak.Zeng@amd.com</a><span style="color:black">><br>
<b>Cc:</b> Kuehling, Felix <</span><a href="mailto:Felix.Kuehling@amd.com">Felix.Kuehling@amd.com</a><span style="color:black">>; Koenig, Christian <</span><a href="mailto:Christian.Koenig@amd.com">Christian.Koenig@amd.com</a><span style="color:black">>;
</span><a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><span style="color:black"> <</span><a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><span style="color:black">><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: Add comments to gmc structure</span> <o:p>
</o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">On Wed, Nov 6, 2019 at 12:27 PM Zeng, Oak <<a href="mailto:Oak.Zeng@amd.com">Oak.Zeng@amd.com</a>> wrote:<br>
><br>
> Explain fields like aper_base, agp_start etc. The definition<br>
> of those fields are confusing as they are from different view<br>
> (CPU or GPU). Add comments for easier understand.<br>
><br>
> Change-Id: I02c2a27cd0dbc205498eb86aafa722f2e0c25fe6<br>
> Signed-off-by: Oak Zeng <<a href="mailto:Oak.Zeng@amd.com">Oak.Zeng@amd.com</a>><br>
<br>
Same comments as the previous version. With those addressed,<br>
Reviewed-by: Alex Deucher <<a href="mailto:alexander.deucher@amd.com">alexander.deucher@amd.com</a>><br>
<br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 26 ++++++++++++++++++++++++++<br>
> 1 file changed, 26 insertions(+)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h<br>
> index 555d8e5..1356ff9 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h<br>
> @@ -127,18 +127,44 @@ struct amdgpu_xgmi {<br>
> };<br>
><br>
> struct amdgpu_gmc {<br>
> + /* FB's physical address in MMIO space (for CPU to<br>
> + * map FB). This is different compared to the apg/<br>
> + * gart/vram_start/end field as the later is from<br>
> + * GPU's view and aper_base is from CPU's view.<br>
> + */<br>
> resource_size_t aper_size;<br>
> resource_size_t aper_base;<br>
> /* for some chips with <= 32MB we need to lie<br>
> * about vram size near mc fb location */<br>
> u64 mc_vram_size;<br>
> u64 visible_vram_size;<br>
> + /* APG aperture start and end in MC address space<br>
> + * Driver find a hole in the MC address space<br>
> + * to place AGP by setting MC_VM_AGP_BOT/TOP registers<br>
> + * Under VMID0, logical address == MC address<br>
> + * AGP aperture is used to simulate FB in ZFB case<br>
> + */<br>
> u64 agp_size;<br>
> u64 agp_start;<br>
> u64 agp_end;<br>
> + /* GART aperture start and end in MC address space<br>
> + * Driver find a hole in the MC address space<br>
> + * to place GART by setting VM_CONTEXT0_PAGE_TABLE_START/END_ADDR<br>
> + * registers<br>
> + * Under VMID0, logical address inside GART aperture will<br>
> + * be translated through gpuvm gart page table to access<br>
> + * paged system memory<br>
> + */<br>
> u64 gart_size;<br>
> u64 gart_start;<br>
> u64 gart_end;<br>
> + /* Frame buffer aperture of this GPU device. Different from<br>
> + * fb_start (see below), this only covers the local GPU device.<br>
> + * Driver get fb_start from MC_VM_FB_LOCATION_BASE (set by vbios)<br>
> + * and calculate vram_start of this local device by adding an<br>
> + * offset inside the XGMI hive.<br>
> + * Under VMID0, logical address == MC address<br>
> + */<br>
> u64 vram_start;<br>
> u64 vram_end;<br>
> /* FB region , it's same as local vram region in single GPU, in XGMI<br>
> --<br>
> 2.7.4<br>
><br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>