mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@hp.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH] intel-iommu: Obey coherent_dma_mask for alloc_coherent on passthrough
Date: Mon, 09 Nov 2009 18:28:34 -0700	[thread overview]
Message-ID: <1257816514.2867.88.camel@2710p.home> (raw)
In-Reply-To: <1257814906.25961.916.camel@macbook.infradead.org>

On Tue, 2009-11-10 at 01:01 +0000, David Woodhouse wrote:
> On Tue, 2009-11-10 at 00:46 +0000, David Woodhouse wrote:
> > 
> >         if (iommu_no_mapping(hwdev))
> > -               return paddr;
> > +               return paddr > dma_mask - size ? 0 : paddr; 
> 
> Hm, that's still wrong. If your mask is 0xffffffff and you map
> 0xfffff000 + 0x1000, that should be allowed, right? How about:
> 
> 	return paddr <= dma_mask - size + 1 ? paddr : 0;

Ok, I was going to suggest that there was probably a -1 missing from my
patch.  I'd also be surprised if you could actually get a paddr + size -
1 from a single allocation that would wrap.  Would a device even be able
to handle that for DMA?

> And is this strictly necessary as part of the patch we're discussing?

Yeah, we could probably do without it.  As for the commit comment, it's
rather scathing, but I can live with it.  Thanks,

Alex


      reply	other threads:[~2009-11-10  1:28 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
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 [this message]

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=1257816514.2867.88.camel@2710p.home \
    --to=alex.williamson@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=dwmw2@infradead.org \
    --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

all inboxes | Powered by JetHome®