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

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



> -----Original Message-----
> From: Roger Pau Monne [mailto:roger.pau@xxxxxxxxxx]
> Sent: 08 October 2018 11:15
> To: xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>; Jan Beulich
> <jbeulich@xxxxxxxx>; Paul Durrant <Paul.Durrant@xxxxxxxxxx>
> Subject: [PATCH] x86/vtd: fix iommu_share_p2m_table
> 
> Commit 2916951c1 changed the check in iommu_share_p2m_table to use
> need_iommu(d) 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.

Thanks for finding this.

Above, I think you need to include the title of commit 2916951c1 and also the 
text should say that the need_iommu() check became implicit in 
iommu_hap_pt_share() (otherwise folks looking at the patch may be bemused 
because need_iommu is not in the code).

The code looks fine though so...

Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx>

> 
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> ---
> Cc: Jan Beulich <jbeulich@xxxxxxxx>
> Cc: Paul Durrant <paul.durrant@xxxxxxxxxx>
> ---
>  xen/drivers/passthrough/iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/passthrough/iommu.c
> b/xen/drivers/passthrough/iommu.c
> index debb5e6fe1..a9408f1de9 100644
> --- a/xen/drivers/passthrough/iommu.c
> +++ b/xen/drivers/passthrough/iommu.c
> @@ -505,7 +505,7 @@ int iommu_do_domctl(
> 
>  void iommu_share_p2m_table(struct domain* d)
>  {
> -    if ( iommu_use_hap_pt(d) )
> +    if ( iommu_enabled && hap_enabled(d) && iommu_hap_pt_share )
>          iommu_get_ops()->share_p2m(d);
>  }
> 
> --
> 2.19.0

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