[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 01/16] iommu: Add checks before calling iommu suspend/resume



Hi,

On Wed, Mar 5, 2025 at 6:45 PM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 05.03.2025 10:11, Mykola Kvach wrote:
> > --- a/xen/drivers/passthrough/iommu.c
> > +++ b/xen/drivers/passthrough/iommu.c
> > @@ -613,7 +613,7 @@ int __init iommu_setup(void)
> >
> >  int iommu_suspend(void)
> >  {
> > -    if ( iommu_enabled )
> > +    if ( iommu_enabled && iommu_get_ops() && iommu_get_ops()->suspend )
> >          return iommu_call(iommu_get_ops(), suspend);
> >
> >      return 0;
> > @@ -621,7 +621,7 @@ int iommu_suspend(void)
> >
> >  void iommu_resume(void)
> >  {
> > -    if ( iommu_enabled )
> > +    if ( iommu_enabled && iommu_get_ops() && iommu_get_ops()->resume )
> >          iommu_vcall(iommu_get_ops(), resume);
> >  }
>
> When iommu_enabled is true, surely iommu_get_ops() is required to return
> non-NULL?

As far as I can see, in some cases, the handler is still checked even
if iommu_enabled
is true, such as in the case of the iommu_quiesce call. However, it
might be better to drop
this patch from the current patch series or add a patch that
introduces the handlers.

>
> Jan

Best regards,
Mykola



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.