Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2769676ybl; Mon, 19 Aug 2019 07:17:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlA/4I3C4+ZYuQtJDxdU4rZ0o7B1HceUK2nQHktQTcFyr4W2sjlcbNJ0KN1XSFMWZF1Dzy X-Received: by 2002:a17:90a:30e6:: with SMTP id h93mr20242611pjb.37.1566224248676; Mon, 19 Aug 2019 07:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566224248; cv=none; d=google.com; s=arc-20160816; b=f62bHZgilvSIgsWr0fjPHx4KjIwXB7Z+YkHlcYMeZCErC0xEwgvPL1c9uI6GlOFQVw SPUtW8whrKJZTzv9FedlC8uyYrRR76ngcppz/zAjYQNg6AgGIqXbbjYfhPcr4He5OBcu K9jZrwz2Y6LSZz/yeEKdA2SA6Vg6mzWduYWqsqZT2RLn8TNYgTPD+hblpWUXgreggvrJ QKv7kwqr3ToG8DF9KRbZ0ick6EoH51jpovaLXPCKzZSxqfcd3FwA0dO+0aNEVnWrfVYw VSA5Cdi4z3zuqme9vHmjigl19KC6sBwfW36qe4y4/D4WbyRv3t1vJ9D2J0GN5rGARcvX yzFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :references:importance:sensitivity:mime-version:date:cc:to:from :subject:in-reply-to; bh=qrEL6Fa6PlEB4WpKeWN40WJsMtFYZntQowWGbhrtQvM=; b=QodaLxh7xXtO2/w+Aky7H7n3avx0bmL6rF8ixSIrUZ1GLEAt7+3+/L6KbfnQQOZT42 2NP3B1gP7gcQm8DKZLGdKHEU84CH1PjFqjizR6/yZUA5pdkM8SF4/u/qPF0AYxeg4DA9 TnmIt3HjxXHWg/PrK5druyYx7W7FVK3A1iDybtVCy+hgrfASLbWgCwu+Or1FJVZR/zL+ n+Q+AefUkDY4e8guGk7mb07PJ5Dqm3BABDs7gKMlVj64R84Jia0JNXp5UC2daIfFOhbb l39sRz2EEXGSMxJlOHYOlG3XdyCHUVAaTiD/XbHlGUmhN4PA0H78qD22oFC2k46k3Agb ukYQ== 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 k9si10297054pfk.285.2019.08.19.07.17.13; Mon, 19 Aug 2019 07:17:28 -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 S1727252AbfHSOPx convert rfc822-to-8bit (ORCPT + 99 others); Mon, 19 Aug 2019 10:15:53 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:30620 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726654AbfHSOPx (ORCPT ); Mon, 19 Aug 2019 10:15:53 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x7JEFZ3W136267 for ; Mon, 19 Aug 2019 10:15:52 -0400 Received: from smtp.notes.na.collabserv.com (smtp.notes.na.collabserv.com [192.155.248.74]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ufuyw3sx5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 19 Aug 2019 10:15:49 -0400 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Mon, 19 Aug 2019 14:15:44 -0000 Received: from us1a3-smtp08.a3.dal06.isc4sb.com (10.146.103.57) by smtp.notes.na.collabserv.com (10.106.227.92) with smtp.notes.na.collabserv.com ESMTP; Mon, 19 Aug 2019 14:15:37 -0000 Received: from us1a3-mail162.a3.dal06.isc4sb.com ([10.146.71.4]) by us1a3-smtp08.a3.dal06.isc4sb.com with ESMTP id 2019081914153630-526618 ; Mon, 19 Aug 2019 14:15:36 +0000 In-Reply-To: <20190819135213.GF5058@ziepe.ca> Subject: Re: Re: Re: [PATCH] RDMA/siw: Fix compiler warnings on 32-bit due to u64/pointer abuse 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:15:36 +0000 MIME-Version: 1.0 Sensitivity: Importance: Normal X-Priority: 3 (Normal) References: <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-LLNOutbound: False X-Disclaimed: 45899 X-TNEFEvaluated: 1 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset=UTF-8 x-cbid: 19081914-3165-0000-0000-000000B78A98 X-IBM-SpamModules-Scores: BY=0.002883; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.40962; ST=0; TS=0; UL=0; ISC=; MB=0.000027 X-IBM-SpamModules-Versions: BY=3.00011618; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000287; SDB=6.01249093; UDB=6.00659363; IPR=6.01030620; MB=3.00028233; MTD=3.00000008; XFM=3.00000015; UTC=2019-08-19 14:15:42 X-IBM-AV-DETECTION: SAVI=unsuspicious REMOTE=unsuspicious XFE=unused X-IBM-AV-VERSION: SAVI=2019-08-19 08:30:55 - 6.00010303 x-cbparentid: 19081914-3166-0000-0000-00001BBF9869 Message-Id: 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 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). Thanks, Bernard.