All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhenyu Wang <zhenyuw@linux.intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Arnd Bergmann <arnd@kernel.org>,
	intel-gfx@lists.freedesktop.org,
	intel-gvt-dev@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 1/2] drm/i915/gvt: Move mdev attribute groups into kvmgt module
Date: Thu, 29 Apr 2021 10:40:27 +0800	[thread overview]
Message-ID: <20210429024027.GR1551@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <20210428172141.GW2047089@ziepe.ca>


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

On 2021.04.28 14:21:41 -0300, Jason Gunthorpe wrote:
> On Wed, Apr 28, 2021 at 01:32:43PM +0800, Zhenyu Wang wrote:
> > On 2021.04.27 09:12:35 -0300, Jason Gunthorpe wrote:
> > > On Tue, Apr 27, 2021 at 10:45:06AM +0800, Zhenyu Wang wrote:
> > > > On 2021.04.26 10:39:24 -0300, Jason Gunthorpe wrote:
> > > > > On Mon, Apr 26, 2021 at 05:41:42PM +0800, Zhenyu Wang wrote:
> > > > > > @@ -1667,19 +1773,26 @@ static struct mdev_parent_ops intel_vgpu_ops = {
> > > > > >  
> > > > > >  static int kvmgt_host_init(struct device *dev, void *gvt, const void *ops)
> > > > > >  {
> > > > > > -	struct attribute_group **kvm_vgpu_type_groups;
> > > > > > +	int ret;
> > > > > > +
> > > > > > +	ret = intel_gvt_init_vgpu_type_groups((struct intel_gvt *)gvt);
> > > > > > +	if (ret)
> > > > > > +		return ret;
> > > > > >  
> > > > > >  	intel_gvt_ops = ops;
> > > > > > -	if (!intel_gvt_ops->get_gvt_attrs(&kvm_vgpu_type_groups))
> > > > > > -		return -EFAULT;
> > > > > > -	intel_vgpu_ops.supported_type_groups = kvm_vgpu_type_groups;
> > > > > > +	intel_vgpu_ops.supported_type_groups = gvt_vgpu_type_groups;
> > > > > 
> > > > > This patch is an improvement, but this fictional dynamic behavior is
> > > > > still wrong. The supported_type_groups directly flows from the
> > > > > vgpu_types array in vgpu.c and it should not be split up like this
> > > > > 
> > > > > The code copies the rodata vgpu_types into dynamic memory gvt->types
> > > > > then copies that dynamic memory into a dynamic gvt_vgpu_type_groups,
> > > > > which makes very little sense at all.
> > > > 
> > > > vgpu_types is static for we want fixed vgpu mdev type, but actual supported
> > > > types depend on HW resources e.g aperture mem, fence, etc, that's dynamic for
> > > > gvt->types, so gvt_vgpu_type_groups is dynamic from gvt->types.
> > > 
> > > Well, that's worse then, intel_vgpu_ops.supported_type_groups is a
> > > static global, it cannot depend on HW variable calculations.
> > 
> > sorry, maybe I didn't describe this properly, gvt_vgpu_type_groups is
> > static global, but the actual supported types is determined from
> > gvt->types and initialized before mdev device register.
> 
> No, I got it, I saw the code too.
> 
> Think about what happens if there are two GPUs in the system, you get
> two gvt's and with different properties and you are trying to squeeze
> that into a single static global - it doesn't work. 
> 

Well, that's not what this change trys to resolve and on gvt supported platform
that's not an available hardware configuration for IGD. So I think this is fine.


[-- 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

      parent reply	other threads:[~2021-04-29  2:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26  9:41 [Intel-gfx] [PATCH 1/2] drm/i915/gvt: Move mdev attribute groups into kvmgt module Zhenyu Wang
2021-04-26  9:41 ` [Intel-gfx] [PATCH 2/2] Revert "vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV" Zhenyu Wang
2021-04-26 16:55   ` Alex Williamson
     [not found]     ` <20210426174017.GL2047089@ziepe.ca>
2021-04-27  5:31       ` Zhenyu Wang
2021-04-27 19:39         ` Alex Williamson
2021-04-26 12:09 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [1/2] drm/i915/gvt: Move mdev attribute groups into kvmgt module Patchwork
     [not found] ` <20210426133924.GK2047089@ziepe.ca>
2021-04-27  2:45   ` [Intel-gfx] [PATCH 1/2] " Zhenyu Wang
     [not found]     ` <20210427121235.GM2047089@ziepe.ca>
2021-04-28  5:32       ` Zhenyu Wang
     [not found]         ` <20210428172141.GW2047089@ziepe.ca>
2021-04-29  2:40           ` Zhenyu Wang [this message]

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=20210429024027.GR1551@zhen-hp.sh.intel.com \
    --to=zhenyuw@linux.intel.com \
    --cc=arnd@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=jgg@ziepe.ca \
    /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.