[PATCH] drm/i915/gvt: fix kvmgt_mpt symbol export issue
hang.yuan at linux.intel.com
hang.yuan at linux.intel.com
Tue Nov 20 09:09:13 UTC 2018
From: Hang Yuan <hang.yuan at linux.intel.com>
Update gvt to reference kvmgt_mpt directly. This prevents the
exported symbol kvmgt_mpt being dropped when kernel config
CONFIG_TRIM_UNUSED_KSYMS is set.
Signed-off-by: Hang Yuan <hang.yuan at linux.intel.com>
---
drivers/gpu/drm/i915/gvt/gvt.c | 7 +------
drivers/gpu/drm/i915/gvt/gvt.h | 4 ++++
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
index 733a2a0..a176e88 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.c
+++ b/drivers/gpu/drm/i915/gvt/gvt.c
@@ -216,8 +216,7 @@ int intel_gvt_init_host(void)
} else {
#if IS_ENABLED(CONFIG_DRM_I915_GVT_KVMGT)
/* not in Xen. Try KVMGT */
- intel_gvt_host.mpt = try_then_request_module(
- symbol_get(kvmgt_mpt), "kvmgt");
+ intel_gvt_host.mpt = &kvmgt_mpt;
intel_gvt_host.hypervisor_type = INTEL_GVT_HYPERVISOR_KVM;
#endif
}
@@ -466,7 +465,3 @@ int intel_gvt_init_device(struct drm_i915_private *dev_priv)
kfree(gvt);
return ret;
}
-
-#if IS_ENABLED(CONFIG_DRM_I915_GVT_KVMGT)
-MODULE_SOFTDEP("pre: kvmgt");
-#endif
diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
index 31f6cdb..a3c9fa4 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -65,6 +65,10 @@ struct intel_gvt_host {
extern struct intel_gvt_host intel_gvt_host;
+#if IS_ENABLED(CONFIG_DRM_I915_GVT_KVMGT)
+extern struct intel_gvt_mpt kvmgt_mpt;
+#endif
+
/* Describe per-platform limitations. */
struct intel_gvt_device_info {
u32 max_support_vgpus;
--
2.7.4
More information about the intel-gvt-dev
mailing list