Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3031200ybl; Mon, 19 Aug 2019 11:01:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOtn4tUUUwrMUQFKw3MASh03fpucKudHQyVfPSp4Imv64ecuqqiaRCtfRHd+34PBmD3X5F X-Received: by 2002:a62:be04:: with SMTP id l4mr24548101pff.77.1566237700491; Mon, 19 Aug 2019 11:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566237700; cv=none; d=google.com; s=arc-20160816; b=QPFqP2c60lSjPDyNnHVpiM0D/xXXZ3uZEBoXuJmUE3H7XIRkmpqpCq9HDtMWDbZimZ oUcvLpLbx3wPNZ7EcRMBha4Mcws37Qa1UcGEaie91SSY5Pyz4oQI8zmYoBXsfGdcYC3k OzNZjrL4cyvkZFXK9hhrdhTogEG63h4LU89IabC4vXj7T6eoHGPHZjPXWheXDXy6bYT5 SIcuMhlylRo2851zp6FXIWT4nclxzgCE0MuuVrWRjVSe48y5vNfR8n071Z5x0PXgTp9n r9JjfWgxOi9wCdyXJUgtoP3WE4ksLynrLcQLWMZslQhQIiLF2Vo70VFDnAiFiDL5YJxJ o+FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YX9dWce67vABwLMPVlFdUwPq+txr/vXIbVaKy0jpq6Q=; b=hglR6AbgjLoUUJFR4wmAb0D/rpIxyErpHZasTh6Y5mo5snMfsS65D9/b599+EwvKAA 9wdw0qafCBJ0KnTIJYDkL1Ibb4O4VDhhZkaxL8RyP/RdnOqppL7nDs5Ua5yEX2RK/W43 ajdc7Ddxl4JJLN0IEP7JDMr+TgE1IBOvGyVCoYrcHof10IttAh76n0gxKy2W5uOLe+v+ lBnlyuZuCxTwmU9LugkE5K+/3/YJ7eorp29/CZBVPv5vUFdP3pmJOoecxumYx2syqMhd HN3QIrieYwM69G4xks7OA6Qr7zAnjWoqo47FsOvfivtGPUalmvoVHRI+3eEYaDr+ljPG F4zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=EC8zTSso; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h187si10254429pgc.6.2019.08.19.11.01.25; Mon, 19 Aug 2019 11:01:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=EC8zTSso; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728222AbfHSSAG (ORCPT + 99 others); Mon, 19 Aug 2019 14:00:06 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:45973 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726959AbfHSSAG (ORCPT ); Mon, 19 Aug 2019 14:00:06 -0400 Received: by mail-qt1-f195.google.com with SMTP id k13so2853357qtm.12 for ; Mon, 19 Aug 2019 11:00:05 -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=YX9dWce67vABwLMPVlFdUwPq+txr/vXIbVaKy0jpq6Q=; b=EC8zTSsoLTEkyxFiGqCqQniAasskdCwOw6qGr7oEZwlQiV1c3o7hTiG1KwFODgvHX/ f2LEiPVb3/j9t+236x+EKD0dnUG/rrD5K4qSLgnKScUVlcFcOnphBXGgx7ug+3K6uaxs 5UxfOhpR/EoaMvfFDDwLhwIU2KjVu2ZaG2UOOTrFSUvpm5Wkxxolxf5EJYXO3xP0tMiu kAfQ4CGL+ahsm1UGf4cm6GjyTADd7vKfP/0uIFeFB0Tax7D9K3JO/e+xgW8zaJEnWVGB fzM3+W3i+SUtj/zK1hbwQPwQESFtUmKBob6Np+kKBP7V3KOT+mJ6NEEIkXbFPnrFWzAY ETkg== 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=YX9dWce67vABwLMPVlFdUwPq+txr/vXIbVaKy0jpq6Q=; b=uJIw+NfIPiYanCQfFTvvBZA4p937MgSR/P0OckIkozWozft2HwmdBZQonWPgSfzRTF 5VkPmQzis9d7hlMGAlm7Y9EuiLfBiMAVzGQzkdtvlJlBjI+1fWHLaCR8BSKZXBGpGVYS bo5dTGvV3Nqu25zT9k6TeYLTe2cWfIEbw1Ko1CECEW387wpA5s/jOpIRP/rmpPxHfDi9 VXKBwfXSXECx6QiYp5ly9MioGUNanmwQsZvFfgXfm4qF7QI4QI09Q1TW1365zY0B7Wsa s9U+hYG4OAo8UhhkBhLqb7mN1kyoMOfiP6snOUQvlb2Gu3OvEIb36LHXviTKqxj5CALn rfnw== X-Gm-Message-State: APjAAAVw07m0TZqCA1BDY5ICUChD+FsgA62dLDZMsU7J7USRIqCkqRs3 7UknaUmsCG++uKQDFO7aQEst6g== X-Received: by 2002:ac8:41ce:: with SMTP id o14mr21121803qtm.92.1566237604991; Mon, 19 Aug 2019 11:00:04 -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 z18sm5045751qtn.87.2019.08.19.11.00.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Aug 2019 11:00:04 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hzlwq-0000QV-1y; Mon, 19 Aug 2019 15:00:04 -0300 Date: Mon, 19 Aug 2019 15:00:04 -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: <20190819180004.GL5058@ziepe.ca> References: <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 05:39:04PM +0000, Bernard Metzler wrote: > > >To: "Bernard Metzler" > >From: "Jason Gunthorpe" > >Date: 08/19/2019 06:35PM > >Cc: "Geert Uytterhoeven" , "Doug Ledford" > >, 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" > >> >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 * ?? > > 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