From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D30A7C41514 for ; Mon, 19 Aug 2019 16:35:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A96622087E for ; Mon, 19 Aug 2019 16:35:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="hiwyuvmS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727970AbfHSQfY (ORCPT ); Mon, 19 Aug 2019 12:35:24 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:33757 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727857AbfHSQfX (ORCPT ); Mon, 19 Aug 2019 12:35:23 -0400 Received: by mail-qk1-f193.google.com with SMTP id w18so1951245qki.0 for ; Mon, 19 Aug 2019 09:35:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wWW+WA46mKEi0z1RGGxPVBr8fzCCdL8vAuG/5cMy1F4=; b=hiwyuvmSJGL4axK+y4nb7wwhApXBrItaLKtFiHb+0wCYjsLtFYZuCEFAzyksTNfRXd aQgPbRUSU1Em9wYmdmpdvDR5iltt9Ue4rBVxAwXjtVgM8lWHP+vxut3ux1GMtw9nPXYk k9GtyqhNbDP3aZA5l9uUOkH12eWqTHGTrviM/6+RhcinX/7DcF96D0VsgGPvioSmqxoX hTsrLuObX/XO5/qaczj4qvU1EzbJyfzJL1phCIeYPnELZz3P/F77q1V+DyW5SI2y9fmg H3tV3DhL3EaYJfE488xGQcDNQHV7rsUnH+HSDA5UhYsXux7Qy8U8k9puCto8pcIlC9XF PqDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wWW+WA46mKEi0z1RGGxPVBr8fzCCdL8vAuG/5cMy1F4=; b=O1XDYi/oggAWpz842GJ1FD4+fagzM4KcO+16QdkxnDKRMdx5BoREEQxox/Huo6RH1F BS47+AfYQiYfiFNlGaKmh3/5gEzFuZReHZQ+zY3foiyB7uyYvbyQiZnDEJyVo6NArPj1 frx/2kxulSC1zy26U/HZ3M2/jcd2AiwO+x7bD+wmBQ+kM9h7ucr1evJDTSKbKxhdir/K hdSqvTGoVaam6lhNvM5CT0JlGFf/H85dFsW4YfBDZy5ICf9WrgkOMeow2QoXTg7DFxFJ k/Dit6YtNxBRyDihrwG3HkH0ySYR2GKj1bYfD3ZakEhJ72E+jr2utTQLnEOOeqyahDsG ufww== X-Gm-Message-State: APjAAAWAjJN0a1mbtugnYMZRbmv9fxYU9xXP5EWcMgMHb+O3keyJFD8s al/y6bBunl8d573xgu0I6VvI8w== X-Google-Smtp-Source: APXvYqzJgbElB7yz0+C1ekqDDN/YsYJmh53ysWANOEsnqgE9IoWoDgpB8m4UJssvhwOb0BgOwG52vA== X-Received: by 2002:ae9:f203:: with SMTP id m3mr21355477qkg.264.1566232522239; Mon, 19 Aug 2019 09:35:22 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-55-100.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.55.100]) by smtp.gmail.com with ESMTPSA id a21sm7296970qka.113.2019.08.19.09.35.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 09:35:21 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hzkcr-0007hN-Ej; Mon, 19 Aug 2019 13:35:21 -0300 Date: Mon, 19 Aug 2019 13:35:21 -0300 From: Jason Gunthorpe To: Bernard Metzler Cc: Geert Uytterhoeven , Doug Ledford , 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 Message-ID: <20190819163521.GK5058@ziepe.ca> References: <20190819150723.GH5058@ziepe.ca> <20190819141856.GG5058@ziepe.ca> <20190819135213.GF5058@ziepe.ca> <20190819122456.GB5058@ziepe.ca> <20190819100526.13788-1-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 19, 2019 at 04:29:11PM +0000, Bernard Metzler wrote: > > >To: "Bernard Metzler" > >From: "Jason Gunthorpe" > >Date: 08/19/2019 06:05PM > >Cc: "Geert Uytterhoeven" , "Doug Ledford" > >, 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 * ?? > >The code paths here must be totally different, so there should be > >different types and functions for each case. > > Yes, there is a function to process application memory (siw_rx_umem), > to process a kernel PBL (siw_rx_pbl), and one to process kernel > addresses (siw_rx_kva). Before running that function, the API > representation of the current SGE gets translated into target > buffer representation. Why does siw_pbl_get_buffer not return a void *?? Still looks like two types have been crammed together. The kernel can't ever store anything into the user WQE buffer, so I would think it would copy the buffer to kernel space, transform it properly and then refer to it as a kernel buffer. Kernel sourced buffers just skip the transofmration. JAson