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

Re: [Xen-devel] [PATCH RFC 09/10] passthrough/intel: put some code under CONFIG_HVM



>>> On 21.02.18 at 22:47, <wei.liu2@xxxxxxxxxx> wrote:
> @@ -1873,6 +1876,7 @@ int iommu_pte_flush(struct domain *d, u64 gfn, u64 *pte,
>      return rc;
>  }
>  
> +#ifdef CONFIG_HVM
>  static int __init vtd_ept_page_compatible(struct iommu *iommu)
>  {
>      u64 ept_cap, vtd_cap = iommu->cap;
> @@ -1885,6 +1889,7 @@ static int __init vtd_ept_page_compatible(struct iommu 
> *iommu)
>      return (ept_has_2mb(ept_cap) && opt_hap_2mb) == cap_sps_2mb(vtd_cap) &&
>             (ept_has_1gb(ept_cap) && opt_hap_1gb) == cap_sps_1gb(vtd_cap);
>  }
> +#endif

I think the #ifdef here would better move into the function, such that ...

> @@ -2280,7 +2285,9 @@ int __init intel_vtd_setup(void)
>          if ( !cap_intr_post(iommu->cap) || !cpu_has_cx16 )
>              iommu_intpost = 0;
>  
> +#ifdef CONFIG_HVM
>          if ( !vtd_ept_page_compatible(iommu) )
> +#endif
>              iommu_hap_pt_share = 0;

... this one becomes unnecessary. Furthermore iommu_hap_pt_share is a
variable that's meaningful for HVM only, so another alternative would be to
widen the #ifdef here.

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