All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
@ 2019-05-16 11:53 Yintian Tao
       [not found] ` <1558007618-24482-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Yintian Tao @ 2019-05-16 11:53 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Monk Liu, Yintian Tao

PSP fw primary buffer is not used under SRIOV.
Therefore, we don't need to allocate memory for it.

v2: remove superfluous check for amdgpu_bo_free_kernel().

Signed-off-by: Yintian Tao <yttao@amd.com>
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index c567a55..af9835c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -905,13 +905,16 @@ static int psp_load_fw(struct amdgpu_device *adev)
 	if (!psp->cmd)
 		return -ENOMEM;
 
-	ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
-					AMDGPU_GEM_DOMAIN_GTT,
-					&psp->fw_pri_bo,
-					&psp->fw_pri_mc_addr,
-					&psp->fw_pri_buf);
-	if (ret)
-		goto failed;
+	/* this fw pri bo is not used under SRIOV */
+	if (!amdgpu_sriov_vf(psp->adev)) {
+		ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
+					      AMDGPU_GEM_DOMAIN_GTT,
+					      &psp->fw_pri_bo,
+					      &psp->fw_pri_mc_addr,
+					      &psp->fw_pri_buf);
+		if (ret)
+			goto failed;
+	}
 
 	ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
 					AMDGPU_GEM_DOMAIN_VRAM,
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
       [not found] ` <1558007618-24482-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org>
@ 2019-05-17  2:41   ` Tao, Yintian
       [not found]     ` <MN2PR12MB3039EAC37D6BB17BD3582D77E50B0-rweVpJHSKTr/fpeVZQY9RQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Tao, Yintian @ 2019-05-17  2:41 UTC (permalink / raw)
  To: Tao, Yintian, Koenig, Christian
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Liu, Monk

Hi Christian


I have modified it according to your suggestion. Can you help review this again? Thanks in advance.


Best Regards
Yintian Tao

-----Original Message-----
From: Yintian Tao <yttao@amd.com> 
Sent: Thursday, May 16, 2019 7:54 PM
To: amd-gfx@lists.freedesktop.org
Cc: Tao, Yintian <Yintian.Tao@amd.com>; Liu, Monk <Monk.Liu@amd.com>
Subject: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV

PSP fw primary buffer is not used under SRIOV.
Therefore, we don't need to allocate memory for it.

v2: remove superfluous check for amdgpu_bo_free_kernel().

Signed-off-by: Yintian Tao <yttao@amd.com>
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index c567a55..af9835c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -905,13 +905,16 @@ static int psp_load_fw(struct amdgpu_device *adev)
 	if (!psp->cmd)
 		return -ENOMEM;
 
-	ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
-					AMDGPU_GEM_DOMAIN_GTT,
-					&psp->fw_pri_bo,
-					&psp->fw_pri_mc_addr,
-					&psp->fw_pri_buf);
-	if (ret)
-		goto failed;
+	/* this fw pri bo is not used under SRIOV */
+	if (!amdgpu_sriov_vf(psp->adev)) {
+		ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
+					      AMDGPU_GEM_DOMAIN_GTT,
+					      &psp->fw_pri_bo,
+					      &psp->fw_pri_mc_addr,
+					      &psp->fw_pri_buf);
+		if (ret)
+			goto failed;
+	}
 
 	ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
 					AMDGPU_GEM_DOMAIN_VRAM,
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
       [not found]     ` <MN2PR12MB3039EAC37D6BB17BD3582D77E50B0-rweVpJHSKTr/fpeVZQY9RQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-05-17  6:53       ` Koenig, Christian
       [not found]         ` <f77131be-9a53-789d-0f1e-c743c80dc11a-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Koenig, Christian @ 2019-05-17  6:53 UTC (permalink / raw)
  To: Tao, Yintian; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Liu, Monk

Looks good to me now, but I don't know the technical background why this 
BO is not needed under SRIOV.

So this patch is Acked-by: Christian König <christian.koenig@amd.com>.

Regards,
Christian.

Am 17.05.19 um 04:41 schrieb Tao, Yintian:
> Hi Christian
>
>
> I have modified it according to your suggestion. Can you help review this again? Thanks in advance.
>
>
> Best Regards
> Yintian Tao
>
> -----Original Message-----
> From: Yintian Tao <yttao@amd.com>
> Sent: Thursday, May 16, 2019 7:54 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Tao, Yintian <Yintian.Tao@amd.com>; Liu, Monk <Monk.Liu@amd.com>
> Subject: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
>
> PSP fw primary buffer is not used under SRIOV.
> Therefore, we don't need to allocate memory for it.
>
> v2: remove superfluous check for amdgpu_bo_free_kernel().
>
> Signed-off-by: Yintian Tao <yttao@amd.com>
> Signed-off-by: Monk Liu <Monk.Liu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 17 ++++++++++-------
>   1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index c567a55..af9835c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -905,13 +905,16 @@ static int psp_load_fw(struct amdgpu_device *adev)
>   	if (!psp->cmd)
>   		return -ENOMEM;
>   
> -	ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> -					AMDGPU_GEM_DOMAIN_GTT,
> -					&psp->fw_pri_bo,
> -					&psp->fw_pri_mc_addr,
> -					&psp->fw_pri_buf);
> -	if (ret)
> -		goto failed;
> +	/* this fw pri bo is not used under SRIOV */
> +	if (!amdgpu_sriov_vf(psp->adev)) {
> +		ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> +					      AMDGPU_GEM_DOMAIN_GTT,
> +					      &psp->fw_pri_bo,
> +					      &psp->fw_pri_mc_addr,
> +					      &psp->fw_pri_buf);
> +		if (ret)
> +			goto failed;
> +	}
>   
>   	ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
>   					AMDGPU_GEM_DOMAIN_VRAM,

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* 答复: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
       [not found]         ` <f77131be-9a53-789d-0f1e-c743c80dc11a-5C7GfCeVMHo@public.gmane.org>
