[Intel-gfx] [PATCH 2/5] drm/i915/gvt: move intel iommu detection to intel_gvt_init()

Jike Song jike.song at intel.com
Wed Jan 11 02:18:30 UTC 2017


On 01/10/2017 02:52 PM, Zhenyu Wang wrote:
> Prepare to remove detect_host() hook. Move intel iommu detection early
> in intel_gvt_init().
> 
> Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/gvt.c   | 7 +++++++
>  drivers/gpu/drm/i915/gvt/kvmgt.c | 6 ------
>  2 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
> index 35264a991776..7a7886644acf 100644
> --- a/drivers/gpu/drm/i915/gvt/gvt.c
> +++ b/drivers/gpu/drm/i915/gvt/gvt.c
> @@ -73,6 +73,13 @@ int intel_gvt_init_host(void)
>  	if (intel_gvt_host.initialized)
>  		return 0;
>  
> +#ifdef CONFIG_INTEL_IOMMU
> +	if (intel_iommu_gfx_mapped) {
> +		gvt_err("Hardware IOMMU compatibility not yet supported, try to boot with intel_iommu=igfx_off\n");
> +		return -ENODEV;
> +	}
> +#endif
> +

Hi Zhenyu,

Per my understanding, the "intel_iommu=" parameter acts only on native (think about XenGT),
so it's better to keep it somewhere in kvmgt.c, maybe kvmgt_init()?

--
Thanks,
Jike
>  	/* Try to load MPT modules for hypervisors */
>  #if IS_ENABLED(CONFIG_DRM_I915_GVT_KVMGT)
>  	/* Try KVMGT */
> diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c
> index 0c9234a87a20..f29d2a27ccb1 100644
> --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> @@ -1276,12 +1276,6 @@ static bool kvmgt_check_guest(void)
>   */
>  static int kvmgt_detect_host(void)
>  {
> -#ifdef CONFIG_INTEL_IOMMU
> -	if (intel_iommu_gfx_mapped) {
> -		gvt_err("Hardware IOMMU compatibility not yet supported, try to boot with intel_iommu=igfx_off\n");
> -		return -ENODEV;
> -	}
> -#endif
>  	return kvmgt_check_guest() ? -ENODEV : 0;
>  }
>  
> 


More information about the Intel-gfx mailing list