From: Jason Gunthorpe <jgg@ziepe.ca>
To: Bernard Metzler <BMT@zurich.ibm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
Doug Ledford <dledford@redhat.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Re: Re: [PATCH] RDMA/siw: Fix compiler warnings on 32-bit due to u64/pointer abuse
Date: Mon, 19 Aug 2019 12:07:23 -0300 [thread overview]
Message-ID: <20190819150723.GH5058@ziepe.ca> (raw)
In-Reply-To: <OFD7C97688.66331960-ON0025845B.005081B6-0025845B.0051AF67@notes.na.collabserv.com>
On Mon, Aug 19, 2019 at 02:52:13PM +0000, Bernard Metzler wrote:
>
> >To: "Bernard Metzler" <BMT@zurich.ibm.com>
> >From: "Jason Gunthorpe" <jgg@ziepe.ca>
> >Date: 08/19/2019 04:19PM
> >Cc: "Geert Uytterhoeven" <geert@linux-m68k.org>, "Doug Ledford"
> ><dledford@redhat.com>, linux-rdma@vger.kernel.org,
> >linux-kernel@vger.kernel.org
> >Subject: [EXTERNAL] Re: Re: Re: [PATCH] RDMA/siw: Fix compiler
> >warnings on 32-bit due to u64/pointer abuse
> >
> >On Mon, Aug 19, 2019 at 02:15:36PM +0000, Bernard Metzler wrote:
> >>
> >> >To: "Bernard Metzler" <BMT@zurich.ibm.com>
> >> >From: "Jason Gunthorpe" <jgg@ziepe.ca>
> >> >Date: 08/19/2019 03:52PM
> >> >Cc: "Geert Uytterhoeven" <geert@linux-m68k.org>, "Doug Ledford"
> >> ><dledford@redhat.com>, linux-rdma@vger.kernel.org,
> >> >linux-kernel@vger.kernel.org
> >> >Subject: [EXTERNAL] Re: Re: [PATCH] RDMA/siw: Fix compiler
> >warnings
> >> >on 32-bit due to u64/pointer abuse
> >> >
> >> >On Mon, Aug 19, 2019 at 01:36:11PM +0000, Bernard Metzler wrote:
> >> >> >If the value is really a kernel pointer, then it ought to be
> >> >printed
> >> >> >with %p. We have been getting demanding on this point lately in
> >> >RDMA
> >> >> >to enforce the ability to keep kernel pointers secret.
> >> >> >
> >> >> >> - wqe->sqe.sge[0].laddr = (u64)&wqe->sqe.sge[1];
> >> >> >> + wqe->sqe.sge[0].laddr = (uintptr_t)&wqe->sqe.sge[1];
> >> >> >
> >> >> >[..]
> >> >> >
> >> >> >> rv = siw_rx_kva(srx,
> >> >> >> - (void *)(sge->laddr + frx->sge_off),
> >> >> >> + (void *)(uintptr_t)(sge->laddr + frx->sge_off),
> >> >> >> sge_bytes);
> >> >> >
> >> >> >Bernard, this is nonsense, what is going on here with
> >sge->laddr
> >> >that
> >> >> >it can't be a void *?
> >> >> >
> >> >> siw_sge is defined in siw-abi.h. We make the address u64 to keep
> >> >the ABI
> >> >> arch independent.
> >> >
> >> >Eh? How does the siw-abi.h store a kernel pointer? Sounds like
> >kernel
> >> >and user types are being mixed.
> >> >
> >>
> >> siw-abi.h defines the work queue elements of a siw send queue.
> >> For user land, the send queue is mmapped. Kernel or user land
> >> clients write to its send queue when posting work
> >> (SGE: buffer address, length, local key).
> >
> >Should have different types.. Don't want to accidently mix a laddr
> >under user control with one under kernel control.
> >
> Well we have an unsigned 64bit for both user and kernel
> application buffer addresses throughout the rdma stack,
We do not. Kernel addresses are consistenyly void * or dma_addr_t
Most places that consume a data address are using lkeys anyhow, which
does have a lkey & u64, but that u64 is not a application buffer
address, but the IOVA of the lkey, which is very different.
I really have no idea why siw needs to mix kernel VAs with user
pointers, particularly in wqes...
Jason
next prev parent reply other threads:[~2019-08-19 15:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-19 10:05 [PATCH] RDMA/siw: Fix compiler warnings on 32-bit due to u64/pointer abuse Geert Uytterhoeven
2019-08-19 12:24 ` Jason Gunthorpe
2019-08-19 13:36 ` Bernard Metzler
2019-08-19 13:52 ` Jason Gunthorpe
2019-08-19 14:15 ` Bernard Metzler
2019-08-19 14:18 ` Jason Gunthorpe
2019-08-19 14:52 ` Bernard Metzler
2019-08-19 15:07 ` Jason Gunthorpe [this message]
2019-08-19 15:54 ` Bernard Metzler
2019-08-19 16:05 ` Jason Gunthorpe
2019-08-19 16:29 ` Bernard Metzler
2019-08-19 16:35 ` Jason Gunthorpe
2019-08-19 17:39 ` Bernard Metzler
2019-08-19 18:00 ` Jason Gunthorpe
2019-08-19 21:40 ` Bernard Metzler
2019-08-19 22:22 ` Jason Gunthorpe
2019-08-19 16:56 ` Joe Perches
2019-08-19 17:14 ` Geert Uytterhoeven
2019-08-27 14:17 ` David Laight
2019-08-27 17:29 ` Geert Uytterhoeven
2019-08-27 17:46 ` Al Viro
2019-08-27 17:59 ` Geert Uytterhoeven
2019-08-27 18:33 ` Joe Perches
2019-08-28 8:27 ` David Laight
2019-08-19 17:26 ` Bernard Metzler
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=20190819150723.GH5058@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=BMT@zurich.ibm.com \
--cc=dledford@redhat.com \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@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;
as well as URLs for NNTP newsgroup(s).