Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2813452ybl; Mon, 19 Aug 2019 07:53:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmI9jATRVaprcSOf6YHQx5xIKrGiT1/JMdB4KCRNrb/2mwr7RzQO0hv3JI179J/2w3UJ1g X-Received: by 2002:a17:90a:8990:: with SMTP id v16mr9376725pjn.97.1566226427410; Mon, 19 Aug 2019 07:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566226427; cv=none; d=google.com; s=arc-20160816; b=axsbxpg3JRUQQ/i1XcWI5YBEemBqWs2EIipjXLeA+LFVD0tjWdwiQ0lWhB3yZFIizG mzQz5jdPFbgYWN4aPAuC3+MTSHdpiXQWeNIJkiHXzEEJD9Rfet1VNXtwAKIDD5jqD2RY ajXnNh2tuk4OZvxH0qCnDcJPRzmC9EU1aoSeAcAaUX1/m3bZP68moaDEG/i13n7chncn XNuVg7/YBjxvQmqBUxDmUtCTGlpwy1FPJZKdvcejSMc2NoEABzfo7R2tS8Neye0YSj/J e+BI70FTnHx6wa5IUJHwjsQARnxu3umpzBEKvGZghgGScmLFQ48Wb4fjDQT/hI9CUUtC WLFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:message-id :content-transfer-encoding:references:importance:sensitivity :mime-version:date:cc:to:from:in-reply-to; bh=1AhFIuhqtEjJA8duhEABuQkyD/UwvxWqOVA5eP4vXZM=; b=0ZkcRxiIC3umNedxeJw5984+5zFSuFgLZZZon7ySgUCfHBaVf4DZQQY4bHJJC86BPO 4f4ay8CC794PlftoIsSuCWgZkc/EvOFrnOjCr8ZNIehFj3QYwhGLMsE/oHfqzMxY8g23 qGPnLhAtdXecXAKSngXxd/yIo6DMDYFPruPzQ/1sxSZnVBYs+gtImo3OJ3BEzp05Hq8Z FWb9qF2U7PYw9044MwC7XQUhMgJ7oQ3QFHok5J0UZ672PVB66UwpCuH03BXTyZ+puw0W paZQnAG/BFah0ouDsVyzsIAwtGyZxhvIzvkMuv9y6+1fo2IN63SW2ZkkjsYHmy9/XKwJ Y7sQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13si9966802pgs.275.2019.08.19.07.53.32; Mon, 19 Aug 2019 07:53:47 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbfHSOwW convert rfc822-to-8bit (ORCPT + 99 others); Mon, 19 Aug 2019 10:52:22 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37942 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725536AbfHSOwV (ORCPT ); Mon, 19 Aug 2019 10:52:21 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7JEq6Wq067578 for ; Mon, 19 Aug 2019 10:52:20 -0400 Received: from smtp.notes.na.collabserv.com (smtp.notes.na.collabserv.com [158.85.210.119]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ufwdf1cbk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 19 Aug 2019 10:52:20 -0400 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Mon, 19 Aug 2019 14:52:19 -0000 Received: from us1b3-smtp04.a3dr.sjc01.isc4sb.com (10.122.203.161) by smtp.notes.na.collabserv.com (10.122.182.123) with smtp.notes.na.collabserv.com ESMTP; Mon, 19 Aug 2019 14:52:13 -0000 Received: from us1b3-mail162.a3dr.sjc03.isc4sb.com ([10.160.174.187]) by us1b3-smtp04.a3dr.sjc01.isc4sb.com with ESMTP id 2019081914521259-552925 ; Mon, 19 Aug 2019 14:52:12 +0000 In-Reply-To: <20190819141856.GG5058@ziepe.ca> From: "Bernard Metzler" To: "Jason Gunthorpe" Cc: "Geert Uytterhoeven" , "Doug Ledford" , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 19 Aug 2019 14:52:13 +0000 MIME-Version: 1.0 Sensitivity: Importance: Normal X-Priority: 3 (Normal) References: <20190819141856.GG5058@ziepe.ca>,<20190819135213.GF5058@ziepe.ca> <20190819122456.GB5058@ziepe.ca> <20190819100526.13788-1-geert@linux-m68k.org> X-Mailer: IBM iNotes ($HaikuForm 1054) | IBM Domino Build SCN1812108_20180501T0841_FP55 May 22, 2019 at 11:09 X-KeepSent: D7C97688:66331960-0025845B:005081B6; type=4; name=$KeepSent X-LLNOutbound: False X-Disclaimed: 50467 X-TNEFEvaluated: 1 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=UTF-8 x-cbid: 19081914-3975-0000-0000-0000002860CD X-IBM-SpamModules-Scores: BY=0.002883; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.399202; ST=0; TS=0; UL=0; ISC=; MB=0.000418 X-IBM-SpamModules-Versions: BY=3.00011618; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000287; SDB=6.01249103; UDB=6.00659369; IPR=6.01030631; MB=3.00028233; MTD=3.00000008; XFM=3.00000015; UTC=2019-08-19 14:52:17 X-IBM-AV-DETECTION: SAVI=unsuspicious REMOTE=unsuspicious XFE=unused X-IBM-AV-VERSION: SAVI=2019-08-19 13:50:22 - 6.00010304 x-cbparentid: 19081914-3976-0000-0000-0000003F7252 Message-Id: Subject: RE: Re: Re: [PATCH] RDMA/siw: Fix compiler warnings on 32-bit due to u64/pointer abuse X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-19_03:,, signatures=0 X-Proofpoint-Spam-Reason: safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org -----"Jason Gunthorpe" wrote: ----- >To: "Bernard Metzler" >From: "Jason Gunthorpe" >Date: 08/19/2019 04:19PM >Cc: "Geert Uytterhoeven" , "Doug Ledford" >, 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" >> >From: "Jason Gunthorpe" >> >Date: 08/19/2019 03:52PM >> >Cc: "Geert Uytterhoeven" , "Doug Ledford" >> >, 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, and we have it on the wire for all transports as well. Why do we want to have it differently for the siw driver? Thanks and best regards Bernard.