@ 2019-05-17  7:17           ` Tao, Yintian
       [not found]             ` <MN2PR12MB30390AB5467D6A7080AD45C6E50B0-rweVpJHSKTr/fpeVZQY9RQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Tao, Yintian @ 2019-05-17  7:17 UTC (permalink / raw)
  To: Koenig, Christian; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Liu, Monk


[-- Attachment #1.1: Type: text/plain, Size: 3051 bytes --]

Hi  Christian


Many thanks for your review.


The background is that this bo is to let psp load sos and sysdrv but under sriov, sos and sysdrv is loaded by VBIOS or hypervisor driver.


The reason why not let guest driver to load it under SRIOV is that it is not safe.



Best Regards

Yintian Tao

________________________________
发件人: Koenig, Christian
发送时间: 2019年5月17日 14:53:35
收件人: Tao, Yintian
抄送: Liu, Monk; amd-gfx@lists.freedesktop.org
主题: Re: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV

Looks good to me now, but I don't know the technical background why this
BO is not needed under SRIOV.

So this patch is Acked-by: Christian König <christian.koenig@amd.com>.

Regards,
Christian.

Am 17.05.19 um 04:41 schrieb Tao, Yintian:
> Hi Christian
>
>
> I have modified it according to your suggestion. Can you help review this again? Thanks in advance.
>
>
> Best Regards
> Yintian Tao
>
> -----Original Message-----
> From: Yintian Tao <yttao@amd.com>
> Sent: Thursday, May 16, 2019 7:54 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Tao, Yintian <Yintian.Tao@amd.com>; Liu, Monk <Monk.Liu@amd.com>
> Subject: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
>
> PSP fw primary buffer is not used under SRIOV.
> Therefore, we don't need to allocate memory for it.
>
> v2: remove superfluous check for amdgpu_bo_free_kernel().
>
> Signed-off-by: Yintian Tao <yttao@amd.com>
> Signed-off-by: Monk Liu <Monk.Liu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 17 ++++++++++-------
>   1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index c567a55..af9835c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -905,13 +905,16 @@ static int psp_load_fw(struct amdgpu_device *adev)
>        if (!psp->cmd)
>                return -ENOMEM;
>
> -     ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> -                                     AMDGPU_GEM_DOMAIN_GTT,
> -                                     &psp->fw_pri_bo,
> -                                     &psp->fw_pri_mc_addr,
> -                                     &psp->fw_pri_buf);
> -     if (ret)
> -             goto failed;
> +     /* this fw pri bo is not used under SRIOV */
> +     if (!amdgpu_sriov_vf(psp->adev)) {
> +             ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> +                                           AMDGPU_GEM_DOMAIN_GTT,
> +                                           &psp->fw_pri_bo,
> +                                           &psp->fw_pri_mc_addr,
> +                                           &psp->fw_pri_buf);
> +             if (ret)
> +                     goto failed;
> +     }
>
>        ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
>                                        AMDGPU_GEM_DOMAIN_VRAM,


