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

Re: [Xen-devel] [PATCH] AMD/IOMMU: correct handling when XT's prereq features are unavailable



On Thu, Feb 27, 2020 at 03:34:48PM +0100, Jan Beulich wrote:
> We should neither cause IOMMU initialization as a whole to fail in this
> case (we should still be able to bring up the system in non-x2APIC or
> x2APIC physical mode), nor should the remainder of the function be
> skipped (as the main part of it won't get entered a 2nd time) in such an
> event. It is merely necessary for the function to indicate to the caller
> (iov_supports_xt()) that setup failed as far as x2APIC is concerned.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -1364,6 +1364,7 @@ static int __init amd_iommu_prepare_one(
>  int __init amd_iommu_prepare(bool xt)
>  {
>      struct amd_iommu *iommu;
> +    bool no_xt = false;
>      int rc = -ENODEV;
>  
>      BUG_ON( !iommu_found() );
> @@ -1400,9 +1401,8 @@ int __init amd_iommu_prepare(bool xt)
>          if ( rc )
>              goto error_out;
>  
> -        rc = -ENODEV;
> -        if ( xt && (!iommu->features.flds.ga_sup || 
> !iommu->features.flds.xt_sup) )
> -            goto error_out;
> +        if ( !iommu->features.flds.ga_sup || !iommu->features.flds.xt_sup )
> +            no_xt = true;

Don't you need to also adjust the usage of xt in the
for_each_amd_iommu loop below, so that the control registers fields
get initialized properly?

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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