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

Re: [Xen-devel] [PATCH v2] x86/vtd: fix iommu_share_p2m_table



>>> On 08.10.18 at 15:52, <roger.pau@xxxxxxxxxx> wrote:
> Commit 2916951c1 "mm / iommu: include need_iommu() test in
> iommu_use_hap_pt()" changed the check in iommu_share_p2m_table to use
> need_iommu(d) (as part of iommu_use_hap_pt) instead of iommu_enabled,
> which broke the check because at the point in domain construction
> where iommu_share_p2m_table is called need_iommu(d) will always return
> false.
> 
> Fix this by reverting to the previous logic.
> 
> While there turn the hap_enabled check into an ASSERT, since the only
> caller of iommu_share_p2m_table already performs the hap_enabled check
> before calling the function.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -505,7 +505,13 @@ int iommu_do_domctl(
>  
>  void iommu_share_p2m_table(struct domain* d)
>  {
> -    if ( iommu_use_hap_pt(d) )
> +    ASSERT(hap_enabled(d));
> +    /*
> +     * iommu_use_hap_pt cannot be used here because at the point in the 
> domain
> +     * construction where iommu_share_p2m_table get called need_iommu(d) will
> +     * always return false.
> +     */

I'm fighting with myself whether to shorten this comment while
committing - it's certainly not "brief".

Jan


_______________________________________________
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®.