From: Michael Ellerman <mpe@ellerman.id.au>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>,
Hari Bathini <hbathini@linux.vnet.ibm.com>,
Gavin Shan <gwshan@linux.vnet.ibm.com>,
Ben Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
David Gibson <david@gibson.dropbear.id.au>,
Wei Yang <weiyang@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc/powernv/pci-ioda: fix 32-bit TCE table init in kdump kernel
Date: Fri, 04 Sep 2015 20:03:49 +1000 [thread overview]
Message-ID: <1441361029.3777.2.camel@ellerman.id.au> (raw)
In-Reply-To: <55E912E0.1000602@ozlabs.ru>
On Fri, 2015-09-04 at 13:41 +1000, Alexey Kardashevskiy wrote:
> On 09/03/2015 07:58 PM, Michael Ellerman wrote:
> > On Wed, 2015-09-02 at 08:39 -0700, Nishanth Aravamudan wrote:
> >> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
> >> index 85cbc96eff6c..e51aff01a218 100644
> >> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> >> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> >> @@ -2077,10 +2077,17 @@ static long pnv_pci_ioda2_setup_default_config(struct pnv_ioda_pe *pe)
> >> {
> >> struct iommu_table *tbl = NULL;
> >> long rc;
> >> + /*
> >> + * In memory constrained environments, e.g. kdump kernel, the
> >> + * DMA window can be larger than available memory, which will
> >> + * cause errors later.
> >> + */
> >> + const __u64 window_size =
> >
> > Why is this using __u64 and not u64, it's not exported to userspace.
> >
> > It looks like pnv_pci_ioda2_create_table() uses __u64, but there's no reason
> > for that AFAICS either. And yes I did commit it so it's my fault :)
>
> There is VFIO_IOMMU_SPAPR_TCE_CREATE ioctl which receives
> vfio_iommu_spapr_tce_create struct from the user space and there is "__u64
> window_size" which is passed across:
> tce_iommu_create_window()
> tce_iommu_create_table()
> pnv_pci_ioda2_create_table (via table_group->ops->create_table())
>
> At what point should __u64 have become u64?
As soon as it was pulled out of the struct. So here:
ret = tce_iommu_create_window(container, create.page_shift,
create.window_size, create.levels,
&create.start_addr);
ie, instead of:
static long tce_iommu_create_window(struct tce_container *container,
__u32 page_shift, __u64 window_size, __u32 levels,
__u64 *start_addr)
this:
static long tce_iommu_create_window(struct tce_container *container,
u32 page_shift, u64 window_size, u32 levels,
u64 *start_addr)
cheers
next prev parent reply other threads:[~2015-09-04 10:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-02 1:11 [PATCH] powerpc/powernv/pci-ioda: fix 32-bit TCE table init in kdump kernel Nishanth Aravamudan
2015-09-02 9:00 ` Alexey Kardashevskiy
2015-09-02 15:39 ` [PATCH v2] " Nishanth Aravamudan
2015-09-03 9:58 ` Michael Ellerman
2015-09-03 15:59 ` Nishanth Aravamudan
2015-09-04 9:57 ` Michael Ellerman
2015-09-04 3:41 ` Alexey Kardashevskiy
2015-09-04 10:03 ` Michael Ellerman [this message]
2015-09-08 12:05 ` [v2] " Michael Ellerman
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=1441361029.3777.2.camel@ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=aik@ozlabs.ru \
--cc=benh@kernel.crashing.org \
--cc=david@gibson.dropbear.id.au \
--cc=gwshan@linux.vnet.ibm.com \
--cc=hbathini@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nacc@linux.vnet.ibm.com \
--cc=paulus@samba.org \
--cc=weiyang@linux.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).