[-- Attachment #1.2: Type: text/html, Size: 7192 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: 答复: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
       [not found]             ` <MN2PR12MB30390AB5467D6A7080AD45C6E50B0-rweVpJHSKTr/fpeVZQY9RQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-05-17  7:20               ` Christian König
       [not found]                 ` <0f307e3d-3f5f-3766-6db8-e51ab6c2562e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2019-05-17 10:19               ` Liu, Monk
  1 sibling, 1 reply; 9+ messages in thread
From: Christian König @ 2019-05-17  7:20 UTC (permalink / raw)
  To: Tao, Yintian, Koenig, Christian
  Cc: Liu, Monk, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 3440 bytes --]

Hi Yintian,

please add this as a code comment to the patch.

Christian.

Am 17.05.19 um 09:17 schrieb Tao, Yintian:
>
> Hi  Christian
>
>
> Many thanks for your review.
>
>
> The background is that this bo is to let psp load sos and sysdrv but 
> under sriov, sos and sysdrv is loaded by VBIOS or hypervisor driver.
>
>
> The reason why not let guest driver to load it under SRIOV is that it 
> is not safe.
>
>
>
> Best Regards
>
> Yintian Tao
>
> ------------------------------------------------------------------------
> *发件人:* Koenig, Christian
> *发送时间:* 2019年5月17日 14:53:35
> *收件人:* Tao, Yintian
> *抄送:* Liu, Monk; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> *主题:* Re: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
> Looks good to me now, but I don't know the technical background why this
> BO is not needed under SRIOV.
>
> So this patch is Acked-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>.
>
> Regards,
> Christian.
>
> Am 17.05.19 um 04:41 schrieb Tao, Yintian:
> > Hi Christian
> >
> >
> > I have modified it according to your suggestion. Can you help review 
> this again? Thanks in advance.
> >
> >
> > Best Regards
> > Yintian Tao
> >
> > -----Original Message-----
> > From: Yintian Tao <yttao-5C7GfCeVMHo@public.gmane.org>
> > Sent: Thursday, May 16, 2019 7:54 PM
> > To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> > Cc: Tao, Yintian <Yintian.Tao-5C7GfCeVMHo@public.gmane.org>; Liu, Monk <Monk.Liu-5C7GfCeVMHo@public.gmane.org>
> > Subject: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
> >
> > PSP fw primary buffer is not used under SRIOV.
> > Therefore, we don't need to allocate memory for it.
> >
> > v2: remove superfluous check for amdgpu_bo_free_kernel().
> >
> > Signed-off-by: Yintian Tao <yttao-5C7GfCeVMHo@public.gmane.org>
> > Signed-off-by: Monk Liu <Monk.Liu-5C7GfCeVMHo@public.gmane.org>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 17 ++++++++++-------
> >   1 file changed, 10 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> > index c567a55..af9835c 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> > @@ -905,13 +905,16 @@ static int psp_load_fw(struct amdgpu_device *adev)
> >        if (!psp->cmd)
> >                return -ENOMEM;
> >
> > -     ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> > - AMDGPU_GEM_DOMAIN_GTT,
> > - &psp->fw_pri_bo,
> > - &psp->fw_pri_mc_addr,
> > - &psp->fw_pri_buf);
> > -     if (ret)
> > -             goto failed;
> > +     /* this fw pri bo is not used under SRIOV */
> > +     if (!amdgpu_sriov_vf(psp->adev)) {
> > +             ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> > + AMDGPU_GEM_DOMAIN_GTT,
> > + &psp->fw_pri_bo,
> > + &psp->fw_pri_mc_addr,
> > + &psp->fw_pri_buf);
> > +             if (ret)
> > +                     goto failed;
> > +     }
> >
> >        ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, 
> PAGE_SIZE,
> > AMDGPU_GEM_DOMAIN_VRAM,
>
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[-- Attachment #1.2: Type: text/html, Size: 8636 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* 答复: 答复: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
       [not found]                 ` <0f307e3d-3f5f-3766-6db8-e51ab6c2562e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2019-05-17  7:23                   ` Tao, Yintian
  0 siblings, 0 replies; 9+ messages in thread
From: Tao, Yintian @ 2019-05-17  7:23 UTC (permalink / raw)
  To: Koenig, Christian; +Cc: Liu, Monk, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 4046 bytes --]

