From: Milton Miller <miltonm@bga.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: cbe-oss-dev@lists.ozlabs.org,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
Greg Kroah-Hartman <gregkh@suse.de>,
Arnd Bergmann <arnd@arndb.de>, Geoff Levand <geoff@infradead.org>,
Sean MacLennan <smaclennan@pikatech.com>,
linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
Will Schmidt <will_schmidt@vnet.ibm.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Nishanth Aravamudan <nacc@us.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
linuxppc-dev@lists.ozlabs.org,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 7/8] powerpc: use the newly added get_required_mask dma_map_ops hook
Date: Thu, 12 May 2011 02:32:37 -0500 [thread overview]
Message-ID: <geert-ps3-iommu@mdm.bga.com> (raw)
In-Reply-To: <BANLkTi=eL9uwvNSdEnY4S=k1kjSgH4Q5xg@mail.gmail.com>
> On Thu, May 12, 2011 at 00:25, Nishanth Aravamudan <nacc@us.ibm.com> wrote:
> > diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
> > index 23083c3..688141c 100644
> > --- a/arch/powerpc/platforms/ps3/system-bus.c
> > +++ b/arch/powerpc/platforms/ps3/system-bus.c
> > @@ -695,12 +695,18 @@ static int ps3_dma_supported(struct device *_dev, u64 mask)
> > return mask >= DMA_BIT_MASK(32);
> > }
> >
> > +static u64 ps3_dma_get_required_mask(struct device *_dev)
> > +{
> > + return DMA_BIT_MASK(32);
>
> Why 32 and not 64?
I based it on the return of ps3_dma_supported, which you can see just
above says anything at or above a 32 bit mask is ok.
I don't really know the platform, but digging a bit deeper, it looks
like this goes to ps3_map_dma in ps3/mm.c. It looks like that translates
the virt to phys to lpar (similar to absolute in iseries), and the
maps it to a bus address by a linear mapping. But no where do I see
mention of a device dma mask (neither in mm.c or system-dev.c (except
for the ps3_dma_supported local), so I assume that 32 bits is sufficient
for any device. It appears to me the code establishs a 1:1 mapping
of all possible memory with no provision for allocating blocks or
checking that a bus address belongs to another memory segment.
Feel free to point out any errors in the above analysis, otherwise
I assume the required mask matches the dma_supported op.
Does the lv1 hypervisor offer more than 4G of memory to the lpar?
milton
next prev parent reply other threads:[~2011-05-12 7:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-11 22:24 [PATCH 0/8] pseries/iommu: bug-fixes and cleanups for dynamic dma windows Nishanth Aravamudan
2011-05-11 22:24 ` [PATCH 1/8] pseries/iommu: add additional checks when changing iommu mask Nishanth Aravamudan
2011-05-11 22:24 ` [PATCH 2/8] pseries/iommu: remove ddw property when destroying window Nishanth Aravamudan
2011-05-11 22:24 ` [PATCH 3/8] pseries/iommu: find windows after kexec during boot Nishanth Aravamudan
2011-05-11 22:25 ` [PATCH 4/8] pseries/iommu: cleanup ddw naming Nishanth Aravamudan
2011-05-11 22:25 ` [PATCH 5/8] powerpc: override dma_get_required_mask by platform hook and ops Nishanth Aravamudan
2011-05-19 7:43 ` Benjamin Herrenschmidt
2011-05-19 17:46 ` Nishanth Aravamudan
2011-05-25 18:47 ` Nishanth Aravamudan
2011-05-11 22:25 ` [PATCH 7/8] powerpc: use the newly added get_required_mask dma_map_ops hook Nishanth Aravamudan
2011-05-12 5:51 ` Geert Uytterhoeven
2011-05-12 7:32 ` Milton Miller [this message]
2011-05-11 22:25 ` [PATCH 8/8] powerpc: tidy up dma_map_ops after adding new hook Nishanth Aravamudan
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=geert-ps3-iommu@mdm.bga.com \
--to=miltonm@bga.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=cbe-oss-dev@lists.ozlabs.org \
--cc=davem@davemloft.net \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=geert@linux-m68k.org \
--cc=geoff@infradead.org \
--cc=gregkh@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nacc@us.ibm.com \
--cc=paulus@samba.org \
--cc=smaclennan@pikatech.com \
--cc=will_schmidt@vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).