linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Re: Re: [PATCH] RDMA/siw: Fix compiler warnings on 32-bit due to u64/pointer abuse
Date: Mon, 19 Aug 2019 15:00:04 -0300	[thread overview]
Message-ID: <20190819180004.GL5058@ziepe.ca> (raw)
In-Reply-To: <OF0F37B635.09509188-ON0025845B.005BF4A4-0025845B.0060F5F0@notes.na.collabserv.com>

On Mon, Aug 19, 2019 at 05:39:04PM +0000, Bernard Metzler wrote:
> 
> >To: "Bernard Metzler" <BMT@zurich.ibm.com>
> >From: "Jason Gunthorpe" <jgg@ziepe.ca>
> >Date: 08/19/2019 06:35PM
> >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: Re: Re: [PATCH] RDMA/siw: Fix
> >compiler warnings on 32-bit due to u64/pointer abuse
> >
> >On Mon, Aug 19, 2019 at 04:29:11PM +0000, Bernard Metzler wrote:
> >> 
> >> >To: "Bernard Metzler" <BMT@zurich.ibm.com>
> >> >From: "Jason Gunthorpe" <jgg@ziepe.ca>
> >> >Date: 08/19/2019 06:05PM
> >> >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: Re: [PATCH] RDMA/siw: Fix compiler
> >> >warnings on 32-bit due to u64/pointer abuse
> >> >
> >> >On Mon, Aug 19, 2019 at 03:54:56PM +0000, Bernard Metzler wrote:
> >> >
> >> >> Absolutely. But these addresses are conveyed through the
> >> >> API as unsigned 64 during post_send(), and land in the siw
> >> >> send queue as is. During send queue processing, these addresses
> >> >> must be interpreted according to its context and transformed
> >> >> (casted) back to the callers intention. I frankly do not
> >> >> know what we can do differently... The representation of
> >> >> all addresses as unsigned 64 is given. Sorry for the confusion.
> >> >
> >> >send work does not have pointers in it, so I'm confused what this
> >is
> >> >about. Does siw allow userspace to stick an ordinary pointer for
> >the
> >> >SG list?
> >> 
> >> Right a user references a buffer by address and local key it
> >> got during reservation of that buffer. The user can provide any
> >> VA between start of that buffer and registered length. 
> >
> >Oh gross, it overloads the IOVA in the WR with a kernel void * ??
> 
> Oh no. The user library writes the buffer address into
> the 64bit address field of the WR. This is nothing siw
> has invented.

No HW provider sticks pointers into the WR ring.

It is either an iova & lkey pair, or SGE information is inlined into
the WR ring.

Never, ever, a user or kernel pointer.

The closest we get to a kernel pointer is with the local dma lkey &
iova == physical memory address.

> >Why does siw_pbl_get_buffer not return a void *??
>
> 
> I think, in fact, it should be dma_addr_t, since this is
> what PBL's are described with. Makes sense?

You mean because siw uses dma_virt_ops and can translate a dma_addr_t
back to a pfn? Yes, that would make alot more sense.

If all conversions went explicitly from a iova & lkey -> dma_addr_t -> void * in
the kmap then I'd be a lot happier

Jason

  reply	other threads:[~2019-08-19 18:00 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
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 [this message]
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=20190819180004.GL5058@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).