Hi  Chrisitian



Yes, of course. Thanks for your reminder.



Best Regards
Yintian Tao

________________________________
发件人: Christian König <ckoenig.leichtzumerken@gmail.com>
发送时间: 2019年5月17日 15:20:54
收件人: Tao, Yintian; Koenig, Christian
抄送: amd-gfx@lists.freedesktop.org; Liu, Monk
主题: Re: 答复: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV

[CAUTION: External Email]
Hi Yintian,

please add this as a code comment to the patch.

Christian.

Am 17.05.19 um 09:17 schrieb Tao, Yintian:

Hi  Christian


Many thanks for your review.


The background is that this bo is to let psp load sos and sysdrv but under sriov, sos and sysdrv is loaded by VBIOS or hypervisor driver.


The reason why not let guest driver to load it under SRIOV is that it is not safe.



Best Regards

Yintian Tao

________________________________
发件人: Koenig, Christian
发送时间: 2019年5月17日 14:53:35
收件人: Tao, Yintian
抄送: Liu, Monk; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
主题: Re: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV

Looks good to me now, but I don't know the technical background why this
BO is not needed under SRIOV.

So this patch is Acked-by: Christian König <christian.koenig@amd.com><mailto:christian.koenig@amd.com>.

Regards,
Christian.

Am 17.05.19 um 04:41 schrieb Tao, Yintian:
> Hi Christian
>
>
> I have modified it according to your suggestion. Can you help review this again? Thanks in advance.
>
>
> Best Regards
> Yintian Tao
>
> -----Original Message-----
> From: Yintian Tao <yttao@amd.com><mailto:yttao@amd.com>
> Sent: Thursday, May 16, 2019 7:54 PM
> To: amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
> Cc: Tao, Yintian <Yintian.Tao@amd.com><mailto:Yintian.Tao@amd.com>; Liu, Monk <Monk.Liu@amd.com><mailto:Monk.Liu@amd.com>
> Subject: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
>
> PSP fw primary buffer is not used under SRIOV.
> Therefore, we don't need to allocate memory for it.
>
> v2: remove superfluous check for amdgpu_bo_free_kernel().
>
> Signed-off-by: Yintian Tao <yttao@amd.com><mailto:yttao@amd.com>
> Signed-off-by: Monk Liu <Monk.Liu@amd.com><mailto:Monk.Liu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 17 ++++++++++-------
>   1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index c567a55..af9835c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -905,13 +905,16 @@ static int psp_load_fw(struct amdgpu_device *adev)
>        if (!psp->cmd)
>                return -ENOMEM;
>
> -     ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> -                                     AMDGPU_GEM_DOMAIN_GTT,
> -                                     &psp->fw_pri_bo,
> -                                     &psp->fw_pri_mc_addr,
> -                                     &psp->fw_pri_buf);
> -     if (ret)
> -             goto failed;
> +     /* this fw pri bo is not used under SRIOV */
> +     if (!amdgpu_sriov_vf(psp->adev)) {
> +             ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> +                                           AMDGPU_GEM_DOMAIN_GTT,
> +                                           &psp->fw_pri_bo,
> +                                           &psp->fw_pri_mc_addr,
> +                                           &psp->fw_pri_buf);
> +             if (ret)
> +                     goto failed;
> +     }
>
>        ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
>                                        AMDGPU_GEM_DOMAIN_VRAM,




