From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Tina Zhang <tina.zhang@intel.com>,
intel-gvt-dev@lists.freedesktop.org, zhenyuw@linux.intel.com,
zhi.a.wang@intel.com, kevin.tian@intel.com,
chris@chris-wilson.co.uk, zhiyuan.lv@intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v9 2/3] drm/i915: Enable guest i915 full ppgtt functionality
Date: Fri, 11 Aug 2017 12:46:48 +0300 [thread overview]
Message-ID: <1502444808.3582.32.camel@linux.intel.com> (raw)
In-Reply-To: <1502322098-23702-3-git-send-email-tina.zhang@intel.com>
On to, 2017-08-10 at 07:41 +0800, Tina Zhang wrote:
> Enable the guest i915 full ppgtt functionality when host can provide this
> capability. vgt_caps is introduced to guest i915 driver to get the vgpu
> capabilities from the device model. VGT_CPAS_FULL_PPGTT is one of the
> capabilities type to let guest i915 dirver know that the guest i915 full
> ppgtt is supported by device model.
>
> Notice that the minor version of pvinfo isn't bumped because of this
> vgt_caps introduction, due to older guest would be broken by simply
> increasing the pvinfo version. Although the pvinfo minor version doesn't
> increase, the compatibility won't be blocked. The compatibility is ensured
> by checking the value of caps field in pvinfo. Zero means no full ppgtt
> support and BIT(2) means this feature is provided.
>
> Changes since v1:
> - Use u32 instead of uint32_t (Joonas)
> - Move VGT_CAPS_FULL_PPGTT introduction to this patch and use #define
> instead of enum (Joonas)
> - Rewrite the vgpu full ppgtt capability checking logic. (Joonas)
> - Some coding style refine. (Joonas)
>
> Changes since v2:
> - Divide the whole patch set into two separate patch series, with one
> patch in i915 side to check guest i915 full ppgtt capability and enable
> it when this capability is supported by the device model, and the other
> one in gvt side which fixs the blocking issue and enables the device
> model to provide the capability to guest. And this patch focuses on guest
> i915 side. (Joonas)
> - Change the title from "introduce vgt_caps to pvinfo" to
> "Enable guest i915 full ppgtt functionality". (Tina)
>
> Change since v3:
> - Add some comments about pvinfo caps and version. (Joonas)
>
> Change since v4:
> - Tested by Tina Zhang.
>
> Change since v5:
> - Add limitation about supporting 32bit full ppgtt.
>
> Change since v6:
> - Change the fallback to 48bit full ppgtt if i915.ppgtt_enable=2. (Zhenyu)
>
> Change in v9:
> - Remove the fixme comment due to no plan for 32bit full ppgtt
> support. (Zhenyu)
> - Reorder the patch-set to fix compiling issue with git-bisect. (Zhenyu)
> - Add print log when forcing guest 48bit full ppgtt. (Zhenyu)
>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> in v2
> Signed-off-by: Tina Zhang <tina.zhang@intel.com>
<SNIP>
> @@ -141,14 +141,19 @@ int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
>
> has_aliasing_ppgtt = dev_priv->info.has_aliasing_ppgtt;
> has_full_ppgtt = dev_priv->info.has_full_ppgtt;
> - has_full_48bit_ppgtt = dev_priv->info.has_full_48bit_ppgtt;
Leave above line.
>
> if (intel_vgpu_active(dev_priv)) {
> - /* emulation is too hard */
> - has_full_ppgtt = false;
> - has_full_48bit_ppgtt = false;
has_full_ppgtt = false;
has_full_48bit_ppgtt =
intel_vgpu_has_full_48bit_ppgtt(dev_priv);
> + has_full_ppgtt = intel_vgpu_has_full_ppgtt(dev_priv);
> + /* GVT-g has no support for 32bit ppgtt */
> + if (enable_ppgtt == 2 && has_full_ppgtt) {
> + DRM_DEBUG_DRIVER("Force 48bit ppgtt for vGPU\n");
> + enable_ppgtt = 3;
Lets not do an upgrade for the user if they explicitly requested lower
level. I'd just leave the option to be and it'll get downgraded to
aliasing ppgtt.
> + }
> }
>
> + has_full_48bit_ppgtt = has_full_ppgtt &&
> + dev_priv->info.has_full_48bit_ppgtt;
> +
This can then be dropped too.
I'll send a patch to disconnect the has_full_ppgtt and
has_full_48bit_ppgtt flags.
> if (!has_aliasing_ppgtt)
> return 0;
>
> @@ -49,12 +49,18 @@ enum vgt_g2v_type {
> > VGT_G2V_MAX,
> };
>
> +/*
> + * VGT capabilities type
> + */
> +#define VGT_CAPS_FULL_PPGTT_48BIT BIT(2)
VGT_CAPS_FULL_48BIT_PPGTT for consistency
> @@ -75,10 +75,17 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv)
> return;
> }
>
> + dev_priv->vgpu.caps = __raw_i915_read32(dev_priv, vgtif_reg(vgt_caps));
> +
> dev_priv->vgpu.active = true;
> DRM_INFO("Virtual GPU for Intel GVT-g detected.\n");
> }
>
> +bool intel_vgpu_has_full_ppgtt(struct drm_i915_private *dev_priv)
This should really be has_full_48bit_ppgtt() too.
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-08-11 9:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1502322098-23702-1-git-send-email-tina.zhang@intel.com>
2017-08-09 23:41 ` [PATCH v9 2/3] drm/i915: Enable guest i915 full ppgtt functionality Tina Zhang
2017-08-11 9:46 ` Joonas Lahtinen [this message]
2017-08-14 2:23 ` Zhenyu Wang
2017-08-10 2:49 ` [PATCH v9 0/3] drm/i915/gvt: Enable guest i915 48bit full ppgtt support Zhenyu Wang
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=1502444808.3582.32.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=kevin.tian@intel.com \
--cc=tina.zhang@intel.com \
--cc=zhenyuw@linux.intel.com \
--cc=zhi.a.wang@intel.com \
--cc=zhiyuan.lv@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox