All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: Xiong Zhang <xiong.y.zhang@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org
Subject: Re: [PATCHi v2] drm/i915: Enhanced disable access to stolen memory as a guest
Date: Mon, 27 Mar 2017 10:21:42 +0800	[thread overview]
Message-ID: <20170327022142.frngwpbaixo4esfo@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <1490351024-22347-1-git-send-email-xiong.y.zhang@intel.com>


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

On 2017.03.24 18:23:44 +0800, Xiong Zhang wrote:
> commit "04a68a3 drm/i915/gvt: Disable access to stolen memory as a guest"
> isn't enough in GVT-d which will pass through IGD to guest and don't run
> vgt code. While intel_vgpu_active() is true only when vgt code run on
> host and guest in GVT-g.
> 
> v2:GVT-g may run in non qemu (Zhenyu)
> 
> Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.c        | 1 +
>  drivers/gpu/drm/i915/i915_drv.h        | 1 +
>  drivers/gpu/drm/i915/i915_gem_stolen.c | 4 ++--
>  3 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 03d9e45..8b807a9 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -223,6 +223,7 @@ static void intel_detect_pch(struct drm_i915_private *dev_priv)
>  					    PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
>  				    pch->subsystem_device ==
>  					    PCI_SUBDEVICE_ID_QEMU)) {
> +				dev_priv->run_on_qemu = true;
>  				dev_priv->pch_type =
>  					intel_virt_detect_pch(dev_priv);
>  			} else
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index a5947a4..ad95c87 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2145,6 +2145,7 @@ struct drm_i915_private {
>  	struct intel_uncore uncore;
>  
>  	struct i915_virtual_gpu vgpu;
> +	bool run_on_qemu;
>  
>  	struct intel_gvt *gvt;
>  
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index f3abdc2..6a011b0 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -409,8 +409,8 @@ int i915_gem_init_stolen(struct drm_i915_private *dev_priv)
>  
>  	mutex_init(&dev_priv->mm.stolen_lock);
>  
> -	if (intel_vgpu_active(dev_priv)) {
> -		DRM_INFO("iGVT-g active, disabling use of stolen memory\n");
> +	if (dev_priv->run_on_qemu || intel_vgpu_active(dev_priv)) {
> +		DRM_INFO("Running in guest, disabling use of stolen memory\n");
>  		return 0;
>  	}
>  
> -- 

Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>

-- 
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-03-27  2:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24  7:23 [PATCH] drm/i915: Enhanced disable access to stolen memory as a guest Xiong Zhang
2017-03-24  7:43 ` Zhenyu Wang
2017-03-24 10:23 ` [PATCHi v2] " Xiong Zhang
2017-03-27  2:21   ` Zhenyu Wang [this message]
2017-03-27 11:55     ` Daniel Vetter
2017-03-28  1:28       ` Zhang, Xiong Y
2017-03-29 11:58         ` Daniel Vetter
2017-03-24 11:50 ` ✓ Fi.CI.BAT: success for drm/i915: Enhanced disable access to stolen memory as a guest (rev2) Patchwork
2017-03-30 10:04 ` [PATCH V3] drm/i915: Enhanced disable access to stolen memory as a guest Xiong Zhang
2017-03-30 10:04   ` Xiong Zhang
2017-03-30 12:53 ` ✓ Fi.CI.BAT: success for drm/i915: Enhanced disable access to stolen memory as a guest (rev3) 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=20170327022142.frngwpbaixo4esfo@zhen-hp.sh.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=xiong.y.zhang@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.