<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    Well NAK.<br>
    <br>
    Even when we can't R/W HDP registers we need a way to invalidate the
    HDP or quite a bunch of functions won't work correctly.<br>
    <br>
    Blocking CPU base page table updates only works around the symptoms,
    but doesn't really solve anything.<br>
    <br>
    Regards,<br>
    Christian.<br>
    <br>
    <div class="moz-cite-prefix">Am 20.01.22 um 09:46 schrieb Wang,
      Yang(Kevin):<br>
    </div>
    <blockquote type="cite" cite="mid:CO6PR12MB54731E9FBF54A2E86A320419825A9@CO6PR12MB5473.namprd12.prod.outlook.com">
      
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <p style="font-family:Arial;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
        [AMD Official Use Only]<br>
      </p>
      <br>
      <div>
        <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
          font-size:12pt; color:rgb(0,0,0)">
          ping...</div>
        <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
          font-size:12pt; color:rgb(0,0,0)">
          <br>
        </div>
        <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
          font-size:12pt; color:rgb(0,0,0)">
          add <a id="OWAAM160069" class="P8b7u5KH31KY6Eljcf5yw mention
            ms-bgc-nlr ms-fcl-b" href="mailto:Monk.Liu@amd.com" moz-do-not-send="true">
            @Liu, Monk</a> <a id="OWAAM254265" class="P8b7u5KH31KY6Eljcf5yw mention ms-bgc-nlr ms-fcl-b" href="mailto:Christian.Koenig@amd.com" moz-do-not-send="true">@Koenig, Christian</a> <a id="OWAAM277931" class="P8b7u5KH31KY6Eljcf5yw mention
            ms-bgc-nlr ms-fcl-b" href="mailto:Alexander.Deucher@amd.com" moz-do-not-send="true">@Deucher, Alexander</a></div>
        <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
          font-size:12pt; color:rgb(0,0,0)">
          <br>
        </div>
        <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
          font-size:12pt; color:rgb(0,0,0)">
          Best Regards,</div>
        <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
          font-size:12pt; color:rgb(0,0,0)">
          Kevin</div>
        <hr tabindex="-1" style="display:inline-block; width:98%">
        <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b>
            Wang, Yang(Kevin) <a class="moz-txt-link-rfc2396E" href="mailto:KevinYang.Wang@amd.com"><KevinYang.Wang@amd.com></a><br>
            <b>Sent:</b> Wednesday, January 19, 2022 11:16 AM<br>
            <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>
            <a class="moz-txt-link-rfc2396E" href="mailto:amd-gfx@lists.freedesktop.org"><amd-gfx@lists.freedesktop.org></a><br>
            <b>Cc:</b> Min, Frank <a class="moz-txt-link-rfc2396E" href="mailto:Frank.Min@amd.com"><Frank.Min@amd.com></a>; Chen,
            Horace <a class="moz-txt-link-rfc2396E" href="mailto:Horace.Chen@amd.com"><Horace.Chen@amd.com></a>; Wang, Yang(Kevin)
            <a class="moz-txt-link-rfc2396E" href="mailto:KevinYang.Wang@amd.com"><KevinYang.Wang@amd.com></a><br>
            <b>Subject:</b> [PATCH] drm/amdgpu: force using sdma to
            update vm page table when mmio is blocked</font>
          <div> </div>
        </div>
        <div class="BodyFragment"><font size="2"><span style="font-size:11pt">
              <div class="PlainText">when mmio protection feature is
                enabled in hypervisor,<br>
                it will cause guest OS can't R/W HDP regiters,<br>
                and using cpu to update page table is not working well.<br>
                <br>
                force using sdma to update page table when mmio is
                blocked.<br>
                <br>
                Signed-off-by: Yang Wang <a class="moz-txt-link-rfc2396E" href="mailto:KevinYang.Wang@amd.com"><KevinYang.Wang@amd.com></a><br>
                ---<br>
                 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 7 +++++++<br>
                 1 file changed, 7 insertions(+)<br>
                <br>
                diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
                b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
                index b23cb463b106..0f86f0b2e183 100644<br>
                --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
                +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c<br>
                @@ -2959,6 +2959,9 @@ int amdgpu_vm_init(struct
                amdgpu_device *adev, struct amdgpu_vm *vm)<br>
                         vm->use_cpu_for_update =
                !!(adev->vm_manager.vm_update_mode &<br>
                                                    
                AMDGPU_VM_USE_CPU_FOR_GFX);<br>
                 <br>
                +       if (vm->use_cpu_for_update &&
                amdgpu_sriov_vf(adev) &&
                amdgpu_virt_mmio_blocked(adev))<br>
                +               vm->use_cpu_for_update = false;<br>
                +<br>
                         DRM_DEBUG_DRIVER("VM update mode is %s\n",<br>
                                          vm->use_cpu_for_update ?
                "CPU" : "SDMA");<br>
                         WARN_ONCE((vm->use_cpu_for_update &&<br>
                @@ -3094,6 +3097,10 @@ int amdgpu_vm_make_compute(struct
                amdgpu_device *adev, struct amdgpu_vm *vm)<br>
                         /* Update VM state */<br>
                         vm->use_cpu_for_update =
                !!(adev->vm_manager.vm_update_mode &<br>
                                                    
                AMDGPU_VM_USE_CPU_FOR_COMPUTE);<br>
                +<br>
                +       if (vm->use_cpu_for_update &&
                amdgpu_sriov_vf(adev) &&
                amdgpu_virt_mmio_blocked(adev))<br>
                +               vm->use_cpu_for_update = false;<br>
                +<br>
                         DRM_DEBUG_DRIVER("VM update mode is %s\n",<br>
                                          vm->use_cpu_for_update ?
                "CPU" : "SDMA");<br>
                         WARN_ONCE((vm->use_cpu_for_update &&<br>
                -- <br>
                2.25.1<br>
                <br>
              </div>
            </span></font></div>
      </div>
    </blockquote>
    <br>
  </body>
</html>