From: Chris Wright <chrisw@sous-sol.org>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: chrisw@sous-sol.org, dwmw2@infradead.org,
iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/3] allow fallback to swiotlb on hw iommu init failures
Date: Fri, 23 Oct 2009 23:57:12 -0700 [thread overview]
Message-ID: <20091024065712.GC14926@sequoia.sous-sol.org> (raw)
In-Reply-To: <20091024120633Z.fujita.tomonori@lab.ntt.co.jp>
* FUJITA Tomonori (fujita.tomonori@lab.ntt.co.jp) wrote:
> On Fri, 23 Oct 2009 09:39:23 -0700
> Chris Wright <chrisw@sous-sol.org> wrote:
>
> > > The concept sounds fine but the third patch doesn't look correct.
> > >
> > > Seems that the third patch doesn't take into account enabling both hw
> > > iommu and swiotlb (Calgary does and I guess VT-d and AMD need that
> > > too).
> >
> > VT-d isn't using swiotlb. Nor is AMD, although I think it will pick up
> > no_iommu on passthrough (seems like it would benefit from swiotlb in
> > that case).
>
> I think that they need swiotlb for the same reason why Calgray needs
> it. IIRC, someone in VT-d camp said so.
Right, it was used as fallback for a bit when pass through mode was
first enabled to handle case where device has dma mask smaller than
physical memory. That was removed, it was just recently w/ Alex's
comments that the idea of putting it back came up.
> > > Also (iommu_detected && !dma_ops) trick doesn't work for
> > > Calgary, IIRC.
> >
> > Yes, I think you are right. I had stared at the calgary code and thought
> > it would DTRT due to calgary's use of no_iommu as fallback, but instead
> > it will never pick up swiotlb_dma_ops.
>
> Note that Calgary comment 'falling back to no_iommu' is misleading. It
> actually falls back to swiotlb or nommu properly.
>
> Calgary doesn't set to dma_ops to calgary_dma_ops so it doesn't need
> to pick up swiotlb_dma_ops.
It does need swiotlb_dma_ops even when calgary init succeeds for the devices
that aren't behind Calgary to deal w/ the case of those devices having
dma mask smaller than physical memory (i.e those that don't get device
specific dma_ops set to calgary_dma_ops). So, the problem with this
patch is that it would fall back to nommu_dma_ops in cases where it was
expecting to fall back to swiotlb.
> > The calgary shouldn't even need to be manually setting up
> > nommu_dma_ops.
>
> Yeah, but it needs because of how the dma startup code works.
Be much better to have the core handle all of this. Basically register
ops and then put the top one on the stack to actual use. So the
fallback would be automatic, just pick the top of the stack and go.
Were you thinking of something along those lines?
thanks,
-chris
next prev parent reply other threads:[~2009-10-24 6:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-23 1:21 [RFC PATCH 0/3] allow fallback to swiotlb on hw iommu init failures Chris Wright
2009-10-23 1:21 ` [RFC PATCH 1/3] [RFC PATCH] bootmem: refactor free_all_bootmem_core Chris Wright
2009-10-23 1:22 ` [RFC PATCH 2/3] [RFC PATCH] bootmem: add free_bootmem_late Chris Wright
2009-10-23 1:22 ` [RFC PATCH 3/3] [RFC PATCH] iommu: allow fallback to swiotlb upon hw iommu initialization failure Chris Wright
2009-10-23 5:51 ` [RFC PATCH 0/3] allow fallback to swiotlb on hw iommu init failures FUJITA Tomonori
2009-10-23 16:39 ` Chris Wright
2009-10-24 3:06 ` FUJITA Tomonori
2009-10-24 6:57 ` Chris Wright [this message]
2009-10-28 6:53 ` FUJITA Tomonori
2009-10-26 7:10 ` Andi Kleen
2009-10-26 16:26 ` Chris Wright
2009-10-26 21:56 ` Andi Kleen
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=20091024065712.GC14926@sequoia.sous-sol.org \
--to=chrisw@sous-sol.org \
--cc=dwmw2@infradead.org \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.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