Intel-GFX Archive on 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: Tue, 27 Apr 2021 10:45:06 +0800	[thread overview]
Message-ID: <20210427024506.GL1551@zhen-hp.sh.intel.com> (raw)
In-Reply-To: <20210426133924.GK2047089@ziepe.ca>


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

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.

> 
> vgpu_types should be moved to kvmgt and everything should be static,
> like every other mdev driver. Copy the 'type' information from the
> gpu_types static when the mdev is created.
> 

I don't think that's necessary, as it's not static for gvt at all.
The logic to handle type resource change can still be in vgpu.c


[-- 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-27  3:03 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   ` Zhenyu Wang [this message]
     [not found]     ` <20210427121235.GM2047089@ziepe.ca>
2021-04-28  5:32       ` [Intel-gfx] [PATCH 1/2] " Zhenyu Wang
     [not found]         ` <20210428172141.GW2047089@ziepe.ca>
2021-04-29  2:40           ` 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=20210427024506.GL1551@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox