Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Du, Changbin" <changbin.du@intel.com>
To: Matthew Auld <matthew.william.auld@gmail.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	intel-gvt-dev@lists.freedesktop.org
Subject: Re: [PATCH v6 10/14] drm/i915/kvmgt: Support setting dma map for huge pages
Date: Tue, 15 May 2018 07:51:49 +0800	[thread overview]
Message-ID: <20180514235149.co3ybtrafurynlar@intel.com> (raw)
In-Reply-To: <CAM0jSHM9CtCCS4=BJhUC97VRWKjibEUwZHvQmKxLBmJ7hD6WHA@mail.gmail.com>

Hi Auld,
Thanks for your review.

On Thu, May 10, 2018 at 03:31:03PM +0100, Matthew Auld wrote:
> On 8 May 2018 at 10:05,  <changbin.du@intel.com> wrote:
> > From: Changbin Du <changbin.du@intel.com>

> > +static int gvt_dma_map_page(struct intel_vgpu *vgpu, unsigned long gfn,
> > +               dma_addr_t *dma_addr, unsigned long size)
> > +{
> > +       struct device *dev = &vgpu->gvt->dev_priv->drm.pdev->dev;
> > +       struct page *page = NULL;
> > +       int ret;
> > +
> > +       ret = gvt_pin_guest_page(vgpu, gfn, size, &page);
> > +       if (ret)
> > +               return ret;
> > +
> >         /* Setup DMA mapping. */
> > -       page = pfn_to_page(pfn);
> > -       *dma_addr = dma_map_page(dev, page, 0, PAGE_SIZE,
> > -                                PCI_DMA_BIDIRECTIONAL);
> > -       if (dma_mapping_error(dev, *dma_addr)) {
> > -               gvt_vgpu_err("DMA mapping failed for gfn 0x%lx\n", gfn);
> > -               vfio_unpin_pages(mdev_dev(vgpu->vdev.mdev), &gfn, 1);
> > -               return -ENOMEM;
> > +       *dma_addr = dma_map_page(dev, page, 0, size, PCI_DMA_BIDIRECTIONAL);
> 
> Do we not need to check if the dma addr we get back is not aligned to
> the requested page-size, where we would then fall back to splitting
> the 2M shadow entry?
AFAIK, our IOMMU driver always allocates size aligned base IOVA. So the dma addr must
align to the requested page-size. Thanks!

-- 
Thanks,
Changbin Du
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-05-14 23:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08  9:05 [PATCH v6 00/14] drm/i915/gvt: Add huge gtt shadowing changbin.du
2018-05-08  9:05 ` [PATCH v6 01/14] drm/i915/gvt: Add new 64K entry type changbin.du
2018-05-08  9:05 ` [PATCH v6 02/14] drm/i915/gvt: Add PTE IPS bit operations changbin.du
2018-05-08  9:05 ` [PATCH v6 03/14] drm/i915/gvt: Handle MMIO GEN8_GAMW_ECO_DEV_RW_IA for 64K GTT changbin.du
2018-05-08  9:05 ` [PATCH v6 04/14] drm/i915/gvt: Detect 64K gtt entry by IPS bit of PDE changbin.du
2018-05-10 15:17   ` Matthew Auld
2018-05-11  2:29     ` Zhenyu Wang
2018-05-08  9:05 ` [PATCH v6 05/14] drm/i915/gvt: Add software PTE flag to mark special 64K splited entry changbin.du
2018-05-08  9:05 ` [PATCH v6 06/14] drm/i915/gvt: Add GTT clear_pse operation changbin.du
2018-05-08  9:05 ` [PATCH v6 07/14] drm/i915/gvt: Split ppgtt_alloc_spt into two parts changbin.du
2018-05-08  9:05 ` [PATCH v6 08/14] drm/i915/gvt: Make PTE iterator 64K entry aware changbin.du
2018-05-08  9:05 ` [PATCH v6 09/14] drm/i915/gvt: Add 64K huge gtt support changbin.du
2018-05-14 20:31   ` Matthew Auld
2018-05-15  0:01     ` Du, Changbin
2018-05-08  9:05 ` [PATCH v6 10/14] drm/i915/kvmgt: Support setting dma map for huge pages changbin.du
2018-05-10 14:31   ` Matthew Auld
2018-05-14 23:51     ` Du, Changbin [this message]
2018-05-08  9:05 ` [PATCH v6 11/14] drm/i915/gvt: Add 2M huge gtt support changbin.du
2018-05-08  9:05 ` [PATCH v6 12/14] drm/i915/gvt: Handle special sequence on PDE IPS bit changbin.du
2018-05-08  9:05 ` [PATCH v6 13/14] drm/i915/gvt: Fix error handling in ppgtt_populate_spt_by_guest_entry changbin.du
2018-05-08  9:05 ` [PATCH v6 14/14] drm/i915: Enable platform support for vGPU huge gtt pages changbin.du
2018-05-16 13:39   ` Joonas Lahtinen
2018-05-08  9:31 ` ✗ Fi.CI.BAT: failure for drm/i915/gvt: Add huge gtt shadowing (rev2) 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=20180514235149.co3ybtrafurynlar@intel.com \
    --to=changbin.du@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=matthew.william.auld@gmail.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