All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: Jike Song <jike.song@intel.com>
Cc: intel-gfx@lists.freedesktop.org, igvt-g-dev@lists.01.org
Subject: Re: [PATCH 1/5] drm/i915: make intel_gvt_init() later instead of too early
Date: Wed, 11 Jan 2017 11:29:23 +0800	[thread overview]
Message-ID: <20170111032923.tyqgo7vgqdeurhku@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <5875A2C2.8020609@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 2979 bytes --]

On 2017.01.11 11:13:06 +0800, Jike Song wrote:
> On 01/10/2017 02:52 PM, Zhenyu Wang wrote:
> > Previously intel_gvt_init() was called very early even before
> > MMIO initialization which had several drawbacks:
> > - Have to handle MMIO access for initial MMIO state dump if golden
> >   state firmware is not available
> > - Hypervisor detection should depend on pvinfo only instead of detecting
> >   hypervisor status.
> > - Don't know hw resource size e.g aperture, ggtt size to determine
> >   for vGPU type, etc.
> > 
> > This trys to move intel_gvt_init() call late after required info
> > has already been initialized for GVT host.
> > 
> > Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/gvt/gvt.c   | 20 ++++++++------------
> >  drivers/gpu/drm/i915/i915_drv.c  | 14 +++++++-------
> >  drivers/gpu/drm/i915/intel_gvt.c |  5 +++++
> >  3 files changed, 20 insertions(+), 19 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/gvt/gvt.c b/drivers/gpu/drm/i915/gvt/gvt.c
> > index e6bf5c533fbe..35264a991776 100644
> > --- a/drivers/gpu/drm/i915/gvt/gvt.c
> > +++ b/drivers/gpu/drm/i915/gvt/gvt.c
> > @@ -73,23 +73,19 @@ int intel_gvt_init_host(void)
> >  	if (intel_gvt_host.initialized)
> >  		return 0;
> >  
> > -	/* Xen DOM U */
> > -	if (xen_domain() && !xen_initial_domain())
> > -		return -ENODEV;
> > -
> >  	/* Try to load MPT modules for hypervisors */
> > -	if (xen_initial_domain()) {
> > +#if IS_ENABLED(CONFIG_DRM_I915_GVT_KVMGT)
> > +	/* Try KVMGT */
> > +	intel_gvt_host.mpt = try_then_request_module(
> > +		symbol_get(kvmgt_mpt), "kvmgt");
> > +	intel_gvt_host.hypervisor_type = INTEL_GVT_HYPERVISOR_KVM;
> > +#endif
> > +
> > +	if (!intel_gvt_host.mpt && xen_initial_domain()) {
> >  		/* In Xen dom0 */
> >  		intel_gvt_host.mpt = try_then_request_module(
> >  				symbol_get(xengt_mpt), "xengt");
> >  		intel_gvt_host.hypervisor_type = INTEL_GVT_HYPERVISOR_XEN;
> > -	} 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.hypervisor_type = INTEL_GVT_HYPERVISOR_KVM;
> > -#endif
> >  	}
> >  
> 
> Hi Zhenyu,
> 
> It is always easy for xengt to detect dom0 case, but difficult for kvmgt
> to detect host, so I guess xen_initial_domain() should be removed from here,
> and placed in xengt.ko.
> 
> [xengt.ko]
> 
> 	static int __init xengt_init(void)
> 	{
> 	       if (!xen_initial_domain())
> 		       return -EINVAL;
> 		...
> 
> [gvt]
> 	request xengt_mpt
> 	if (failed)
> 		request kvmgt_mpt
> 
> With logic above, we can avoid calling xen_initial_domain(), and remove
> "#include <xen/xen.h>" from gvt.c.
> 
> What'd you say? :)
> 

yep, sounds good to me.

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-01-11  3:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-10  6:52 [PATCH 0/5] Fix issues caused by gvt init timing Zhenyu Wang
2017-01-10  6:52 ` [PATCH 1/5] drm/i915: make intel_gvt_init() later instead of too early Zhenyu Wang
2017-01-11  3:13   ` Jike Song
2017-01-11  3:29     ` Zhenyu Wang [this message]
2017-01-10  6:52 ` [PATCH 2/5] drm/i915/gvt: move intel iommu detection to intel_gvt_init() Zhenyu Wang
2017-01-11  2:18   ` Jike Song
2017-01-11  2:40     ` Zhenyu Wang
2017-01-11  3:01       ` Jike Song
2017-01-10  6:52 ` [PATCH 3/5] drm/i915/gvt: remove detect_host() MPT hook Zhenyu Wang
2017-01-10  6:52 ` [PATCH 4/5] drm/i915/gvt: use normal mmio read function for firmware exposure Zhenyu Wang
2017-01-10  6:52 ` [PATCH 5/5] drm/i915/gvt: fix vgpu type size init Zhenyu Wang
2017-01-10  7:23 ` ✓ Fi.CI.BAT: success for Fix issues caused by gvt init timing Patchwork
2017-01-10 15:41 ` [PATCH 0/5] " Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170111032923.tyqgo7vgqdeurhku@zhen-hp.sh.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=igvt-g-dev@lists.01.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jike.song@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.