All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: "He, Min" <min.he@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Yuan, Hang" <hang.yuan@intel.com>,
	"intel-gvt-dev@lists.freedesktop.org"
	<intel-gvt-dev@lists.freedesktop.org>
Subject: Re: [PATCH v4] drm/i915/gvt: Change KVMGT as self load module
Date: Fri, 7 Dec 2018 15:50:28 +0800	[thread overview]
Message-ID: <20181207075028.GL12743@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <B8F3B07A09E6B84F88EAD83F055E99455195FC24@SHSMSX103.ccr.corp.intel.com>


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

On 2018.12.07 07:47:59 +0000, He, Min wrote:
> Zhenyu,
> Overall I think the impact to AcrnGT is not big, we can modify our code to adapt
> to the new interfaces. 
> But I have some comments embedded. 
> 

Good!

> > > @@ -467,6 +408,44 @@ int intel_gvt_init_device(struct drm_i915_private
> > *dev_priv)
> > >  	return ret;
> > >  }
> > >
> > > -#if IS_ENABLED(CONFIG_DRM_I915_GVT_KVMGT)
> > > -MODULE_SOFTDEP("pre: kvmgt");
> > > -#endif
> > > +int
> > > +intel_gvt_register_hypervisor(struct intel_gvt_mpt *m)
> > > +{
> > > +	int ret;
> > > +	void *gvt;
> > > +
> > > +	if (!intel_gvt_host.initialized)
> > > +		return -ENODEV;
> > > +
> > > +	if (m->type != INTEL_GVT_HYPERVISOR_KVM &&
> > > +	    m->type != INTEL_GVT_HYPERVISOR_XEN)
> > > +		return -EINVAL;
> > > +
> > > +	/* Get a reference for device model module */
> > > +	if (!try_module_get(THIS_MODULE))
> > > +		return -ENODEV;
> > > +
> > > +	intel_gvt_host.mpt = m;
> > > +	intel_gvt_host.hypervisor_type = m->type;
> > > +	gvt = (void *)kdev_to_i915(intel_gvt_host.dev)->gvt;
> > > +
> > > +	ret = intel_gvt_hypervisor_host_init(intel_gvt_host.dev, gvt,
> > > +					     &intel_gvt_ops);
> I think we can remove the host_init and host_exit interfaces, since now
> it's mpt modules who proactively call the GVT-g to initialize and un-initialize,
> Thus we can return the intel_gvt_ops in intel_gvt_register_hypervisor() and
> moduels initialize its rest part. 
> Current kvmgt_init-> intel_gvt_register_hypervisor->host_init seems a little bit
> redundant.
> But it's up to you to make the call to remove it in this patch or other furture
> optimization patches.
>

I'd like to keep as in current approach, as it can keep hypervisor init
function in one place instead of passing gvt host info to hypervisor module.
And calling submodule's init function is fine process I think.

> > > @@ -67,6 +73,5 @@ struct intel_gvt_mpt {
> > >  };
> > >
> > >  extern struct intel_gvt_mpt xengt_mpt;
> We can remove this definition, too. 
>

yeah, but maybe in another xengt cleanup patch.

> > > diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c
> > b/drivers/gpu/drm/i915/gvt/kvmgt.c
> > > index 1bbd04d30c42..ef248d577e49 100644
> > > --- a/drivers/gpu/drm/i915/gvt/kvmgt.c
> > > +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c
> > > @@ -50,6 +50,7 @@
> > >  #include "gvt.h"
> > >
> > >  static const struct intel_gvt_ops *intel_gvt_ops;
> > > +static struct intel_gvt *intel_gvt;
> This variable intel_gvt seems useless.
>

Thanks for pointing this out, was trying to use for exit path,
but looks I missed to remove it finally.

-- 
Open Source Technology Center, Intel ltd.

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

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 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:[~2018-12-07  7:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03  4:05 [PATCH v3 0/3] Change KVMGT into self loadable module Zhenyu Wang
2018-12-03  4:05 ` [PATCH v3 1/3] drm/i915/gvt: mandatory require hypervisor's host_init Zhenyu Wang
2018-12-03  4:05 ` [PATCH v3 2/3] drm/i915/gvt: remove unused parameter for hypervisor's host_exit call Zhenyu Wang
2018-12-03  4:05 ` [PATCH v3 3/3] drm/i915/gvt: Change KVMGT as self load module Zhenyu Wang
2018-12-04  2:40   ` [PATCH v4] " Zhenyu Wang
2018-12-06  4:27     ` Zhenyu Wang
2018-12-07  7:47       ` He, Min
2018-12-07  7:50         ` Zhenyu Wang [this message]
2018-12-06  7:17     ` Yuan, Hang
2018-12-06  8:02     ` [PATCH v5] " Zhenyu Wang
2018-12-06  9:31       ` Yuan, Hang
2018-12-03  4:14 ` ✗ Fi.CI.CHECKPATCH: warning for Change KVMGT into self loadable module Patchwork
2018-12-03  4:32 ` ✓ Fi.CI.BAT: success " Patchwork
2018-12-03  5:34 ` ✓ Fi.CI.IGT: " Patchwork
2018-12-04  3:15 ` ✓ Fi.CI.BAT: success for Change KVMGT into self loadable module (rev2) Patchwork
2018-12-04  4:47 ` ✓ Fi.CI.IGT: " Patchwork
2018-12-06  8:55 ` ✓ Fi.CI.BAT: success for Change KVMGT into self loadable module (rev3) Patchwork
2018-12-06 23:33 ` ✓ Fi.CI.IGT: " Patchwork

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=20181207075028.GL12743@zhen-hp.sh.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=hang.yuan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=min.he@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.