drm/i915/gvt: move intel iommu detection to intel_gvt_init()
authorZhenyu Wang <zhenyuw@linux.intel.com>
Fri, 13 Jan 2017 07:31:58 +0000 (15:31 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Tue, 7 Feb 2017 09:21:35 +0000 (17:21 +0800)
Prepare to remove detect_host() hook. Move intel iommu detection early
in intel_gvt_init().

Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/gvt.c
drivers/gpu/drm/i915/gvt/kvmgt.c

index e6bf5c533fbe5c795a7cef6baef2815aea797ce7..0beb17e9292875d8e51ebdc80dc636a0ffa92245 100644 (file)
@@ -77,6 +77,13 @@ int intel_gvt_init_host(void)
        if (xen_domain() && !xen_initial_domain())
                return -ENODEV;
 
        if (xen_domain() && !xen_initial_domain())
                return -ENODEV;
 
+#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
+
        /* Try to load MPT modules for hypervisors */
        if (xen_initial_domain()) {
                /* In Xen dom0 */
        /* Try to load MPT modules for hypervisors */
        if (xen_initial_domain()) {
                /* In Xen dom0 */
index 0c9234a87a20b3d0d6a1f7ddf9e789719a6244cd..f29d2a27ccb137346f6335a60e9ba2b5163c5b27 100644 (file)
@@ -1276,12 +1276,6 @@ static bool kvmgt_check_guest(void)
  */
 static int kvmgt_detect_host(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;
 }
 
        return kvmgt_check_guest() ? -ENODEV : 0;
 }