_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[-- Attachment #1.2: Type: text/html, Size: 9787 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
       [not found]             ` <MN2PR12MB30390AB5467D6A7080AD45C6E50B0-rweVpJHSKTr/fpeVZQY9RQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  2019-05-17  7:20               ` Christian König
@ 2019-05-17 10:19               ` Liu, Monk
  1 sibling, 0 replies; 9+ messages in thread
From: Liu, Monk @ 2019-05-17 10:19 UTC (permalink / raw)
  To: Tao, Yintian, Koenig, Christian; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 3793 bytes --]

Instead if guest load “sos” and “sysdrv” there are two kinds of result:

  1.  For elder version PSP boot loader guest would hit failure.
  2.  For new version PSP boot loader those ucode won’t work at all so loading the is redundant

/Monk

From: Tao, Yintian
Sent: Friday, May 17, 2019 3:17 PM
To: Koenig, Christian <Christian.Koenig@amd.com>
Cc: Liu, Monk <Monk.Liu@amd.com>; amd-gfx@lists.freedesktop.org
Subject: 答复: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV


Hi  Christian



Many thanks for your review.



The background is that this bo is to let psp load sos and sysdrv but under sriov, sos and sysdrv is loaded by VBIOS or hypervisor driver.



The reason why not let guest driver to load it under SRIOV is that it is not safe.





Best Regards

Yintian Tao

________________________________
发件人: Koenig, Christian
发送时间: 2019年5月17日 14:53:35
收件人: Tao, Yintian
抄送: Liu, Monk; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
主题: Re: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV

Looks good to me now, but I don't know the technical background why this
BO is not needed under SRIOV.

So this patch is Acked-by: Christian König <christian.koenig@amd.com<mailto:christian.koenig@amd.com>>.

Regards,
Christian.

Am 17.05.19 um 04:41 schrieb Tao, Yintian:
> Hi Christian
>
>
> I have modified it according to your suggestion. Can you help review this again? Thanks in advance.
>
>
> Best Regards
> Yintian Tao
>
> -----Original Message-----
> From: Yintian Tao <yttao@amd.com<mailto:yttao@amd.com>>
> Sent: Thursday, May 16, 2019 7:54 PM
> To: amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
> Cc: Tao, Yintian <Yintian.Tao@amd.com<mailto:Yintian.Tao@amd.com>>; Liu, Monk <Monk.Liu@amd.com<mailto:Monk.Liu@amd.com>>
> Subject: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
>
> PSP fw primary buffer is not used under SRIOV.
> Therefore, we don't need to allocate memory for it.
>
> v2: remove superfluous check for amdgpu_bo_free_kernel().
>
> Signed-off-by: Yintian Tao <yttao@amd.com<mailto:yttao@amd.com>>
> Signed-off-by: Monk Liu <Monk.Liu@amd.com<mailto:Monk.Liu@amd.com>>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 17 ++++++++++-------
>   1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index c567a55..af9835c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -905,13 +905,16 @@ static int psp_load_fw(struct amdgpu_device *adev)
>        if (!psp->cmd)
>                return -ENOMEM;
>
> -     ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> -                                     AMDGPU_GEM_DOMAIN_GTT,
> -                                     &psp->fw_pri_bo,
> -                                     &psp->fw_pri_mc_addr,
> -                                     &psp->fw_pri_buf);
> -     if (ret)
> -             goto failed;
> +     /* this fw pri bo is not used under SRIOV */
> +     if (!amdgpu_sriov_vf(psp->adev)) {
> +             ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> +                                           AMDGPU_GEM_DOMAIN_GTT,
> +                                           &psp->fw_pri_bo,
> +                                           &psp->fw_pri_mc_addr,
> +                                           &psp->fw_pri_buf);
> +             if (ret)
> +                     goto failed;
> +     }
>
>        ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
>                                        AMDGPU_GEM_DOMAIN_VRAM,

[-- Attachment #1.2: Type: text/html, Size: 13788 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
       [not found] ` <1557983492-25237-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org>
@ 2019-05-16  7:24   ` Christian König
  0 siblings, 0 replies; 9+ messages in thread
From: Christian König @ 2019-05-16  7:24 UTC (permalink / raw)
  To: Yintian Tao, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Monk Liu

Am 16.05.19 um 07:11 schrieb Yintian Tao:
> PSP fw primary buffer is not used under SRIOV
> Therefore, we don't need to allocate memory for it.
>
> Signed-off-by: Yintian Tao <yttao@amd.com>
> Signed-off-by: Monk Liu <Monk.Liu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 22 +++++++++++++---------
>   1 file changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index c567a55..d3c77d2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -905,13 +905,16 @@ static int psp_load_fw(struct amdgpu_device *adev)
>   	if (!psp->cmd)
>   		return -ENOMEM;
>   
> -	ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> -					AMDGPU_GEM_DOMAIN_GTT,
> -					&psp->fw_pri_bo,
> -					&psp->fw_pri_mc_addr,
> -					&psp->fw_pri_buf);
> -	if (ret)
> -		goto failed;
> +	/* this fw pri bo is not used under SRIOV */
> +	if (!amdgpu_sriov_vf(psp->adev)) {
> +		ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> +					      AMDGPU_GEM_DOMAIN_GTT,
> +					      &psp->fw_pri_bo,
> +					      &psp->fw_pri_mc_addr,
> +					      &psp->fw_pri_buf);
> +		if (ret)
> +			goto failed;
> +	}
>   
>   	ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
>   					AMDGPU_GEM_DOMAIN_VRAM,
> @@ -1012,8 +1015,9 @@ static int psp_hw_fini(void *handle)
>   	psp_ring_destroy(psp, PSP_RING_TYPE__KM);
>   
>   	amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);
> -	amdgpu_bo_free_kernel(&psp->fw_pri_bo,
> -			      &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
> +	if (!amdgpu_sriov_vf(psp->adev))
> +		amdgpu_bo_free_kernel(&psp->fw_pri_bo,
> +				      &psp->fw_pri_mc_addr, &psp->fw_pri_buf);

This is superfluous, amdgpu_bo_free_kernel() does a NULL check anyway.

Apart from that looks good to me,
Christian.

>   	amdgpu_bo_free_kernel(&psp->fence_buf_bo,
>   			      &psp->fence_buf_mc_addr, &psp->fence_buf);
>   	amdgpu_bo_free_kernel(&psp->asd_shared_bo, &psp->asd_shared_mc_addr,

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
@ 2019-05-16  5:11 Yintian Tao
       [not found] ` <1557983492-25237-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Yintian Tao @ 2019-05-16  5:11 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Monk Liu, Yintian Tao

PSP fw primary buffer is not used under SRIOV
Therefore, we don't need to allocate memory for it.

Signed-off-by: Yintian Tao <yttao@amd.com>
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index c567a55..d3c77d2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -905,13 +905,16 @@ static int psp_load_fw(struct amdgpu_device *adev)
 	if (!psp->cmd)
 		return -ENOMEM;
 
-	ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
-					AMDGPU_GEM_DOMAIN_GTT,
-					&psp->fw_pri_bo,
-					&psp->fw_pri_mc_addr,
-					&psp->fw_pri_buf);
-	if (ret)
-		goto failed;
+	/* this fw pri bo is not used under SRIOV */
+	if (!amdgpu_sriov_vf(psp->adev)) {
+		ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
+					      AMDGPU_GEM_DOMAIN_GTT,
+					      &psp->fw_pri_bo,
+					      &psp->fw_pri_mc_addr,
+					      &psp->fw_pri_buf);
+		if (ret)
+			goto failed;
+	}
 
 	ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
 					AMDGPU_GEM_DOMAIN_VRAM,
