From patchwork Thu Sep 27 10:10:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 147699 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp1799843lji; Thu, 27 Sep 2018 03:10:42 -0700 (PDT) X-Google-Smtp-Source: ACcGV60/AyMMFMlulrUDfHv331+RahIReVuETYLE70NV3Xqb4wSjSIlQ3azqCb+aBLuZ2IaaunN3 X-Received: by 2002:a63:5955:: with SMTP id j21-v6mr9267724pgm.210.1538043042086; Thu, 27 Sep 2018 03:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538043042; cv=none; d=google.com; s=arc-20160816; b=pVGKFdJwb58Mm21E3h1NglEPy+boVEhSfyXhjKQnlNoZhOYv62nfRwXoKtWJVgEfqd OkA5AMKKspbY9/ec3DlxgeZJrt/EiquU8RUVKRXgx6kYUbZlC9CjKiFvTyBa3MJuSqh+ bK+xwDk2umfkNDIO/p5Gr9/sSF14+V0yJTBRTa7G0p9wUWw1xatAhT9BVsjYmK+9syHz Y6nZ5Qqha+j4XF0v8vP8La81oYK0H+AbkO9u+LXQBxkZmNAhLJIncH40CH8yK+AcgjUr q5KBjeE6u6FzugCGjLqcvqwE4HGb6hhibJ9IxWOaeNDBOpImT7yDmsDRrCcC76+oAVeb J4uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=8fu+3BrAHpmkdOBkYTS0A7PIXYz6S/k3PAtRArHdAIU=; b=vJ9R8C+qRfjWe6iVT6/JpGv0IhKf4vRW+TlXJ8+G35ybAp+0TAz+VCPhkJSWQIo55i O83waXU2fyZdaHuRe9wSGiRCwCeZNMrAHqREgZCYlHxzl0niXqYq2iwgeO4v/q3Vy3vq xjawniC54RqR0DlOX3qE14+TfrDqIcO6FPD4/vjX8xp9s7pZl2ZRG2Tlin9DidjqgbwM /yx0GLGR7rHjr7FuLI3ZEjlPXwuf3QpfM+JVbvKSmd91vGrbGimXLXwdW5Jq9C5gQRUH L8hM1zOTGtJwvdPc1pQBfFhYQ6Awyxi9C/6hTRR/6e6/9NMd7qmqiSH9M4mJXsfx2yRx GbtA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13-v6si1671884pgm.676.2018.09.27.03.10.41; Thu, 27 Sep 2018 03:10:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbeI0Q2J (ORCPT + 32 others); Thu, 27 Sep 2018 12:28:09 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:42833 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727187AbeI0Q2J (ORCPT ); Thu, 27 Sep 2018 12:28:09 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1MirfG-1fZRp10R0e-00ey8H; Thu, 27 Sep 2018 12:10:19 +0200 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.145]) with ESMTPA (Nemesis) id 1MirfG-1fZRp10R0e-00ey8H; Thu, 27 Sep 2018 12:10:19 +0200 From: Arnd Bergmann To: Jason Gunthorpe Cc: Arnd Bergmann , Doug Ledford , Leon Romanovsky , Matan Barak , Parav Pandit , "Wei Hu(Xavier)" , Huy Nguyen , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] RDMA/ucontext: fix building with CONFIG_MMU=n Date: Thu, 27 Sep 2018 12:10:03 +0200 Message-Id: <20180927101017.990471-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:3BtBNrFcgwoEjYfk6eNDJwm3+KhEaGLVUDVgNMa9+XQ6NIwC2St QCAIqGeIzNE+ZiXAtigG/qgXfkNKAGWELR9NfVI5u/Td2Zwommt5zazWLc0kGNzCxtdyEXH HvqDsUrlTaEujgIT95fGcKuy8boAIPcV4MFs57pMEM1IaB7VGgG0UXFhSiq7U+9AWxtf4I8 87IXwlyaOB21ZN/3VO8sA== X-UI-Out-Filterresults: notjunk:1; V01:K0:scaJkVlG0II=:+Blvh5LMPxhld0/EVUedbI qlITSWWg+PwkxO3vuki7AvQSn0qIGJvScyUrJJO8YknCBWBgeyxUrOHxL4geJYclcQ//xlsJT 4hv4qouYSrW/pWq5sz0mI29VrT/i2LLlZWZaH7F28j8nEBY7tALDantRpM46DCG7GH93m8lcq EeKdSajjdqQfXq8IG9Z0RX7DzsuUJ3S0igQKSTEip7FXkg1XaTtb5d9sF5VcOzutYrwM8iT1l 9sUws0Z3XUox2R98hanzC5oIyL3s3GPfiv71sNJdId2Qpw0BzCGmYuG+6KYs9F+stEzzlFz0Q Cs3FAdATmjjiQcBJ7Hy/3oxwLEcKab7vBlTX6nNFADwp+yKMJHyNu18uYd/TruZ+dy8YyfRcU dcRHR1b0yIiwGL0UIjx4h46GEe7liPAQu24PAsEXIG4mmgk8PW5bahXSqNn2D2En6fctkfsHE LKYb8/fHMwI1NRlnJXBhTPPREFx+19btPBOo81eiqT4Xq0SqFgegZV9IkosTQUBR/+Y2uR55E cs/Ve9eCmzTBTP0m5O55pfIHMDP198sg+vpOUIZ7SdPtIZXCH2471pjIFgOtU/3F+jfN4/KvL gXLS3dp7c/+/JwbRqy4fGtIZttaF98v6L9RU19oNSbzkyJfIo6pcumnxVbGd/DoMWPzCh+Lmy xitK+SJpJbITH6kt9KkYREfQTla5vUKoQ/Vru15K2cspgXnmwV+PHfFOnHeu2Yf0IBtw= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The zap_vma_ptes() is declared but not defined on NOMMU kernels, causing a link error for the newly added uverbs code: drivers/infiniband/core/uverbs_main.o: In function `uverbs_user_mmap_disassociate': uverbs_main.c:(.text+0x114c): undefined reference to `zap_vma_ptes' drivers/infiniband/core/uverbs_main.o: In function `rdma_umap_open': uverbs_main.c:(.text+0x53c): undefined reference to `zap_vma_ptes' To fix this, we can either make uverbs depend on CONFIG_MMU, or try to build it anyway. Since this is the only compile-time dependency, I decided to allow building it with an extra compile-time check for CONFIG_MMU before calling the one function. Fixes: 5f9794dc94f5 ("RDMA/ucontext: Add a core API for mmaping driver IO memory") Signed-off-by: Arnd Bergmann --- drivers/infiniband/core/uverbs_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.18.0 diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 40dcf3d02a4b..5c1202af0748 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -884,7 +884,8 @@ static void rdma_umap_open(struct vm_area_struct *vma) * point, so zap it. */ vma->vm_private_data = NULL; - zap_vma_ptes(vma, vma->vm_start, vma->vm_end - vma->vm_start); + if (IS_ENABLED(CONFIG_MMU)) + zap_vma_ptes(vma, vma->vm_start, vma->vm_end - vma->vm_start); } static void rdma_umap_close(struct vm_area_struct *vma) @@ -1023,8 +1024,9 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile) continue; list_del_init(&priv->list); - zap_vma_ptes(vma, vma->vm_start, - vma->vm_end - vma->vm_start); + if (IS_ENABLED(CONFIG_MMU)) + zap_vma_ptes(vma, vma->vm_start, + vma->vm_end - vma->vm_start); vma->vm_flags &= ~(VM_SHARED | VM_MAYSHARE); } mutex_unlock(&ufile->umap_lock);