All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Colin Xu <colin.xu@gmail.com>
Cc: kvm@vger.kernel.org, colin.xu@intel.com, zhenyuw@linux.intel.com,
	hang.yuan@linux.intel.com, swee.yee.fonn@intel.com,
	fred.gao@intel.com
Subject: Re: [PATCH v8] vfio/pci: Add OpRegion 2.0+ Extended VBT support.
Date: Tue, 12 Oct 2021 11:12:48 -0600	[thread overview]
Message-ID: <20211012111248.2314ad0b.alex.williamson@redhat.com> (raw)
In-Reply-To: <20211012124855.52463-1-colin.xu@gmail.com>

On Tue, 12 Oct 2021 20:48:55 +0800
Colin Xu <colin.xu@gmail.com> wrote:

> From: Colin Xu <colin.xu@intel.com>
> 
> Due to historical reason, some legacy shipped system doesn't follow
> OpRegion 2.1 spec but still stick to OpRegion 2.0, in which the extended
> VBT is not contiguous after OpRegion in physical address, but any
> location pointed by RVDA via absolute address. Also although current
> OpRegion 2.1+ systems appears that the extended VBT follows OpRegion,
> RVDA is the relative address to OpRegion head, the extended VBT location
> may change to non-contiguous to OpRegion. In both cases, it's impossible
> to map a contiguous range to hold both OpRegion and the extended VBT and
> expose via one vfio region.
> 
> The only difference between OpRegion 2.0 and 2.1 is where extended
> VBT is stored: For 2.0, RVDA is the absolute address of extended VBT
> while for 2.1, RVDA is the relative address of extended VBT to OpRegion
> baes, and there is no other difference between OpRegion 2.0 and 2.1.
> To support the non-contiguous region case as described, the updated read
> op will patch OpRegion version and RVDA on-the-fly accordingly. So that
> from vfio igd OpRegion view, only 2.1+ with contiguous extended VBT
> after OpRegion is exposed, regardless the underneath host OpRegion is
> 2.0 or 2.1+. The mechanism makes it possible to support legacy OpRegion
> 2.0 extended VBT systems with on the market, and support OpRegion 2.1+
> where the extended VBT isn't contiguous after OpRegion.
> 
> V2:
> Validate RVDA for 2.1+ before increasing total size. (Alex)
> 
> V3: (Alex)
> Split read and write ops.
> On-the-fly modify OpRegion version and RVDA.
> Fix sparse error on assign value to casted pointer.
> 
> V4: (Alex)
> No need support write op.
> Direct copy to user buffer with several shift instead of shadow.
> Copy helper to copy to user buffer and shift offset.
> 
> V5: (Alex)
> Simplify copy help to only cover common shift case.
> Don't cache patched version and rvda. Patch on copy if necessary.
> 
> V6:
> Fix comment typo and max line width.
> 
> V7:
> Keep bytes to copy/remain as size_t.
> Proper shift byte address on copy source.
> Rebase to linux-next.
> 
> V8:
> Replace min() with min_t() to avoid type cast.
> Wrap long lines.
> 
> Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
> Cc: Hang Yuan <hang.yuan@linux.intel.com>
> Cc: Swee Yee Fonn <swee.yee.fonn@intel.com>
> Cc: Fred Gao <fred.gao@intel.com>
> Signed-off-by: Colin Xu <colin.xu@intel.com>
> ---
>  drivers/vfio/pci/vfio_pci_igd.c | 234 ++++++++++++++++++++++++--------
>  1 file changed, 175 insertions(+), 59 deletions(-)

Looks good, applied to vfio next branch for v5.16.  Thanks,

Alex


  reply	other threads:[~2021-10-12 17:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13  2:13 [PATCH] vfio/pci: Add OpRegion 2.0 Extended VBT support Colin Xu
2021-08-16 22:39 ` Alex Williamson
2021-08-17  0:40   ` Colin Xu
2021-08-27  1:36     ` Colin Xu
2021-08-27  1:48       ` Alex Williamson
2021-08-27  2:24         ` Colin Xu
2021-08-27  2:37           ` [PATCH v2] " Colin Xu
2021-08-30 20:27             ` Alex Williamson
2021-09-02  7:11               ` Colin Xu
2021-09-02 21:46                 ` Alex Williamson
2021-09-03  2:23                   ` Colin Xu
2021-09-03 22:36                     ` Alex Williamson
2021-09-07  6:14                       ` Colin Xu
2021-09-09  5:09                         ` [PATCH v3] vfio/pci: Add OpRegion 2.0+ " Colin Xu
2021-09-09 22:00                           ` Alex Williamson
2021-09-13 12:39                             ` Colin Xu
2021-09-13 12:41                               ` [PATCH v4] " Colin Xu
2021-09-13 15:14                                 ` Alex Williamson
2021-09-14  4:18                                   ` Colin Xu
2021-09-14  4:29                                     ` [PATCH v5] " Colin Xu
2021-09-14  9:11                                       ` [PATCH v6] " Colin Xu
2021-09-24 21:24                                         ` Alex Williamson
2021-10-03 15:46                                           ` Colin Xu
2021-10-03 15:53                                             ` [PATCH v7] " Colin Xu
2021-10-11 21:44                                               ` Alex Williamson
2021-10-12 12:48                                                 ` [PATCH v8] " Colin Xu
2021-10-12 17:12                                                   ` Alex Williamson [this message]
2021-10-12 23:10                                                     ` Colin Xu

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=20211012111248.2314ad0b.alex.williamson@redhat.com \
    --to=alex.williamson@redhat.com \
    --cc=colin.xu@gmail.com \
    --cc=colin.xu@intel.com \
    --cc=fred.gao@intel.com \
    --cc=hang.yuan@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=swee.yee.fonn@intel.com \
    --cc=zhenyuw@linux.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.