Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4741342rwb; Mon, 21 Nov 2022 11:14:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf4fLBVqUi/ubW1UFlb6FMzsQoIqS2bhJEeENUE81vqyLx8t2wp9VH/BNMiS+vfyjoLYXbH2 X-Received: by 2002:a17:90a:d34d:b0:218:a0ce:9d5e with SMTP id i13-20020a17090ad34d00b00218a0ce9d5emr10678293pjx.96.1669058093957; Mon, 21 Nov 2022 11:14:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669058093; cv=none; d=google.com; s=arc-20160816; b=G+Qv1OfXu8bg35xITcvAKBA3/q134d7fGaTKRlmjvYQhclL/USMzTvbv+NPjt0VQph 22X+jEoDhdQ5A9PdVV4UFiMsJol2SmPWD1W3WBiuxiymHXO1C1qhdCFzOAShZmmPtgfR tU2tgv7hDEVGnxpFQILmxiDAMQYt8Mup1jmP15/BCWrMYn2Ws7ka9sW6lgvucqljyrEy /3vvTA9XoqehYPCovcrJtCVCt1Hi2TumR2ezwnc+dev/ORS9t0AEIIANDG8hRm6Ax7Z7 3cEITqTZZhBNiqqgEUbvoPlrAY/t3cGc2OMU5JgUX45tENH2JTS7KlkuadXlytf6XV9o CxAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=F3RGtc3hwYzfdRXPootOnNmarmPw3yS/xesmREyhZ8U=; b=nkHunCf9qNT8oLExFI+rTJR2564gFXWyrb1Ut+src/OJ94Vpvy4iV0l76t1KNOu2kq T4XN0MXQH45i322s4SRQcd+6ZcgzEZ1EXnpCI0YsNt5CZxUQzk7ID4y/FIzRnvpryEe0 7sRTKft424oXxZNBT/nTn6TaTvMUd7VGJUiW5g8lJHl0fusBWVcx3AYqGKfSq16mGeX/ ohDKCzPOtuW4s/vFaH90dcZgM8AfVJOCcb37D6iL3MNlrg/47Vg0NvoNhHsh7KxZME5S pAl+fJlzfjYj4LUC+0F8vYEZumgs9VtAFtN8q/vrwehjk+ZmYTK4hPpYzLERpDVd9Zia 6n5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=i9Cj0cnu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b2-20020a056a00114200b00557eeeb099csi12530675pfm.339.2022.11.21.11.14.41; Mon, 21 Nov 2022 11:14:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=i9Cj0cnu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbiKUSyA (ORCPT + 91 others); Mon, 21 Nov 2022 13:54:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbiKUSx6 (ORCPT ); Mon, 21 Nov 2022 13:53:58 -0500 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 090ED2A25D for ; Mon, 21 Nov 2022 10:53:57 -0800 (PST) Received: by mail-qt1-x82d.google.com with SMTP id s4so7862947qtx.6 for ; Mon, 21 Nov 2022 10:53:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=F3RGtc3hwYzfdRXPootOnNmarmPw3yS/xesmREyhZ8U=; b=i9Cj0cnu73KzMvbiv9kVOA678kptYbCMN6jfQsgdxPJCC1cb1KUs3RzzQkAiIn9bnw /ix8P2GC1eKOesG/hViOqu6yAm6KMYa0qL5WPdmi09xBCVj+wY0e9r9ZPbafHIiDp5vc smkG3aZY/j3jb0w5RbYVE75kTGC5uI8pVPdyn5UvVBmemHWhQtk0ePd128c6tF+jcrdZ J8fYb9yGwJ/o9z4m2K+gIbB7Ck205MMyvpEODzVcFLbhPvkR4iOA3CLE0evQXWUp3jIO A/RPUgbAuCpsWL5ZeB3aXfuOkn7wjlTo97nEWJiwcPK+cG/Yp+PFf9ITm0RQC4iOINUJ bg9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=F3RGtc3hwYzfdRXPootOnNmarmPw3yS/xesmREyhZ8U=; b=TZDUoIPAJB6dS1vu4PnvkL/wp7cUAI0fUxIKe2Qo6EMTUEOqCj1PaM1KCS2nuDsS/d Hqg6vWzmgDA8rpV7cGPBOleqQumvzUnP86p1rAoS99P0aVp3Rqyz7qLd/dWjAcWIkSLH 4XAdLOR/gILNv52oD/6q2A0pVOYgVHkWw2vGbCrLiNRRDhEgswfhWcgOSfpWh1HmfYtW 5kzLWmBYnV9bSjz0PC1L4KlYiL6NaQ2PCwpV4WfkkYfqVBygiEhMLupVkAmhNd332Smj 2T6MnxjEXZTaVF4wuR0kjIOAijdAHmFcfP97peStD862dlD5eZJMU+QbRnxilN/WgtZV s/PQ== X-Gm-Message-State: ANoB5plTdY4ikvRS3VG/efIOtlDB+T6OlGcnzk7nX/IaEE+PZ/ZMHJF2 5WMCJiPilc2RBVHdnmn8zgE3WQ== X-Received: by 2002:ac8:7513:0:b0:3a5:4442:80fa with SMTP id u19-20020ac87513000000b003a5444280famr5160955qtq.233.1669056836189; Mon, 21 Nov 2022 10:53:56 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-47-55-122-23.dhcp-dynamic.fibreop.ns.bellaliant.net. [47.55.122.23]) by smtp.gmail.com with ESMTPSA id y19-20020a05620a44d300b006f9f3c0c63csm9056145qkp.32.2022.11.21.10.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 10:53:54 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1oxBvW-009M8u-0v; Mon, 21 Nov 2022 14:53:54 -0400 Date: Mon, 21 Nov 2022 14:53:54 -0400 From: Jason Gunthorpe To: "Fabio M. De Francesco" Cc: Li Zhijian , Zhu Yanjun , Leon Romanovsky , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Ira Weiny Subject: Re: [for-next PATCH 4/5] RDMA/rxe: refactor iova_to_vaddr Message-ID: References: <1668141030-2-1-git-send-email-lizhijian@fujitsu.com> <1668141030-2-5-git-send-email-lizhijian@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 16, 2022 at 01:37:14PM +0100, Fabio M. De Francesco wrote: > > - return (void *)(uintptr_t)mr->map[m]->buf[n].addr + offset; > > + if (mr->ibmr.type == IB_MR_TYPE_USER) { > > + char *paddr; > > + struct page *pg = mr->map[m]->buf[n].page; > > + > > + paddr = kmap_local_page(pg); > > + if (paddr == NULL) { > > + pr_warn("Failed to map page"); > > + return NULL; > > + } > > I know nothing about this code but I am here as a result of regular checks for > changes to HIGHMEM mappings across the entire kernel. So please forgive me if > I'm objecting to the correct changes. > > 1) It looks like this code had a call to page_address() and you converted it > to mapping with kmap_local_page(). It only worked properly because the kconfig is blocking CONFIG_HIGHMEM so ZONE_HIGHMEM doesn't exist. These pages are obtained from GUP and could be anything. This is done indirectly through config INFINIBAND_VIRT_DMA def_bool !HIGHMEM But this patch is undoing parts of what are causing that restriction by using the proper APIs. Though I'm not sure if we can eventually get to remove it for RXE completely. Jason