qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: iommu@lists.linux-foundation.org, chegu_vinod@hp.com,
	qemu-devel@nongnu.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH 2/2] vfio: hugepage support for vfio_iommu_type1
Date: Sat, 25 May 2013 08:23:48 -0600	[thread overview]
Message-ID: <1369491828.2646.155.camel@ul30vt.home> (raw)
In-Reply-To: <20130525112009.GC2418@localhost.localdomain>

On Sat, 2013-05-25 at 07:20 -0400, Konrad Rzeszutek Wilk wrote:
> > + * Turns out AMD IOMMU has a page table bug where it won't map large pages
> > + * to a region that previously mapped smaller pages.  This should be fixed
> > + * soon, so this is just a temporary workaround to break mappings down into
> > + * PAGE_SIZE.  Better to map smaller pages than nothing.
> > + */
> > +static int map_try_harder(struct vfio_iommu *iommu, dma_addr_t iova,
> > +			  unsigned long pfn, long npage, int prot)
> > +{
> > +	long i;
> > +	int ret;
> > +
> > +	for (i = 0; i < npage; i++, pfn++, iova += PAGE_SIZE) {
> > +		ret = iommu_map(iommu->domain, iova,
> > +				(phys_addr_t)pfn << PAGE_SHIFT,
> > +				PAGE_SIZE, prot);
> > +		if (ret)
> > +			break;
> > +	}
> > +
> > +	for (; i < npage && i > 0; i--, iova -= PAGE_SIZE)
> > +		iommu_unmap(iommu->domain, iova, PAGE_SIZE);
> > +
> >  	return ret;
> >  }
> 
> This looks to belong to a vfio-quirk file (a something else) that deals with
> various IOMMU's quirks.

This is a software bug in amd_iommu, which Joerg knows about, so I'm
hoping this is a short lived quirk.  I dropped it here for convenience,
but I expect to be able to remove it before long.  If we find some
hardware quirks, I expect we'd want the quirks in the drivers themselves
so the consumers, like vfio, don't need to worry about them.  Thanks,

Alex

  reply	other threads:[~2013-05-25 14:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-24 17:24 [Qemu-devel] [PATCH 0/2] vfio: type1 iommu hugepage support Alex Williamson
2013-05-24 17:24 ` [Qemu-devel] [PATCH 1/2] vfio: Convert type1 iommu to use rbtree Alex Williamson
2013-05-24 17:24 ` [Qemu-devel] [PATCH 2/2] vfio: hugepage support for vfio_iommu_type1 Alex Williamson
2013-05-25 11:20   ` Konrad Rzeszutek Wilk
2013-05-25 14:23     ` Alex Williamson [this message]
2013-05-27  8:41   ` Sethi Varun-B16395
2013-05-27 13:37     ` Alex Williamson
2013-05-25 11:21 ` [Qemu-devel] [PATCH 0/2] vfio: type1 iommu hugepage support Konrad Rzeszutek Wilk
2013-05-25 14:39   ` Alex Williamson
2013-05-28 16:27 ` [Qemu-devel] [PATCH 3/2] vfio: Provide module option to disable vfio_iommu_type1 " Alex Williamson
2013-05-28 16:42   ` Konrad Rzeszutek Wilk
2013-05-31  2:33   ` Chegu Vinod

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=1369491828.2646.155.camel@ul30vt.home \
    --to=alex.williamson@redhat.com \
    --cc=chegu_vinod@hp.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).