mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Alex Williamson <alex.williamson@hp.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, Chris Wright <chrisw@sous-sol.org>,
	"Miller, Mike (OS Dev)" <mike.miller@hp.com>
Subject: Re: [PATCH] intel-iommu: Obey coherent_dma_mask for alloc_coherent on	passthrough
Date: Tue, 10 Nov 2009 00:19:59 +0000	[thread overview]
Message-ID: <1257812399.25961.892.camel@macbook.infradead.org> (raw)
In-Reply-To: <1257809524.24450.64.camel@8530w.home>

On Mon, 2009-11-09 at 16:32 -0700, Alex Williamson wrote:
> iommu=off means a feature regression from 2.6.31 and kills support for
> being able to use VT-d for virtualization for a large percentage of
> servers from a major vendor.  I don't think Chris' patches actually
> address this since we don't actually know what the DMA mask is for a
> device until the driver claims it.  How long do we wait before we drop
> the swiotlb? 

With a quirk for the broken device in question, we'll know nice and
early that it's there, and hence that we have to keep swiotlb around.
That fits on top of what Chris is doing relatively well.

>  I think his patch is really intended for the "oops, the
> DMAR is broken, the hardware is bad, I can't init the hardware IOMMU,
> whew we can fallback to swiotlb".

Well, in the case Chris is trying to handle it's not really that the
hardware is bad. It's more that the 'major vendor' of which you speak is
shipping completely crap firmware that hasn't been given _any_ form of
QA. They gave it VT-d support and obviously never once booted a VT-d
capable OS on it.

> > I'm slightly reluctant to put the half-arsed 'try to allocate in the
> > right region for broken devices but without full swiotlb support' option
> > into 2.6.32.
> 
> Since the device also makes use of RMRRs, once we have it in the
> si_domain, we're stuck.  I think that means we needs swiotlb anytime
> we're in passthrough mode.  That's what 2.6.31, can we get it back for
> 2.6.32?  Thanks,

That's what 2.6.31 did on _some_ hardware. It depends on whether you had
hardware or software passthrough. This particular broken device only
ever worked by accident in 2.6.31; it wasn't really by design.

But I suppose as a short-term measure, the patch you posted isn't so
bad. We'll fix it properly in 2.6.32 to use the non-passthrough mode for
devices with an inadequate coherent_dma_mask, and you can provide a
quirk which handles your "speshul" device differently.

We can also debate whether the non-passthrough mode for crap devices
(other than yours) should be to use the IOMMU, or to use swiotlb.

-- 
dwmw2


  reply	other threads:[~2009-11-10  0:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-04 22:59 Alex Williamson
2009-11-06  2:41 ` FUJITA Tomonori
2009-11-06  3:19   ` Alex Williamson
2009-11-06  3:34     ` FUJITA Tomonori
2009-11-06  4:09       ` Alex Williamson
2009-11-09 23:02   ` David Woodhouse
2009-11-09 23:32     ` Alex Williamson
2009-11-10  0:19       ` David Woodhouse [this message]
2009-11-11 15:23     ` [stable][PATCH] PCIe hot-plug for Intel IOMMU Fenghua Yu
2009-11-11 21:27       ` Yinghai Lu
2009-11-28  6:17         ` David Woodhouse
2009-11-12  2:37       ` David Woodhouse
2009-11-12 23:32         ` Yu, Fenghua
2009-11-10  0:46 ` [PATCH] intel-iommu: Obey coherent_dma_mask for alloc_coherent on passthrough David Woodhouse
2009-11-10  1:01   ` David Woodhouse
2009-11-10  1:28     ` Alex Williamson

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=1257812399.25961.892.camel@macbook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=alex.williamson@hp.com \
    --cc=chrisw@sous-sol.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.miller@hp.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

all inboxes | Powered by JetHome®