@@ -1012,8 +1015,9 @@ static int psp_hw_fini(void *handle)
 	psp_ring_destroy(psp, PSP_RING_TYPE__KM);
 
 	amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);
-	amdgpu_bo_free_kernel(&psp->fw_pri_bo,
-			      &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
+	if (!amdgpu_sriov_vf(psp->adev))
+		amdgpu_bo_free_kernel(&psp->fw_pri_bo,
+				      &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
 	amdgpu_bo_free_kernel(&psp->fence_buf_bo,
 			      &psp->fence_buf_mc_addr, &psp->fence_buf);
 	amdgpu_bo_free_kernel(&psp->asd_shared_bo, &psp->asd_shared_mc_addr,
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-05-17 10:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 11:53 [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV Yintian Tao
     [not found] ` <1558007618-24482-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org>
2019-05-17  2:41   ` Tao, Yintian
     [not found]     ` <MN2PR12MB3039EAC37D6BB17BD3582D77E50B0-rweVpJHSKTr/fpeVZQY9RQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-05-17  6:53       ` Koenig, Christian
     [not found]         ` <f77131be-9a53-789d-0f1e-c743c80dc11a-5C7GfCeVMHo@public.gmane.org>
2019-05-17  7:17           ` 答复: " Tao, Yintian
     [not found]             ` <MN2PR12MB30390AB5467D6A7080AD45C6E50B0-rweVpJHSKTr/fpeVZQY9RQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-05-17  7:20               ` Christian König
     [not found]                 ` <0f307e3d-3f5f-3766-6db8-e51ab6c2562e-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-05-17  7:23                   ` 答复: " Tao, Yintian
2019-05-17 10:19               ` Liu, Monk
  -- strict thread matches above, loose matches on Subject: below --
2019-05-16  5:11 Yintian Tao
     [not found] ` <1557983492-25237-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org>
2019-05-16  7:24   ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.