<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">We don't need the validate buffer and
      even when you need it putting it into the VM structure is illegal,
      because it can be used by more than one thread at the same time.<br>
      <br>
      This leaves only the csa_bo_va in the amdgpu_vm_virt structure and
      having a structure with only one field is rather pointless.<br>
      <br>
      Additional to that I really don't see CSA handling as something
      related to virtualization.<br>
      <br>
      Regards,<br>
      Christian.<br>
      <br>
      Am 10.01.2017 um 04:05 schrieb Liu, Monk:<br>
    </div>
    <blockquote
cite="mid:BY2PR1201MB1110963B2DE72B2892D4AC1F84670@BY2PR1201MB1110.namprd12.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Exchange Server">
      <!-- converted from text -->
      <style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
      <meta content="text/html; charset=UTF-8">
      <style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
      <div dir="ltr">
        <div id="x_divtagdefaultwrapper" dir="ltr"
          style="font-size:12pt; color:#000000;
          font-family:Calibri,Arial,Helvetica,sans-serif">
          <p><font size="2"><span style="font-size:10pt"><br>
                > +};<br>
                > +<br>
                > +struct amdgpu_vm_virt {<br>
                > +     /* each VM will map on CSA */<br>
                > +     struct ttm_validate_buffer csa_tv;<br>
                > +     struct amdgpu_bo_va *csa_bo_va;<br>
                <br>
                Please put that directly into the amdgpu_vm structure.</span></font></p>
          <p><br>
          </p>
          <p><br>
          </p>
          <p>[ML] they are not a tiny used by bare-metal case so I don't
            think they should be put into common structure at all.</p>
          <p>see we have "struct amdgpu_virt" in "struct amdgpu_device",
            the same style <br>
          </p>
          <p><br>
          </p>
          <p>BR Monk<br>
          </p>
        </div>
        <hr tabindex="-1" style="display:inline-block; width:98%">
        <div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
            color="#000000" face="Calibri, sans-serif"><b>发件人:</b>
            Christian König <a class="moz-txt-link-rfc2396E" href="mailto:deathsimple@vodafone.de"><deathsimple@vodafone.de></a><br>
            <b>发送时间:</b> 2017年1月9日 18:57:06<br>
            <b>收件人:</b> Liu, Monk; <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
            <b>主题:</b> Re: [PATCH 2/7] drm/amdgpu:new field members for
            SRIOV</font>
          <div> </div>
        </div>
      </div>
      <font size="2"><span style="font-size:10pt;">
          <div class="PlainText">Am 09.01.2017 um 09:02 schrieb Monk
            Liu:<br>
            > Change-Id: Ife0eff7b13b8b5946f005a39f6ecb8db1cb72c38<br>
            > Signed-off-by: Monk Liu <a class="moz-txt-link-rfc2396E" href="mailto:Monk.Liu@amd.com"><Monk.Liu@amd.com></a><br>
            > ---<br>
            >   drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 19
            +++++++++++++++++++<br>
            >   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h   |  2 ++<br>
            >   2 files changed, 21 insertions(+)<br>
            ><br>
            > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h
            b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h<br>
            > index 0d821d9..5aa7f0c 100644<br>
            > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h<br>
            > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h<br>
            > @@ -28,9 +28,28 @@<br>
            >   #define AMDGPU_SRIOV_CAPS_ENABLE_IOV   (1 << 1)
            /* sr-iov is enabled on this GPU */<br>
            >   #define AMDGPU_SRIOV_CAPS_IS_VF        (1 << 2)
            /* this GPU is a virtual function */<br>
            >   #define AMDGPU_PASSTHROUGH_MODE        (1 << 3)
            /* thw whole GPU is pass through for VM */<br>
            > +<br>
            > +struct amdgpu_vm;<br>
            >   /* GPU virtualization */<br>
            >   struct amdgpu_virt {<br>
            >        uint32_t caps;<br>
            > +     uint32_t csa_size;<br>
            > +     struct amdgpu_bo *csa_obj;<br>
            > +     uint64_t csa_vmid0_addr;<br>
            > +     uint64_t gds_vmid0_addr;<br>
            > +     int (*allocate_csa)(struct amdgpu_device *adev);<br>
            > +     void (*deallocate_csa)(struct amdgpu_device
            *adev);<br>
            > +     int (*map_csa)(struct amdgpu_device *adev, struct
            amdgpu_vm *vm);<br>
            > +     void (*unmap_csa)(struct amdgpu_device *adev,
            struct amdgpu_vm *vm);<br>
            <br>
            Why callbacks for this?<br>
            <br>
            > +};<br>
            > +<br>
            > +struct amdgpu_vm_virt {<br>
            > +     /* each VM will map on CSA */<br>
            > +     struct ttm_validate_buffer csa_tv;<br>
            > +     struct amdgpu_bo_va *csa_bo_va;<br>
            <br>
            Please put that directly into the amdgpu_vm structure.<br>
            <br>
            > +     /* virtual MC address of CSA & GDS for each
            VM */<br>
            > +     uint64_t vm_csa_addr;<br>
            > +     uint64_t vm_gds_addr;<br>
            <br>
            That should be constant, shouldn't it?<br>
            <br>
            Regards,<br>
            Christian.<br>
            <br>
            >   };<br>
            >   <br>
            >   #define amdgpu_sriov_enabled(adev) \<br>
            > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
            b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h<br>
            > index 42a629b..27cbcbc 100644<br>
            > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h<br>
            > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h<br>
            > @@ -29,6 +29,7 @@<br>
            >   #include "gpu_scheduler.h"<br>
            >   #include "amdgpu_sync.h"<br>
            >   #include "amdgpu_ring.h"<br>
            > +#include "amdgpu_virt.h"<br>
            >   <br>
            >   struct amdgpu_bo_va;<br>
            >   struct amdgpu_job;<br>
            > @@ -111,6 +112,7 @@ struct amdgpu_vm {<br>
            >   <br>
            >        /* client id */<br>
            >        u64                     client_id;<br>
            > +     struct amdgpu_vm_virt   vm_virt;<br>
            >   };<br>
            >   <br>
            >   struct amdgpu_vm_id {<br>
            <br>
            <br>
          </div>
        </span></font>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>