On Thu, Jul 21, 2022 at 11:32 PM Chen, Horace <[email protected]> wrote:
>
> [AMD Official Use Only - General]
>
> Hi Alex,
>
> By current design, we will keep this register same for all new asics.
> Also, the amdgpu_detect_virtualization will be called before we read the IP 
> discovery table (virtualization needs to send a message to host machine to 
> request for the IP discovery table preparation). So we can't use any IP 
> version to decide the register.

Reviewed-by: Alex Deucher <[email protected]>

>
> Regards,
> Horace.
>
> -----Original Message-----
> From: Alex Deucher <[email protected]>
> Sent: Thursday, July 21, 2022 10:37 PM
> To: Chen, Horace <[email protected]>
> Cc: [email protected]; Grodzovsky, Andrey 
> <[email protected]>; Xiao, Jack <[email protected]>; Xu, Feifei 
> <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Xiaojie Yuan 
> <[email protected]>; Tuikov, Luben <[email protected]>; Deucher, 
> Alexander <[email protected]>; Quan, Evan <[email protected]>; 
> Koenig, Christian <[email protected]>; Liu, Monk <[email protected]>; 
> Zhang, Hawking <[email protected]>
> Subject: Re: [PATCH 1/6] drm/amdgpu: add CHIP_IP_DISCOVERY support for 
> virtualization
>
> On Thu, Jul 21, 2022 at 5:52 AM Horace Chen <[email protected]> wrote:
> >
> > For further chips we will use CHIP_IP_DISCOVERY, so add this support
> > for virtualization
>
> All current and future chips will use CHIP_IP_DISCOVERY.  If we plan to keep 
> the register the same for all new aics, this should be fine.
> If we might need to have it per asic I think you might want something more 
> like this:
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> index 9be57389301b..0bdd71f9a8fb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> @@ -709,6 +709,16 @@ void amdgpu_detect_virtualization(struct
> amdgpu_device *adev)
>         case CHIP_ALDEBARAN:
>                 reg = RREG32(mmRCC_IOV_FUNC_IDENTIFIER);
>                 break;
> +       case CHIP_IP_DISCOVERY:
> +               switch (adev->ip_versions[GC_HWIP][0]) {
> +               case IP_VERSION(11, 0, 0):
> +                       reg = RREG32(mmRCC_IOV_FUNC_IDENTIFIER);
> +                       break;
> +               default:
> +                       reg = 0;
> +                       break;
> +               }
> +               break;
>         default: /* other chip doesn't support SRIOV */
>                 reg = 0;
>                 break;
>
> Alex
>
> >
> > Signed-off-by: Horace Chen <[email protected]>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> > index 7d7044e9de2f..ab55602ff534 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> > @@ -705,6 +705,7 @@ void amdgpu_detect_virtualization(struct amdgpu_device 
> > *adev)
> >         case CHIP_SIENNA_CICHLID:
> >         case CHIP_ARCTURUS:
> >         case CHIP_ALDEBARAN:
> > +       case CHIP_IP_DISCOVERY:
> >                 reg = RREG32(mmRCC_IOV_FUNC_IDENTIFIER);
> >                 break;
> >         default: /* other chip doesn't support SRIOV */ @@ -748,6
> > +749,7 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev)
> >                 case CHIP_NAVI10:
> >                 case CHIP_NAVI12:
> >                 case CHIP_SIENNA_CICHLID:
> > +               case CHIP_IP_DISCOVERY:
> >                         nv_set_virt_ops(adev);
> >                         /* try send GPU_INIT_DATA request to host */
> >                         amdgpu_virt_request_init_data(adev);
> > --
> > 2.25.1
> >

Reply via email to