On 27/02/2020 14:34, Jan Beulich wrote: > --- 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;
I think the logic would be easier to follow if this was has_xt, with inverted meaning. However... > 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; > } > > for_each_amd_iommu ( iommu ) ... the contents of this loop depends on the early exit path you've just deleted. In the case of x2apic not being available, we'll still set {ga,xt}_en to the caller requested value. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel