From patchwork Thu May 11 11:59:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92499 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4318635vqo; Thu, 11 May 2023 05:10:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5DE45A21jo5SPWehvyYLTzNHIcZA4031R8DkDMrBc+qAnIHVGYtMLmNvjG86z39s6yjfSy X-Received: by 2002:a17:902:bb8c:b0:1a6:ef75:3c53 with SMTP id m12-20020a170902bb8c00b001a6ef753c53mr19034432pls.11.1683807045273; Thu, 11 May 2023 05:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683807045; cv=none; d=google.com; s=arc-20160816; b=xkl/Y0FQvsAKnnY67cJS8mKxtU9Y90RIcFGSVkBwn/5GcaiQKZ8gS4nKeRQfwiDdoR 2c3S9yIbwYfaC/IWGBZYCZUgmHUCenHV6siqb5jwep1l80HRaG7WGidrktKbGjxUReAr 3CbwTXc/2sMWhCwBx0DPzyg06QiXxJfyikx1r7mJW7QOa2odSyQ/b9Kokj8wsMwzLOZV cbWCAGbSYLNccD6qB+3ATX43PUnTNeO6i+1rHSZvYFHdAFQ90qtHhWaHhiLHiB00hzED wApRLAxZDmXcxUfFNTgd0NkaXyu3XB4VQY6YAXQI1hsXYZvFKkUki6uMHxJL8VhZEiXY l6lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=hYHNj4xOB3A9+sRrGGyA+CHl8mr8r8wePJEdzxz75NA=; b=mTihk8/V42WGCXrz4ARxE8iNtAoz7sfzg+T4RFsmv7o9FHD2DQb5MaI8zzlCr3Cni6 CgOevTfFjGIh+D8K5yVyflgXWAFsuj6Eb/f7GzDUYYUOM49osJTpYXLwPaMYiVbIb85M 59teINmCm+IU+eE8DsK5iZutprpsIHchrOjaxx5/tUz1pJnQqWa6GFpP6ZkJJffFZrs2 GWhvlloPq/AqY6CW9Cd3ewvbmbrS6MB4AAbab50z2boV1fXTcpDiHExUJM8oNVLdraAU mzKHagwbPLQp4VEADpvb1Z8PaITbOn5t5xvOlLBwVmma1iBy1zHr456IYSwC5OEFLaX1 Qjqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="R4Y4sQ/p"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 13-20020a170902c20d00b001ac53744492si6378551pll.2.2023.05.11.05.10.29; Thu, 11 May 2023 05:10:45 -0700 (PDT) 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=@linaro.org header.s=google header.b="R4Y4sQ/p"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237914AbjEKMAA (ORCPT + 99 others); Thu, 11 May 2023 08:00:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237836AbjEKL7x (ORCPT ); Thu, 11 May 2023 07:59:53 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37FF6901F for ; Thu, 11 May 2023 04:59:49 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4f26f437b30so501083e87.1 for ; Thu, 11 May 2023 04:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806387; x=1686398387; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hYHNj4xOB3A9+sRrGGyA+CHl8mr8r8wePJEdzxz75NA=; b=R4Y4sQ/pkhaXoYZ0Rmd1wl/WLm/7drgJkx1KJxPtPNk0U7/Mys/EiSrRg/aC1csD6H 9Ih1YKeabZAcuvs/HS424EWEMpleCMYQeT/9LVkHgdtK69kZNs2zwBtMRLphBYzVZ/hs aDZyGK/fBqbFH5SMwvxg9nukw0XnauWw2q9+PpZDsge/KbQ2l9ENpY6j04woB9CnctYG SPFNfSpIoDlrAPu//AN94SEgou0j1PTsONUBEXvBRqckAwnYGE3ExGqk3OteELdlGjFO m/1lITxVQiGV5penGZwLpZYGrjuIrRpYLPFetkUBHAziQ1sTCIuJGSXa/TrJ+B8c4VmB RtOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806387; x=1686398387; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hYHNj4xOB3A9+sRrGGyA+CHl8mr8r8wePJEdzxz75NA=; b=C5VIvaadNj2T1Nx9DpUzo432+Uzit23nEYvOmN331eOIYso8KV0I7rfHXz1ODGPr1i HIfK+6+KIlSvSxx0QLaaSU3mM4ZBG3optX52TVFS4bYi6JBcZ9C3Fnx1ok3Uw2vuVog6 Scd65mbqdTn8DnX9eEyZ8WJDZEuoh/cUauQVAwMcdJgAdhIoWQST4IxluWe5GPSNZ1Kg AWnm6ibS6qab8cSP4PoQdkuq0y0lpNeLU60i3Nyg0NzvEjq/dqc6LU54ynUrl24NnUEs ecBruEDpMBldPE6apmhPhwir7ndiCVfaZeOJz43p7FMNlnZgy09jSiQP7dcj6DesBAXu eRGg== X-Gm-Message-State: AC+VfDzK1I8JVOMQ55j+O5Qep0S9OlaL5q4E56vbRlpbapX9yfq6syQH AECwOkg1sDbPGsqSC0yaNfMcJw== X-Received: by 2002:a05:6512:48f:b0:4f1:3ca4:a57f with SMTP id v15-20020a056512048f00b004f13ca4a57fmr2625276lfq.54.1683806387473; Thu, 11 May 2023 04:59:47 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:47 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:18 +0200 Subject: [PATCH 01/12] fs/proc/kcore.c: Pass a pointer to virt_addr_valid() MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-1-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599656327711707?= X-GMAIL-MSGID: =?utf-8?q?1765599656327711707?= The virt_addr_valid() should be passed a pointer, the current code passing a long unsigned int is just exploiting the unintentional polymorphism of these calls being implemented as preprocessor macros. Signed-off-by: Linus Walleij --- fs/proc/kcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 25b44b303b35..75708c66527f 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -199,7 +199,7 @@ kclist_add_private(unsigned long pfn, unsigned long nr_pages, void *arg) ent->addr = (unsigned long)page_to_virt(p); ent->size = nr_pages << PAGE_SHIFT; - if (!virt_addr_valid(ent->addr)) + if (!virt_addr_valid((void *)ent->addr)) goto free_out; /* cut not-mapped area. ....from ppc-32 code. */ From patchwork Thu May 11 11:59:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92490 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4310538vqo; Thu, 11 May 2023 05:01:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ522LS+bnCBAXdgDKbUtqvx4auwNgJbNm8gyrvBZcPX5jikHa6FpaV6GFmt+UGZ6AfoVhog X-Received: by 2002:a05:6a00:a8a:b0:63f:158a:6e7b with SMTP id b10-20020a056a000a8a00b0063f158a6e7bmr30916712pfl.6.1683806471409; Thu, 11 May 2023 05:01:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683806471; cv=none; d=google.com; s=arc-20160816; b=I61143LpfXmQR26ElixbCIm87r6LAmpJQwBs+HtlQ6vqp/t1L/zbMGOUhkVK/WUPdy S9mI96CntjWnLr0EDtHrWZfmMLzcpPpv08Tda+ANWMiCDjWhyjNVP5Gb6ehgNh8ZJ7cB qc0UHJXDLnpVlg7Hr2JUzVxvpvgNlsgyEM8teMbbgLQsM7PsrtbFT9NN6iCS9mMWfr+J tgCuR23cmKH833LWIoUe6mq2QPvQVI0M5GgtUJuU8Rl9kz9l62opkzfkcXSCBawh0oiL Z8Xa8e9pgqoTsydsaH9aj4WTnlJZxtd3tRh/X1hBmiphdOuo/mjwhARaadiAoMIZyEDC YFtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=p9HwjvVojH9hO+PcXlqtL0N9aNW9rB2MppMH77zfxVc=; b=WpUTKKT0ZRh0PboWtDy5aH+d25g4QIf2DKF1yucUG3dPp7cvOfdWgJmduVE2nYmXwS JJVEjMYJPFzdUNQqoHjxNqe+Tt7REsVs60pO0rXZyCVCZAXuzvfd+vZEyGVU/EDUSZTu PCwhnLSPO1Mq3e0tIbu37vpHIL6jKlJHSjqKmueN9gH+B+YeCYPmOy3NEShSZEOkuRA1 4SYHR7EKUnLKo6IwxB9YgvlET8wrzTSLxDszbhf/ZFlR5jCrgZ45TT5rgSf2a76jGfSf EiJ3d33cBvnaS7tlMtUySt6fwyVeY2d28pul3ERfgwUnf4WueRXULMxcmJa6mAJARMyf ho0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h0huwFcu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x6-20020aa79a46000000b006478fe28452si5248433pfj.27.2023.05.11.05.00.56; Thu, 11 May 2023 05:01:11 -0700 (PDT) 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=@linaro.org header.s=google header.b=h0huwFcu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237931AbjEKMAF (ORCPT + 99 others); Thu, 11 May 2023 08:00:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237927AbjEKL7y (ORCPT ); Thu, 11 May 2023 07:59:54 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD188A5B for ; Thu, 11 May 2023 04:59:50 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f14468ef54so9688774e87.0 for ; Thu, 11 May 2023 04:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806388; x=1686398388; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=p9HwjvVojH9hO+PcXlqtL0N9aNW9rB2MppMH77zfxVc=; b=h0huwFcuyufkrW22b7sSvhGB+Ccc6Lvo9LGZiN8vwcbnU3/n9iarupyO8uSUn0mH7F UImAdUl3W888BP2VJ8/y8hWeLPQaZrBrjm/Nu0uLf1rKtgfpgHOHOP3tTQ9zFsRYQoKI fGAtPet9xa7ZtgZBS/HBd67ncf+0PhGxnnIJLi+0TR3kFXVIwxrxsSsx9kN2u2S00z2X 5KFPOq38DBsV6TYrMad4lE6aD4UesfNWsMyc8GuXrhIa7ASsSuoxihIooTid0hE5RsnF bNeaAbNDtKQlSprjkgw+hz3rwPgZB+BNN+D6bTWYVkWkC3zgqquZjKjZxaDyStXaw9xj elHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806388; x=1686398388; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p9HwjvVojH9hO+PcXlqtL0N9aNW9rB2MppMH77zfxVc=; b=CQCczD3KIR68UcPueQSClSUx7Ne0VmT3H7wk1/OaiM73L7LyLhIxR1QSQg4xxRZIsY GFYqGZCCLNBJbnjGLW9w8TlLGzb+Kh6l7wczUO6cjDzr+uIVjOge3jmaciKw4FiSB30y GIXf71fPcE9+MuzU1WKiz+wTWis4EBi30/wbtCBSrGKA1LuUmbMyA4TP1vuVWm6cLGp9 Zc3D4Nd+QbGiey/gTaDm7LUWHKZIy0ni29agFDhnjMaNPcGeDLFPYb5EyB8JizRT/6OD dLTkEi2F2qeewTuC3Iy6v5W/Pa+i6QCct2Mgw4gnREbnzM+Yxxw77ShI3xuyPkl+7SOe bD1g== X-Gm-Message-State: AC+VfDzMNqbwCHOAVJ+UdVWor5a0yul/fwzQbokZFAYhmIN+2Wp+2EXB MioWCZHVuwZYv9yEWHoWKRElZg== X-Received: by 2002:a19:f813:0:b0:4ec:a48a:28c0 with SMTP id a19-20020a19f813000000b004eca48a28c0mr2749652lff.25.1683806388439; Thu, 11 May 2023 04:59:48 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:48 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:19 +0200 Subject: [PATCH 02/12] m68k: Pass a pointer to virt_to_pfn() virt_to_page() MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-2-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599054813798181?= X-GMAIL-MSGID: =?utf-8?q?1765599054813798181?= Functions that work on a pointer to virtual memory such as virt_to_pfn() and users of that function such as virt_to_page() are supposed to pass a pointer to virtual memory, ideally a (void *) or other pointer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix up the offending calls in arch/m68k with explicit casts. Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Add an extra parens around the page argument to the PD_PTABLE() macro, as is normally required. --- arch/m68k/mm/motorola.c | 4 ++-- arch/m68k/mm/sun3mmu.c | 2 +- arch/m68k/sun3/dvma.c | 2 +- arch/m68k/sun3x/dvma.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c index 911301224078..c75984e2d86b 100644 --- a/arch/m68k/mm/motorola.c +++ b/arch/m68k/mm/motorola.c @@ -102,7 +102,7 @@ static struct list_head ptable_list[2] = { LIST_HEAD_INIT(ptable_list[1]), }; -#define PD_PTABLE(page) ((ptable_desc *)&(virt_to_page(page)->lru)) +#define PD_PTABLE(page) ((ptable_desc *)&(virt_to_page((void *)(page))->lru)) #define PD_PAGE(ptable) (list_entry(ptable, struct page, lru)) #define PD_MARKBITS(dp) (*(unsigned int *)&PD_PAGE(dp)->index) @@ -201,7 +201,7 @@ int free_pointer_table(void *table, int type) list_del(dp); mmu_page_dtor((void *)page); if (type == TABLE_PTE) - pgtable_pte_page_dtor(virt_to_page(page)); + pgtable_pte_page_dtor(virt_to_page((void *)page)); free_page (page); return 1; } else if (ptable_list[type].next != dp) { diff --git a/arch/m68k/mm/sun3mmu.c b/arch/m68k/mm/sun3mmu.c index b619d0d4319c..c5e6a23e0262 100644 --- a/arch/m68k/mm/sun3mmu.c +++ b/arch/m68k/mm/sun3mmu.c @@ -75,7 +75,7 @@ void __init paging_init(void) /* now change pg_table to kernel virtual addresses */ pg_table = (pte_t *) __va ((unsigned long) pg_table); for (i=0; i= (unsigned long)high_memory) pte_val (pte) = 0; set_pte (pg_table, pte); diff --git a/arch/m68k/sun3/dvma.c b/arch/m68k/sun3/dvma.c index f15ff16b9997..83fcae6a0e79 100644 --- a/arch/m68k/sun3/dvma.c +++ b/arch/m68k/sun3/dvma.c @@ -29,7 +29,7 @@ static unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr) j = *(volatile unsigned long *)kaddr; *(volatile unsigned long *)kaddr = j; - ptep = pfn_pte(virt_to_pfn(kaddr), PAGE_KERNEL); + ptep = pfn_pte(virt_to_pfn((void *)kaddr), PAGE_KERNEL); pte = pte_val(ptep); // pr_info("dvma_remap: addr %lx -> %lx pte %08lx\n", kaddr, vaddr, pte); if(ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] != pte) { diff --git a/arch/m68k/sun3x/dvma.c b/arch/m68k/sun3x/dvma.c index 08bb92113026..a6034ba05845 100644 --- a/arch/m68k/sun3x/dvma.c +++ b/arch/m68k/sun3x/dvma.c @@ -125,7 +125,7 @@ inline int dvma_map_cpu(unsigned long kaddr, do { pr_debug("mapping %08lx phys to %08lx\n", __pa(kaddr), vaddr); - set_pte(pte, pfn_pte(virt_to_pfn(kaddr), + set_pte(pte, pfn_pte(virt_to_pfn((void *)kaddr), PAGE_KERNEL)); pte++; kaddr += PAGE_SIZE; From patchwork Thu May 11 11:59:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92491 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4310676vqo; Thu, 11 May 2023 05:01:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4N7cajxMaA2yLamdUFqITu/Tgc/Fi9pJmGnet7giSrLEK+qz6CSA3rk1sTSosnnyRvY3BA X-Received: by 2002:a17:90b:85:b0:247:a3ed:63b3 with SMTP id bb5-20020a17090b008500b00247a3ed63b3mr20932303pjb.31.1683806481434; Thu, 11 May 2023 05:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683806481; cv=none; d=google.com; s=arc-20160816; b=OAqTzCk5aDGlX6IOLmsmeHBdPaUe51Whtmrw9alq6njGlQFq+IsoG/KYnCS6EK0s+M UYkdSclf6XWFfNbv6kSkTMkLD8qnrADeOusBk8RqEg8xQudxTSPHYOQ6aJo64DteIyMK My8fCmhjxg5nOdLuC4/z009JlHqTgKnxOfiVIhPCHbsrq919rpgEf9oEc9QLT6E2NyQ0 DLfvfTahcPO9EA4vCnyNa+QXDohOO4LiCGBMikeVlEPOfyGsq3RUOmUcuoouZXCAb8ym m70A2XfMZ8KnOQuCJD0Dtgtm8MYaNDaUyHG6Ms7onfm4Zk9hIPWrRYma1lE6sPu308ze APNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=2CPc/Vm/Ur0JOy8kF/L6fs0qWXc+VKBrwCqiZQE3hiQ=; b=d0dxgWJjfFps1gZ3c4Bd9oMOshFWlsT4Zinu8+CPiMhZkuRDD4fPNXWT05NZ83NOi+ 6oMO+i8zt7JPKzLVw6y4bKhhXrmJs75wjLZ9TmRe+WcrURE/2U8VhrnAu21EEYoQqphb /gnl/5vd+Ban1wZgVDOPlwr2GK9eIocOZxF/jHD2ts6C5rRGYN6nwd9fXOPrXCn+iPTO eKoX+b7Jh6PwtrHB2yHCtNSlraBFN6VrlyDo+3/nDRZZZl24daVlqWtUI3PiZRPtebn9 VbQuY36ImPXrIr5RyZWl5VrEdOYFTZw6XhI6W95BgxeP0acCqpmxj/iVERzA4Q/Atv5B KGew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=us1qr2gp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n17-20020a17090ade9100b002476173727fsi19913463pjv.26.2023.05.11.05.01.05; Thu, 11 May 2023 05:01:21 -0700 (PDT) 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=@linaro.org header.s=google header.b=us1qr2gp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237882AbjEKMAS (ORCPT + 99 others); Thu, 11 May 2023 08:00:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237901AbjEKL74 (ORCPT ); Thu, 11 May 2023 07:59:56 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56C378A6F for ; Thu, 11 May 2023 04:59:51 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-4f14468ef54so9688794e87.0 for ; Thu, 11 May 2023 04:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806389; x=1686398389; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2CPc/Vm/Ur0JOy8kF/L6fs0qWXc+VKBrwCqiZQE3hiQ=; b=us1qr2gpwQ3bBAky0xvbHlSTRCtb1nydasm8z39XkazIJzESLaqNzEYvSDrqWvBqBX 4xcES64hit/N9fYugYwoV5W3g4eBVSitwsbnnifZ0lNM9KhPgKlQsFulFvXvE2t+KR4U ORQ5OFqloYcfrHKwTO12OVVscWtd5hVcDmECRKCgjTthI9wyAS5zhkAj5RdT8DId2mTE 5+ejX9H2q5kq1KWIA7iOUhoaa7GyZwuQHvQ3gEGe/NTiXYuogO2QROPtUakEjm0CnwbK kvsZHLKeUbzU9xoleFgHTrQZPpPyif74SXwCAcrOuKmxwemz6uMXGapYyPfo5nL/aCgI pNdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806389; x=1686398389; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2CPc/Vm/Ur0JOy8kF/L6fs0qWXc+VKBrwCqiZQE3hiQ=; b=L6OEaPZWVS2WiLXNBWqUdrZCi5JlESztfAGwRq8vikKLk1TXY3u4CqyAdkXrVG4z62 1S/ZoePl94Kgq0ECRLHleslMuk6rUezzkmpVgiQrnw1j315ZtlxrLGcgRRJeTdVa6JpY F1pobVh3S3Ie8yKOh5vEyb5pS4sztSRrtXTo13gMDrtRt5cdV31iaaNX378ZbGrPpk35 SXdxbjaopE8sFSQeq/cB2JQ45TrGiO+ZgWvGMJEpoNt96CmEpYbKEbR5EQil9HrEmV1E eqn5/jNOKNspWydWaJ8+JdfNn9pc8ln3+Jvj7l8VCEbswmZ4rpVNLt/E97tsF0gKujGY vx1g== X-Gm-Message-State: AC+VfDxMupbD1km/BdUUA/ZLsTGnly7MBlRKwylNbnXuC7SsN8omJnMf t4lgUYlaNGZnBxbHlimtImfcIw== X-Received: by 2002:ac2:5fae:0:b0:4ea:fa07:1182 with SMTP id s14-20020ac25fae000000b004eafa071182mr2670102lfe.14.1683806389365; Thu, 11 May 2023 04:59:49 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:49 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:20 +0200 Subject: [PATCH 03/12] ARC: init: Pass a pointer to virt_to_pfn() in init MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-3-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599065327157474?= X-GMAIL-MSGID: =?utf-8?q?1765599065327157474?= Functions that work on a pointer to virtual memory such as virt_to_pfn() and users of that function such as virt_to_page() are supposed to pass a pointer to virtual memory, ideally a (void *) or other pointer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix up the offending call in arch/arc with an explicit cast. Signed-off-by: Linus Walleij --- arch/arc/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c index 2b89b6c53801..9f64d729c9f8 100644 --- a/arch/arc/mm/init.c +++ b/arch/arc/mm/init.c @@ -87,7 +87,7 @@ void __init setup_arch_memory(void) setup_initial_init_mm(_text, _etext, _edata, _end); /* first page of system - kernel .vector starts here */ - min_low_pfn = virt_to_pfn(CONFIG_LINUX_RAM_BASE); + min_low_pfn = virt_to_pfn((void *)CONFIG_LINUX_RAM_BASE); /* Last usable page of low mem */ max_low_pfn = max_pfn = PFN_DOWN(low_mem_start + low_mem_sz); From patchwork Thu May 11 11:59:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92501 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4319578vqo; Thu, 11 May 2023 05:11:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Iw5jO+yd85nAm1U37qDJ5dvAHXFPXF1xKxCh5KzMK8k8hMqkbvJbcGWsPhGO4IR3ZUm2D X-Received: by 2002:a05:6a20:8e05:b0:101:281c:494 with SMTP id y5-20020a056a208e0500b00101281c0494mr11082999pzj.27.1683807117586; Thu, 11 May 2023 05:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683807117; cv=none; d=google.com; s=arc-20160816; b=W7huiD/mybxY0tyhd8YZBCuT1PMaTpM4lA2dhEifyD5zoaS/AFidZPqS2xVi4VA4/k lbI0TThAAMYRE68q1rnkWf9Saf7rXf1xy1hQ91+ycAPNnV7JwCzUSxsO0rPfu5TMpV7d 21iEtHnSSAw6oyDHuJtvuziO9af07cO8VV3TGomINUn+cd4yQ2tDzG8Em2r7xy1a9ZAL cNG0amQh+dnVbLH+uM/vlM8vvPGNch2fpLvaYLPb3afnmYy7DBzN1OE3rhqSiRWh705m YxRk9cO0qwz/BncsdNXex9jTyshcoGgVMuv8HHZoZJZiSZJ8u6YAzfUDa41JYnaPc0b5 SXyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=AULvzv+57dD5HpSWPkpxyceRhii29y9Rzv9p/7gtLz8=; b=DWQ61Us+Ubc5j/Er9i6kMt8lvBm7bGpd04rA7H24raPGzUjqqqGLAVKfxItDiPnMKU iPmFKwGmbRQ8Vx47XqrgTwtpqXDqs1Vy4axMQcIVxGYWkc6y9V4jpPD+QotgmlxQhi3d Ys/84hAo4f4KLUTdTRWMgotAWHtdNF/9XQeQJYxTERWiCfMsHqRzxh6O6xe9qnH+TjrN dNYGbKUNlKngzo1zRstI0DZX4fOAag5OOx48FeRKXdGvFY8a5v0wgM8F8qUqbi+7FmJE 3ioN3psq+FSvwMNidKselfRS2kltA4EHGE3jQCEubwcmiUEdHuxv/ekiBAue/VP7bov5 Tz5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=soo7gel6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z190-20020a6265c7000000b0062a46a30cb7si7353914pfb.51.2023.05.11.05.11.43; Thu, 11 May 2023 05:11:57 -0700 (PDT) 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=@linaro.org header.s=google header.b=soo7gel6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237987AbjEKMAZ (ORCPT + 99 others); Thu, 11 May 2023 08:00:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237934AbjEKL75 (ORCPT ); Thu, 11 May 2023 07:59:57 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 617C593FB for ; Thu, 11 May 2023 04:59:52 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f13c577e36so9471726e87.1 for ; Thu, 11 May 2023 04:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806390; x=1686398390; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AULvzv+57dD5HpSWPkpxyceRhii29y9Rzv9p/7gtLz8=; b=soo7gel61xLJPPvWmBpSRpISycpQ4XMSOLDpuxsIg8UcYukLYcg7kMmXk/2zJzG1nW dsU8I+b6+EeJC/RPFjsri77SgRQ6hq2riwqwbxPxb9BPmFrHaOXA8XlBqwiqx0GubS/i Mhuqa/PtIduAVK1dEpaA3MpUlLbL32Xbmw+sH+jktUlv+lmF4kpGzKSikAVGP0VgKPOp YCj4v5oEg1jhayDSX8iKc90tIlislQLi37GCRWiSDvFSwFEkSlw0s6Y42ltaRe+/B46x HB3CKfzsllSPT5KE0DczkqM0Ns6TrGXqPqX3xl8eTKyXRx+KvTrVcbjwXkVi5//X0Zuv BYQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806390; x=1686398390; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AULvzv+57dD5HpSWPkpxyceRhii29y9Rzv9p/7gtLz8=; b=GBDf+JnYENPE+ZMV6MNrGYir18ZC+W/Cqa4EluGTD15nXIJYbqLoou1My+yci8b8+m aE6L8sEEhBQn9HQ5F+YOgQVgty6WJrhrR77uxbG6Ae5HCX1O2Sx7MBwz3ODasVACrFl1 J1+6oZw5ImN+d4Kw0t8cCMjPXbZAF9ML5CEE+MoNsJzmJrRfAR7fSNhOI3en999WOtXh 53HhDQJIsQ8lA1f8M72fXzXt1r/9h4vUHxyXzSYsstw3yD36Lw/S8IdpiBzGWcpqjX4f rkSOJK8FnXHIkjTs/DGJo8fJx4UNzmW0IVVh9A2E80Y9XhI1/sXDajXE3igW8fyPGjSz JTSg== X-Gm-Message-State: AC+VfDwheaN9yE+Tcvu5wvjD37/r/EElNRq+1t9YIUoh4udGOHeGHl3r UZPGwth9eep5W2lrqCcsYkoCMg== X-Received: by 2002:a05:6512:3744:b0:4e7:dd1e:e521 with SMTP id a4-20020a056512374400b004e7dd1ee521mr2323684lfs.9.1683806390306; Thu, 11 May 2023 04:59:50 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:50 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:21 +0200 Subject: [PATCH 04/12] riscv: mm: init: Pass a pointer to virt_to_page() MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-4-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599732005814131?= X-GMAIL-MSGID: =?utf-8?q?1765599732005814131?= Functions that work on a pointer to virtual memory such as virt_to_pfn() and users of that function such as virt_to_page() are supposed to pass a pointer to virtual memory, ideally a (void *) or other pointer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix this in the RISCV mm init code, so we can implement a strongly typed virt_to_pfn(). Signed-off-by: Linus Walleij Reviewed-by: Alexandre Ghiti --- arch/riscv/mm/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 747e5b1ef02d..2f7a7c345a6a 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -356,7 +356,7 @@ static phys_addr_t __init alloc_pte_late(uintptr_t va) unsigned long vaddr; vaddr = __get_free_page(GFP_KERNEL); - BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page(vaddr))); + BUG_ON(!vaddr || !pgtable_pte_page_ctor(virt_to_page((void *)vaddr))); return __pa(vaddr); } @@ -439,7 +439,7 @@ static phys_addr_t __init alloc_pmd_late(uintptr_t va) unsigned long vaddr; vaddr = __get_free_page(GFP_KERNEL); - BUG_ON(!vaddr || !pgtable_pmd_page_ctor(virt_to_page(vaddr))); + BUG_ON(!vaddr || !pgtable_pmd_page_ctor(virt_to_page((void *)vaddr))); return __pa(vaddr); } From patchwork Thu May 11 11:59:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92496 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4317797vqo; Thu, 11 May 2023 05:09:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/VIYh9fBJ7GIqXPn70R6xrMQJmUgdC4BUIlbxpMP4ekfZj29wDUcSR261CzH9qumhg7oO X-Received: by 2002:a92:3009:0:b0:32a:f44e:b869 with SMTP id x9-20020a923009000000b0032af44eb869mr12690354ile.5.1683806984277; Thu, 11 May 2023 05:09:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683806984; cv=none; d=google.com; s=arc-20160816; b=qgqHWLS3bv+QnSoEW49i6uYQkOgcplYi60P4VCJ4SA5IQi98Z8IONkIEPAg11gQsj8 oLVvYBjhouUxJQYgU/CJvZE6g4oLT7+1bVQLDkOtHWOwHlpcRz0yxrTPg5jwK4Hu8UGQ xh7hQjFRvJxlMmd/djilxHxxdfHk1hITIkDaHjMQm94U5HU0ZBdVX9GK4W4ZAM5nXIZ7 WvZO3AFSgw7a3YuKLMrIT2TV5A6auo3/P3PWLhEm57Tt4t8QtYkT0md3ZO+OcU1UnlY2 f94WkBtOr7ip4GGmZFM8HOsEKr3r1aSYjs+V1bLKRjLmv+jXgCiVhtcN7DtUhFjoJUlJ MEnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ZKz9AzIS+RysB0OU8OUcujwHN84YucEXXNOUbLloVVs=; b=KTwDT+we1L5pmYNlMaRErhNvaKhXHepPF4yIdVNjK/KV21mYSOQ5c5m36RFNgAbnoR piWevxJ54Txk7kvVnDvHI4blKkQJec6e3tItiLtD6gty1be/dattRF421g8D+2o5gcfE X4m/xVRgyUYkRN5dUjk+2GmA3Al2JjOFPxLbawWvzuoe0zk879wG6I5mUPZt8HRM/Wq9 1DqNvynMxPoYsW4rnMJk7uBpk9OAegm0XB17pL6ny8F/op/+6vUZjRPRiHXkZLvKn95O pzeSRzqZVcBKLPOxm/lZWv3TLGctRdKqKyV/RuHSYDLx0Hi6SZWi9wgC3dDa9py50Zuv g7+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yiGUAJSV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j22-20020a023216000000b003c4ee294ccdsi6604990jaa.42.2023.05.11.05.09.29; Thu, 11 May 2023 05:09:44 -0700 (PDT) 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=@linaro.org header.s=google header.b=yiGUAJSV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237943AbjEKMAd (ORCPT + 99 others); Thu, 11 May 2023 08:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237941AbjEKMAC (ORCPT ); Thu, 11 May 2023 08:00:02 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 490559EE4 for ; Thu, 11 May 2023 04:59:53 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f24cfb8539so6056604e87.3 for ; Thu, 11 May 2023 04:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806391; x=1686398391; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ZKz9AzIS+RysB0OU8OUcujwHN84YucEXXNOUbLloVVs=; b=yiGUAJSVd27ej3NuIk3vnvK3fS1qO3n93XWDO7/QSlEw5RHl7TlckkvSbtgAGMT7rs 8gcQLXhS79sxLG00vev3Tm+FL9DZK5f2fjYO2/9Es7JV+ZV8EPjwXP4D0JU15a2xS+1A jqCUYx4wQDDuhH0tj93gaLE2O4RLjJkMa8aSjU9Ljzc00Ea6CAC5lgOQ8Gs28oI/UYpG DmkJW9Uw1afeErc6qgHpSrInmF3KaA9OR4no4iWYo/uDwZIfqMxDi6oFiLi1PWZfKQr2 u9TrLhqEgUGyGiPpMj49YARpaWJ9QLLB5f4psSVnHsptmTvb1WU9bQQ+74/xGlNqIVr1 gQXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806391; x=1686398391; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZKz9AzIS+RysB0OU8OUcujwHN84YucEXXNOUbLloVVs=; b=PK3u+Yv3FSk6yhRkvP9YdZkFCxB0dVrmrWOuKKdxAgJwkTnJKlScFZAsZPCE5NOUNS Iu1MNRruyO5FSH3yaNfYQE3A//1/tSbepIGz5vD/IYP99S4fFDjvYLXOM4jFZYcWZhNT QQdc3YLpEQ+zEGNg4LROJJNtwn8gaVnG5BmIv+LbctEfcTT0752YKTYFuZgUOSs+JKRd kd4kdy6J625I4YF3LHaufXrmz+71kqnlB/3OH+rfb88/ZU0ZrtveisHsRFBGbc6shZCq r8R3dFpjk0g/bVtWyfRbccgwKbv0szCvUVcfe2OlX7OFmLrbu19P7jrKyvfUTWkVvW2J Hd6w== X-Gm-Message-State: AC+VfDwJy8XcvbKLMclqwkLEzlAJeoVZGp7mwKvLX/lrG32gCM9LJMFa //AFO1E5gFRVUDRFgqVR6nwM3Q== X-Received: by 2002:ac2:46d4:0:b0:4dd:ac8d:671f with SMTP id p20-20020ac246d4000000b004ddac8d671fmr2858782lfo.34.1683806391327; Thu, 11 May 2023 04:59:51 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:50 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:22 +0200 Subject: [PATCH 05/12] cifs: Pass a pointer to virt_to_page() MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-5-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599592449494200?= X-GMAIL-MSGID: =?utf-8?q?1765599592449494200?= Like the other calls in this function virt_to_page() expects a pointer, not an integer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix this up with an explicit cast. Signed-off-by: Linus Walleij Acked-by: Tom Talpey --- fs/cifs/smbdirect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 0362ebd4fa0f..964f07375a8d 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -2500,7 +2500,7 @@ static ssize_t smb_extract_kvec_to_rdma(struct iov_iter *iter, if (is_vmalloc_or_module_addr((void *)kaddr)) page = vmalloc_to_page((void *)kaddr); else - page = virt_to_page(kaddr); + page = virt_to_page((void *)kaddr); if (!smb_set_sge(rdma, page, off, seg)) return -EIO; From patchwork Thu May 11 11:59:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92504 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4320040vqo; Thu, 11 May 2023 05:12:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ixNO8UnCZTVA7aIkQFYOW0RTjpaLvZJCbht0wTAhAtXPPPcDNGWkEcjrsrfCL20m7+vV+ X-Received: by 2002:a17:902:f682:b0:1a9:6dfb:4b09 with SMTP id l2-20020a170902f68200b001a96dfb4b09mr24814498plg.67.1683807160905; Thu, 11 May 2023 05:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683807160; cv=none; d=google.com; s=arc-20160816; b=Z6CQnyuU9uUEHcR+DuoK9GAmbQILJM95NoHUvkVCN3HwNZWsclGFGuA+jSyjBCioiz CjwkU7y5bvYp+yDWUv2Eit0yL4hiNKCuqN6BvWQVybyDQFvavn2DYg4opdH8W53POBCL 0t0CIxn8sYpglbjewsX9rmE5GWnqfiTbTl7mag81JtaTtQEgpiWjqTg5p4tbGWkDFWXr kt10/MtmGz5VJbgpKOhVtnUS02rCXJn20z9DsEfMeNIqwzpRarNsGwES4T2I34PZkh8a xGyKk1bZ5AnVyOdndHnC/q1U6aDMRuZop5clRVvqwMGLcxb4y8pRBwvBslegmEOqX5HH nJWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=zblD5qwa4O4tbk0UyG8/FxNMnBSv353Htd3W/ogLXhE=; b=tTqPfvHzDu+fND4h/CgPChAr5SjzEECtHT8VbsPZIPZ6dteoOcKzj5KMUR0QUkxH2r Uv5Z5W06QvNMqaGJjJlfVSlgBjZfv2c9tRC4lsbxpF31tuDjRbYo/kTD6DPDsEy2Owl7 /U0ksczVLrOJ9vXkpKbo3U7XPRgMTM0zCcP/jo45tsaRRTKKOOMfneUM1AzbkaK6QF2i GFQjEdHMeyQrd6PEc/mZS+la1HhrSH1uTtSp977S7uP/BkSf0MVIIijGn0cHLsy0sZtE ZbM1EWYQyHtjOKOYxVkkrxgKv9/8drpiU6O9Y5+FvD7+8EoDyoZQrUEZ7W1Sxy9RhM/p 3klw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wyPzOAzN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x15-20020a170902ec8f00b001ac8daed841si7079201plg.646.2023.05.11.05.12.25; Thu, 11 May 2023 05:12:40 -0700 (PDT) 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=@linaro.org header.s=google header.b=wyPzOAzN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238026AbjEKMAj (ORCPT + 99 others); Thu, 11 May 2023 08:00:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237947AbjEKMAC (ORCPT ); Thu, 11 May 2023 08:00:02 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60BFBA248 for ; Thu, 11 May 2023 04:59:54 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ac836f4447so86235681fa.2 for ; Thu, 11 May 2023 04:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806392; x=1686398392; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zblD5qwa4O4tbk0UyG8/FxNMnBSv353Htd3W/ogLXhE=; b=wyPzOAzNl7rmMFYBpuSvqF8bhrq6s9qC3HUK0XdF1bjiigB5tF7/avNAx4obqKnEQ1 5XDdVWTgJzXsRWcpD0IeKxuCUkF11nwjWijBb+G6T5OPprRNKDhkDqc9xd5QVgMzyrYY L4pIzqOjfuQxI7o931I1eoHt0E6G0OHcTKzBzLCxA+U45bYiMjQdWdAzAsrvS2ny+0vb k7hlG5IBE0zSUhp1t5xXUTTwH3SO9y19gebdMieRe9lXFfVvvxSdJSGDOae/gEYPgSY9 RwLKQo1r9DKn1ZNPuZYIw5CEheKyIccgqvPNEdgrxsVlTPsrWGQMtl/h5sx8pPqkpO6r g93g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806392; x=1686398392; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zblD5qwa4O4tbk0UyG8/FxNMnBSv353Htd3W/ogLXhE=; b=iy50aCX4FeOV+YPMGB661cvWm49d4ZE2lDlIdXEJY5zNbc8ZlWWAUgBYK3LD98Bx7f mGL9srI0QYoPEa0AE/slfjzpSZuuQSzGCEdYP3YuVaOFDKBgv2FlISonZVorY358uxa0 oFJ8Ayr5qzer1TqvXIOBDoA7kBo2xjfcbRQTIrAl7k1uHCrKA0GRT+vnhA0nDs4X2Oed dyfPvP4gXbgp/ukKjKqnBoyjVEX565HrYKRwI9IPxx4ID5bYLiERSqSH1iA/h7YnqvCJ 35zZFFuOfOgPAXxKa9A/+gRHsZtCQcSivexEeEMgJ/IhOiSEJAI0ze8S2oMnI9TiZeqH bFgw== X-Gm-Message-State: AC+VfDzebwUxNnOknC7oNZF3+OXREQtO+OmCQTdOcvQNFDHK8rru0UMQ Qyd9aEz2CfzZQeXuZNyewjbXHg== X-Received: by 2002:a19:f605:0:b0:4f2:53fb:187 with SMTP id x5-20020a19f605000000b004f253fb0187mr2361851lfe.68.1683806392694; Thu, 11 May 2023 04:59:52 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:52 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:23 +0200 Subject: [PATCH 06/12] cifs: Pass a pointer to virt_to_page() in cifsglob MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-6-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599777594411972?= X-GMAIL-MSGID: =?utf-8?q?1765599777594411972?= Like the other calls in this function virt_to_page() expects a pointer, not an integer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix this up with an explicit cast. Signed-off-by: Linus Walleij Acked-by: Tom Talpey --- fs/cifs/cifsglob.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 414685c5d530..3d29a4bbbc40 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -2218,7 +2218,7 @@ static inline void cifs_sg_set_buf(struct sg_table *sgtable, } while (buflen); } else { sg_set_page(&sgtable->sgl[sgtable->nents++], - virt_to_page(addr), buflen, off); + virt_to_page((void *)addr), buflen, off); } } From patchwork Thu May 11 11:59:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92492 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4311341vqo; Thu, 11 May 2023 05:02:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4VNkXsLQlGR68ENh4F6Pl7nPXYZXn4vn5oXQ+9fmJRpIilhofSD5TxI7e8BARb90Wj3df1 X-Received: by 2002:a05:6a00:10d3:b0:641:3ca2:1aec with SMTP id d19-20020a056a0010d300b006413ca21aecmr27552600pfu.27.1683806525542; Thu, 11 May 2023 05:02:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683806525; cv=none; d=google.com; s=arc-20160816; b=y+tlQmR0pIiNkmKH8La6OxJGs29JsHEB4/dh2H086TNglHBLUDuvARIYt2RR6hJ7AQ IOw/0XWgkPT8t+w5myAWHKIqlXWSWm+NCiPp+gou7GZY3+pvkFz7ryWoRmBtl1GnzGVb 0cpyFDUCPfFZ2xca1DUiCnXw+/XLhsg7p5XhOzBF6KaGB+AJfksAgJjgQ1EEMSkkGoRc YoF51tR0EKFuIlTlUUdq+sY8Z4/LPy2qUXETLH0C3CGVmwDdADjoCEqMw3Ab0nUMVDYO ku4f1hizCNVEzvAV78gD8gWaedcPM+/FFqTNXYDY1SW2JYHGwAUFQp/m/WC+CPyjcuG1 RIMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=cbjvTSrc7JXib/jYCtsnbT8Pj+twUmj4f7HYrh8lbjo=; b=UZQ2R9+78r4M/CEw5So9N4BNz9gICBBPojkMt4fSkoXrYxXbRTgSfMRfWbT/d2AOdI j1dBMG+LRlqaAGBnVN6TEG8HTO9nYz+f8/pimWL8IFGc9xNHTz2iIzv/R7RRiG2ghld6 TLuJNEQSoQAoE0O11egHxgSI6germ6DPf7g7JxQLYXUwtjDr2knBInaGA9krhb0FKy8/ tfElyajoLibrcHAfl+YsDu3F86kdf1YoLvvafPy/Ja8QPvrWFUCRHncFe2ebZ3kElHxq GtDASpsfGjveg8OGub62GVOFOycQ6JGbeOAAet0vhsMjQ9m4Ls0TiYuiDdyvxUkzCLpe awMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lVyXp4k3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p6-20020a622906000000b006484c433051si3785409pfp.115.2023.05.11.05.01.44; Thu, 11 May 2023 05:02:05 -0700 (PDT) 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=@linaro.org header.s=google header.b=lVyXp4k3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238018AbjEKMA2 (ORCPT + 99 others); Thu, 11 May 2023 08:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237942AbjEKMAC (ORCPT ); Thu, 11 May 2023 08:00:02 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 217778A54 for ; Thu, 11 May 2023 04:59:54 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4f004cc54f4so9640095e87.3 for ; Thu, 11 May 2023 04:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806393; x=1686398393; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=cbjvTSrc7JXib/jYCtsnbT8Pj+twUmj4f7HYrh8lbjo=; b=lVyXp4k3KTmo8RdF9FjbrH3Tv6c0bVkXtZywPccWNYeyjQtpi+z8J9YOLY5+sc8Eee 9TxIZcqfBkHZCR5W/lS4SlBkIqbWGSAPlS7Lr3r/I9TrjHIt12ePBNQQByXKE9XA5W82 Lp1d5/+LzKSwENiuYylfIRK6jrTQr4Zv4h1kXRVaE4hxsuTMNFh3hlQ2qHWkX+6kY0EG T5bDIgWzHhDoq1MM/WpZ20V/MaFu2pz8FMs/SVRMPgnQO5dguxAOe06YAfd7vgPdzNUJ UXbg5YSTuY6yxPVV9orezsqTc3SK9pkouhcNBUYohSwcaCiNBsVhx46K7y7sjmIKo1cO FxrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806393; x=1686398393; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cbjvTSrc7JXib/jYCtsnbT8Pj+twUmj4f7HYrh8lbjo=; b=blTgzjhoFAU4WbWGl9P2uk4cTpQNP7Ru5TK0/uNgkKvVgcx72e+7E9usagr85jrU9g 5SAYTX6zTwYwiy3iizdyWTa+NW7d0loLhhepIU+Y+B1B91GhTQS1TFsNX/cbK6ywjBMJ 5cA8SLfvVqmw6nXDmaKIC11Z1ygB7H6EmKhKUc9XDFHnh2DSvLnkNajZlOsJiMFh8N4V 8UTwwD5qe4Z40dnus4EWMjJNFcGNSqLNHsiEaJxGoCq5nEBZV1/I1MwISy4tCSfWoM5A ygJVIPLsjLcqNNilSYZMKOTogSgXeVYn1k3Mwxeijqq4CWjRvvHeedXMj4IYQouzklh3 Hu2A== X-Gm-Message-State: AC+VfDy70QYH3cL63paCpXVll1yFVsJ+rFtjKVMDKh1H34iPGjevoBYB sU92SIKnixwICIvys7/QA2F/kw== X-Received: by 2002:ac2:4f8e:0:b0:4f1:3eea:eaf9 with SMTP id z14-20020ac24f8e000000b004f13eeaeaf9mr2642443lfs.24.1683806393661; Thu, 11 May 2023 04:59:53 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:53 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:24 +0200 Subject: [PATCH 07/12] netfs: Pass a pointer to virt_to_page() MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-7-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599111309668780?= X-GMAIL-MSGID: =?utf-8?q?1765599111309668780?= Like the other calls in this function virt_to_page() expects a pointer, not an integer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix this up with an explicit cast. Signed-off-by: Linus Walleij --- fs/netfs/iterator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/netfs/iterator.c b/fs/netfs/iterator.c index 8a4c86687429..0431ec4a7298 100644 --- a/fs/netfs/iterator.c +++ b/fs/netfs/iterator.c @@ -240,7 +240,7 @@ static ssize_t netfs_extract_kvec_to_sg(struct iov_iter *iter, if (is_vmalloc_or_module_addr((void *)kaddr)) page = vmalloc_to_page((void *)kaddr); else - page = virt_to_page(kaddr); + page = virt_to_page((void *)kaddr); sg_set_page(sg, page, len, off); sgtable->nents++; From patchwork Thu May 11 11:59:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92498 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4318632vqo; Thu, 11 May 2023 05:10:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60Qvwq/0H3uGxBvoRoyWm49uorl+LOp+EMxUsFl+kuk8k4sUQhdu54dWy1RJEMkQBuiLza X-Received: by 2002:a05:6a20:1583:b0:100:9740:78a5 with SMTP id h3-20020a056a20158300b00100974078a5mr16146275pzj.38.1683807045018; Thu, 11 May 2023 05:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683807045; cv=none; d=google.com; s=arc-20160816; b=1Ic/1rjv25pcREJ9lGDGqr8+D0Cp4tivfpRvnNbGBZQ6hvj0tdDXnv6YoF6Q1rwdup 4fbryaKNmz2mDwOKdcRtZT4TYKgogsddHU31f0jzp96DpJVdnmIAnwxkfYshk/4074zN kHZym0PCJ5KWsZrtb4vU5iUUM5Jqp7fHuSxy1FaoxxU/5rWvZpbw0cdkbc8j2d39hKBL /XKSfXn97r49PIciUmECcbEC7JNRKtb6XNIDPKO6X+QtIGil8CYFQC9q+IUfmgIobZys zQNdvr2O2SuKpdzvsJCgZ+/N4tdtQH8NRDLg1EsdLYsqDvbvmhfW0pYQid/iUM9UFK5v s4Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=xp9YXKX/mdPfR3Groy/h2+S4HOih/XO/GthWPwB3ikY=; b=qHmVNFQ/8xjWRoYUvZ1ZyOidlEQHVdNsT0wQffF3+h1kN31dKYGCEZgCbcTJKe64T5 3HzTCdBBGWhhqVWmt8TzsYT3Ns7KAh6EN3NrUXeyJ5hM8NT8F/IPxI2Noj425saIKhdj eIMr+dCZNpHsyHEHHNVcqqknvYlkBMQ3sTNlWayFZuONibfxHNbVdUh2vfLznQb/D9tY cgOlpmEDpeFK3VxG26WCQrbgB9IfPbuwlvgjPUPkDQHT0rzR3xcPRpM3+SQUteBkoSUY oH/Z8bjJgihy/IAFm2J/vi5CQcsvIiqm6WVBohlwxw1RguarJj6Rk5HyN1UCk8LkfpA3 mlqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VET6NG7w; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i69-20020a639d48000000b0051948f1993fsi6343547pgd.40.2023.05.11.05.10.28; Thu, 11 May 2023 05:10:44 -0700 (PDT) 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=@linaro.org header.s=google header.b=VET6NG7w; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237927AbjEKMAt (ORCPT + 99 others); Thu, 11 May 2023 08:00:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237880AbjEKMAR (ORCPT ); Thu, 11 May 2023 08:00:17 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 963BDAD1B for ; Thu, 11 May 2023 04:59:56 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4f00d41df22so46715433e87.1 for ; Thu, 11 May 2023 04:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806394; x=1686398394; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xp9YXKX/mdPfR3Groy/h2+S4HOih/XO/GthWPwB3ikY=; b=VET6NG7wZTvecZWmT897hwjurDC79ewy9skuHZ0BAg8j6WG0HpKT+cKQYjlNZZqhS9 ZBHD1UegBUAZIn6kmSpxYJxUFcYOnfNE4nWrjQj8Sh+Uyggour6jRxMf7LS9/IF5rBFy W4iB0k1o3MdtFYsa9QEggKETjWUSzFkIw+N/2yuZwaQ++xxuXjedgdW2WIuJ65DMFPN/ e/9mK8nx3Y3hIAMMKkRttccO2avl3pany6MQBtJ/no8qfzNa5YL3EsRjrPJBi0xnB1Ix DgFTea1Sh8U9UP6E0E8bSwiu4w89Knjloaax/XSVZRxAotV+hiMJu+jl4YaOwMPz+gGa V0LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806394; x=1686398394; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xp9YXKX/mdPfR3Groy/h2+S4HOih/XO/GthWPwB3ikY=; b=WFWUb9kX5i8blJB5fQFhwlzdmfj3+dIjcbRudcukln0XANxu3LZz4ZBigx46EjTJGW FGZLQPU9cc6FPE5bzyvlOItWmZX9iokLVv1IxHxS5v5YHQDrbdfLB21uqroVCZeLyX7Z xPsJ2L764dIbVu+T2Tj6Mz2bdcdVldRGQAQwQbdbo4uvqvLN9vR/aLR3Ba84IGgyxREg r92JC6/AlUlrk4mthmx8WPiRUahj0SDD5dUPE1p5PzEGP7htMThILfCzoWecbZg+T02T QLYbzybADqX3C9uoX/6YSqFnIgSFLOiOsUq8/CTDEBAYTIaOFi1J4bWxuXVaR7o4I7W9 6Kxg== X-Gm-Message-State: AC+VfDzfetScQ860zcfUeGSQm3ccOWbR0//XWm3ses/EYQAGB1bWYstF lWu5q1dHMQWZLaupsX48TgJtww== X-Received: by 2002:ac2:4d03:0:b0:4ef:ebbb:2cf5 with SMTP id r3-20020ac24d03000000b004efebbb2cf5mr3050896lfi.17.1683806394609; Thu, 11 May 2023 04:59:54 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:54 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:25 +0200 Subject: [PATCH 08/12] arm64: vdso: Pass (void *) to virt_to_page() MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-8-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599656084824577?= X-GMAIL-MSGID: =?utf-8?q?1765599656084824577?= Like the other calls in this function virt_to_page() expects a pointer, not an integer. However since many architectures implement virt_to_pfn() as a macro, this function becomes polymorphic and accepts both a (unsigned long) and a (void *). Fix this up with an explicit cast. Signed-off-by: Linus Walleij Acked-by: Catalin Marinas --- arch/arm64/kernel/vdso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c index 0119dc91abb5..d9e1355730ef 100644 --- a/arch/arm64/kernel/vdso.c +++ b/arch/arm64/kernel/vdso.c @@ -288,7 +288,7 @@ static int aarch32_alloc_kuser_vdso_page(void) memcpy((void *)(vdso_page + 0x1000 - kuser_sz), __kuser_helper_start, kuser_sz); - aarch32_vectors_page = virt_to_page(vdso_page); + aarch32_vectors_page = virt_to_page((void *)vdso_page); return 0; } From patchwork Thu May 11 11:59:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92500 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4319107vqo; Thu, 11 May 2023 05:11:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7wvllQgkgl4+z22bMvvSdBkH36AoYnGal1Gh54NOzgrr67+LoI1S+HELuL53cp/ZyYWNFN X-Received: by 2002:a17:903:2cb:b0:1ac:73e9:de5 with SMTP id s11-20020a17090302cb00b001ac73e90de5mr17285330plk.46.1683807081592; Thu, 11 May 2023 05:11:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683807081; cv=none; d=google.com; s=arc-20160816; b=QksH7Udkubg1N+OqhwaVct3pk1wPrRlHNhOafWmU4Ao566wCgHPul3Aqpt9kdB/qOc jr8mPs1vM/zO33/bjF1JUn2/Cn6cqc2S4B3jnfBpt9njle+paKIyoVgfs9dC01tmcOKP jPuB4w474kfpDwThq6/kYf8h8o6g/E/Q6j5z5TnI1snLyjJ9YBM9dZcPB1VOdQuy893A giKR1bx1X4J+3PnGoEvbHJF8ASQhYNHSuQTgfdV6riHK8xidilEbG7YwAtutzPn4XbNv etlJdxNjYvsskZUswwmEuWuxIX67xYeX4v1D1wsT8DfsMeOA8li6iFEVGqYHX/MN1eYq A10Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=ldVw9wlzEkzEKLn5PMVleGqWnYMQxC7MlxWwEOwXVk4=; b=NjrLtwvchUOEY6dRtRVdE+2aXf3kmBWdarDzDIZm6Izb1AlM+sYsb2jEtsenykQQwQ jL3e8NwUHMl5vQt71zzC4JU/ZE0Z3wHZN0SiaasNxZtjM9J+T7Z/M2CSRI7yhnCLOAi2 P8Xb/RQje9P3370mx32LCc1b8YgBM5HMQ8Il6cC2yaU+22Kj3JhTYnx2Vau1SmrrsbAF ftDK2yHyb6ABpZ6SlZamEcS8Ngaytjc4/ad5ktHX9SWYG/97K3v9mpnUZ93gp6l2DfuX yBnLeaH7nV3ouWfRrH5LEgUmV2EtWRT60ew965Ene9IznPrEl/nxYJ136kWR6VWmZpUD XsEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sersNdtz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jc12-20020a17090325cc00b001ac741db80asi4408271plb.236.2023.05.11.05.11.05; Thu, 11 May 2023 05:11:21 -0700 (PDT) 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=@linaro.org header.s=google header.b=sersNdtz; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237984AbjEKMBA (ORCPT + 99 others); Thu, 11 May 2023 08:01:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237977AbjEKMAX (ORCPT ); Thu, 11 May 2023 08:00:23 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6820EAD3A for ; Thu, 11 May 2023 04:59:57 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4f22908a082so6545673e87.1 for ; Thu, 11 May 2023 04:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806395; x=1686398395; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ldVw9wlzEkzEKLn5PMVleGqWnYMQxC7MlxWwEOwXVk4=; b=sersNdtzW5iLzGVupNMmSJvBYmwrZ//xZBxoOUDkXI1JTW4CI6ctj4FhudGratDn9k cRnkGze5UhsFvb3lR7Z7ykzxMMc0MSELwIy7erx+30m7guaXslAKu512vsaLide2fBN8 bzO6LMr/4P01YQk5JchLInzlvvtZaYnfs9CHAIEYLUvt9rNDqzoX36kf+ZRPAeMUF63R CCLsu72Nt/qnplWuj/eGGivCt82mEPHLpvvAQfOpT7G7x9ZKs78aN4p4kFH/Q3ORHnfo F+xP25avZTDsQROtfUVMJN8MesmV4EWv4hDtLKEn2U2w6S7bTHItXBK0WvgvggA3JEzW 4KRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806395; x=1686398395; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ldVw9wlzEkzEKLn5PMVleGqWnYMQxC7MlxWwEOwXVk4=; b=VVpo9oegWEdzAGQzk+Bp+bkuYc10GSGQAvj8kW+OpGeEbZI+/cuLN4bmjm+D8ayzJL EbMNUQbIAT6XFggSbUkX7D4FRCf3REquZzwDg6J48ZfB0zi79g9mM10IP97x1/tYRyyf xNmmEOsvbFAwHxszwoinELiz1WZgsfgXDqyZcvfSZnvohSdRAIjHjvhj74uDtaumbKkJ bcqGHDWdEgOWPYO2OyUhO9+ydBkdYB2YZN2IEEmzcke6Qm6RQigtbA3CJWoUnYcQUIHE d1L8go8o454EaObwLl+9ff3iuCCNBv5EkbLFoOhsNIPkVv/kuZAL24gNOUeKoj5jLRMO 549g== X-Gm-Message-State: AC+VfDzm0WGHHUZkebMz5TjiIAi7OHYpW3gt58uvB5KnofSqAOfiaIBm npMHQ2WhagvBZ4hOusYSHyiVTg== X-Received: by 2002:ac2:5339:0:b0:4ef:f725:ae2f with SMTP id f25-20020ac25339000000b004eff725ae2fmr3438930lfh.37.1683806395538; Thu, 11 May 2023 04:59:55 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:55 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:26 +0200 Subject: [PATCH 09/12] asm-generic/page.h: Make pfn accessors static inlines MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-9-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599694547255829?= X-GMAIL-MSGID: =?utf-8?q?1765599694547255829?= Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as arguments without warnings. For symmetry we do the same change for pfn_to_virt. Immediately define virt_to_pfn and pfn_to_virt to the static inline after the static inline since this style of defining functions is used for the generic helpers. Signed-off-by: Linus Walleij --- include/asm-generic/page.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/asm-generic/page.h b/include/asm-generic/page.h index c0be2edeb484..e8ef12bb858c 100644 --- a/include/asm-generic/page.h +++ b/include/asm-generic/page.h @@ -74,8 +74,16 @@ extern unsigned long memory_end; #define __va(x) ((void *)((unsigned long) (x))) #define __pa(x) ((unsigned long) (x)) -#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) -#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) +static inline unsigned long virt_to_pfn(const void *kaddr) +{ + return __pa(kaddr) >> PAGE_SHIFT; +} +#define virt_to_pfn virt_to_pfn +static inline void * pfn_to_virt(unsigned long pfn) +{ + return __va(pfn) << PAGE_SHIFT; +} +#define pfn_to_virt pfn_to_virt #define virt_to_page(addr) pfn_to_page(virt_to_pfn(addr)) #define page_to_virt(page) pfn_to_virt(page_to_pfn(page)) From patchwork Thu May 11 11:59:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92493 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4312380vqo; Thu, 11 May 2023 05:03:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72G1E2k1XNxZGkwbT0adJ+9SadpSF36uIft/QEgD+COZavoOHD1kVtGyYFWEP0tKJ4qwO4 X-Received: by 2002:a05:6a20:8ed5:b0:d3:78ab:77c3 with SMTP id m21-20020a056a208ed500b000d378ab77c3mr20631865pzk.48.1683806588454; Thu, 11 May 2023 05:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683806588; cv=none; d=google.com; s=arc-20160816; b=Ucf5pAtoSha707ZAzyGyfOrJN5TpDi1M/GQS2hwg1KpyfRz9zimP/SARxNFn69tpdY 1gJMXwl71E5dM0rAyj3z5P4baulghw4BRVYLQU+hLjDw2VQetSOnoiq49Ghowz37U2lO MNtI1RwtiTTn03rlZVkCDy1fAHdepZLrPSs+oYFbFKlktlNG4n5WhXuaMqx3O7sQXznB wrORttQGlJYq89jY4mTWYK/NYIE64gXym2gHtnoF3+ZSfK0yCZacvxHaz/BRHpyqj7i7 tuPDXVeeHxtDm4/G//v0GbbIVBiH0/Ugt2tBAIUyeEz+o+QrinaHKTrnrA61mJUqzWU1 bruQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=byQ7R65S71m0wzPqbiFWNKE9LKN0vAgU/hu26mJ4Tao=; b=iZa6dBsDodqNGnF8QQrzeofVCC2zJsGzXokbA0hksQVUEjJFUcbvKRZ2UXhLoMo6za QzAXu+3c1CUOKbV6Ku6kNrkkAeb9MIdVkuWqVFxKlVbj1EbkWAlmLhDXr5bywhr5/lK6 Kta/r0h6t7HgNJ3LV+K4bzEQTdRVgys4s+zHbc5CtJXvlYqqowlnuz+QJ9gMkimUomUk GqEmb48WrmJ98yDYLIpQ9/TM3DYNqfVYCuEeCnoIjWV4q0KRqrPebQ3PlLRq98ocaoKX QPZ/T9qmW4vkA9N3CWmppXmWncFFdpfUA0/PT5cj2KLOCAjEpEIwE52I7RBl8Y1hu/LM 0RYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SV4lRVCF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a63770a000000b0052c885da616si7453011pgc.337.2023.05.11.05.02.50; Thu, 11 May 2023 05:03:08 -0700 (PDT) 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=@linaro.org header.s=google header.b=SV4lRVCF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237992AbjEKMBR (ORCPT + 99 others); Thu, 11 May 2023 08:01:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237990AbjEKMA0 (ORCPT ); Thu, 11 May 2023 08:00:26 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AF31902C for ; Thu, 11 May 2023 04:59:58 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f2676d62a2so1433952e87.0 for ; Thu, 11 May 2023 04:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806396; x=1686398396; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=byQ7R65S71m0wzPqbiFWNKE9LKN0vAgU/hu26mJ4Tao=; b=SV4lRVCFMmersreYOjmSW971gmQ2k/8Uwwou00kmIQ8qW7kbepgHHt+Gv8NHdL+qP4 hQBy4MmBgba0NKNJxOETBQL5faNb/62CnZS66vPmxJrFO+jAIaYtkca24bjmBP86W5a5 qELMWSA/byxFHLVuEF0ujDjjYh7ZHm534gUg2Tt57sbF6pxRS/eJt7n0SrxRgguPVjG1 o55XE8RRLLx1tSq+3tZWyspkZ7kPW/dUjPFoEbCdhLjD4eNIZVbxQnxrtkONX8M7iIwg k6+wEGejTys30v+oFvAxEEdhHXIqyEd7MVCLttBSSVH1q9rhA37XuFsf8KAnalbOFsXD 5wsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806396; x=1686398396; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=byQ7R65S71m0wzPqbiFWNKE9LKN0vAgU/hu26mJ4Tao=; b=W0Xu40SR7soWDpxYNPq2yh5nFplKIgu4F+D7LUOp4rCN97oubmsgetFrTB1i+Y5NVU vA4Jd3A+tR89PmAAEqBmbHZN93YPC0szTExLS3yFc9bidAooT9yUHpklRVYWelD6oUtD /J1nWf17d3Qx4EwMKoeyXQSq5hj2dkaApYRvw8YniyRXP4wfUtV9Ntv8sQYsi2DtJPh7 8hJPlvUyT8ZXVfLc0R2/U70iDL0lB6RwME5HtX3PZunyd7POYkGDyaeR+8tQc2FFOluI nJsNaFIpMCFk14B670LulX5ZbgA+052xzoCDreT7EuuKrGnAxTMmHwUjTzgnfm1YwRxJ 0org== X-Gm-Message-State: AC+VfDxZIYDcGSAYuiDFFTRjcaLDzWWXuARXyYyCqa6eBJTH9r9+Tixc AVFkenbGrt6pjzNRbzyNrFuHkA== X-Received: by 2002:ac2:5dc4:0:b0:4ef:6ed9:7af2 with SMTP id x4-20020ac25dc4000000b004ef6ed97af2mr2800664lfq.8.1683806396448; Thu, 11 May 2023 04:59:56 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:56 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:27 +0200 Subject: [PATCH 10/12] ARM: mm: Make virt_to_pfn() a static inline MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-10-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599177363856030?= X-GMAIL-MSGID: =?utf-8?q?1765599177363856030?= Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as arguments without warnings. Doing this is a bit intrusive: virt_to_pfn() requires PHYS_PFN_OFFSET and PAGE_SHIFT to be defined, and this is defined in , so this must be included *before* . The use of macros were obscuring the unclear inclusion order here, as the macros would eventually be resolved, but a static inline like this cannot be compiled with unresolved macros. The naive solution to include at the top of does not work, because sometimes includes at the end of itself, which would create a confusing inclusion loop. So instead, take the approach to always unconditionally include at the end of arch/arm uses explicitly in a lot of places, however it turns out that if we just unconditionally include into and switch all inclusions of to instead, we enforce the right order and will always have access to the definitions. Put an inclusion guard in place making it impossible to include explicitly. Link: https://lore.kernel.org/linux-mm/20220701160004.2ffff4e5ab59a55499f4c736@linux-foundation.org/ Signed-off-by: Linus Walleij --- Russell: the vs inclusion really gave me headaches, if you have a better idea how to do it I'm all ears! --- arch/arm/common/sharpsl_param.c | 2 +- arch/arm/include/asm/delay.h | 2 +- arch/arm/include/asm/io.h | 2 +- arch/arm/include/asm/memory.h | 17 ++++++++++++----- arch/arm/include/asm/page.h | 4 ++-- arch/arm/include/asm/pgtable.h | 2 +- arch/arm/include/asm/proc-fns.h | 2 -- arch/arm/include/asm/sparsemem.h | 2 +- arch/arm/include/asm/uaccess-asm.h | 2 +- arch/arm/include/asm/uaccess.h | 2 +- arch/arm/kernel/asm-offsets.c | 2 +- arch/arm/kernel/entry-armv.S | 2 +- arch/arm/kernel/entry-common.S | 2 +- arch/arm/kernel/entry-v7m.S | 2 +- arch/arm/kernel/head-nommu.S | 3 +-- arch/arm/kernel/head.S | 2 +- arch/arm/kernel/hibernate.c | 2 +- arch/arm/kernel/suspend.c | 2 +- arch/arm/kernel/tcm.c | 2 +- arch/arm/kernel/vmlinux-xip.lds.S | 3 +-- arch/arm/kernel/vmlinux.lds.S | 3 +-- arch/arm/mach-berlin/platsmp.c | 2 +- arch/arm/mach-keystone/keystone.c | 2 +- arch/arm/mach-omap2/sleep33xx.S | 2 +- arch/arm/mach-omap2/sleep43xx.S | 2 +- arch/arm/mach-omap2/sleep44xx.S | 2 +- arch/arm/mach-pxa/gumstix.c | 2 +- arch/arm/mach-rockchip/sleep.S | 2 +- arch/arm/mach-sa1100/pm.c | 2 +- arch/arm/mach-shmobile/headsmp-scu.S | 2 +- arch/arm/mach-shmobile/headsmp.S | 2 +- arch/arm/mach-socfpga/headsmp.S | 2 +- arch/arm/mach-spear/spear.h | 2 +- arch/arm/mm/cache-fa.S | 1 - arch/arm/mm/cache-v4wb.S | 1 - arch/arm/mm/dma-mapping.c | 2 +- arch/arm/mm/dump.c | 2 +- arch/arm/mm/init.c | 2 +- arch/arm/mm/kasan_init.c | 1 - arch/arm/mm/mmu.c | 2 +- arch/arm/mm/physaddr.c | 2 +- arch/arm/mm/pmsa-v8.c | 2 +- arch/arm/mm/proc-v7.S | 2 +- arch/arm/mm/proc-v7m.S | 2 +- arch/arm/mm/pv-fixup-asm.S | 2 +- drivers/memory/ti-emif-sram-pm.S | 2 +- 46 files changed, 54 insertions(+), 55 deletions(-) diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c index 6237ede2f0c7..1ca26c063f80 100644 --- a/arch/arm/common/sharpsl_param.c +++ b/arch/arm/common/sharpsl_param.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include /* * Certain hardware parameters determined at the time of device manufacture, diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h index 4f80b72372b4..1d069e558d8d 100644 --- a/arch/arm/include/asm/delay.h +++ b/arch/arm/include/asm/delay.h @@ -7,7 +7,7 @@ #ifndef __ASM_ARM_DELAY_H #define __ASM_ARM_DELAY_H -#include +#include #include /* HZ */ /* diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 7fcdc785366c..56b08ed6cc3b 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include /* diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 62e9df024445..ef2aa79ece5a 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -5,11 +5,16 @@ * Copyright (C) 2000-2002 Russell King * modification for nommu, Hyok S. Choi, 2004 * - * Note: this file should not be included by non-asm/.h files + * Note: this file should not be included explicitly, include + * to get access to these definitions. */ #ifndef __ASM_ARM_MEMORY_H #define __ASM_ARM_MEMORY_H +#ifndef _ASMARM_PAGE_H +#error "Do not include directly" +#endif + #include #include #include @@ -288,10 +293,12 @@ static inline unsigned long __phys_to_virt(phys_addr_t x) #endif -#define virt_to_pfn(kaddr) \ - ((((unsigned long)(kaddr) - PAGE_OFFSET) >> PAGE_SHIFT) + \ - PHYS_PFN_OFFSET) - +static inline unsigned long virt_to_pfn(const void *p) +{ + unsigned long kaddr = (unsigned long)p; + return (((kaddr - PAGE_OFFSET) >> PAGE_SHIFT) + + PHYS_PFN_OFFSET); +} #define __pa_symbol_nodebug(x) __virt_to_phys_nodebug((x)) #ifdef CONFIG_DEBUG_VIRTUAL diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h index 74bb5947b387..4e44f9707376 100644 --- a/arch/arm/include/asm/page.h +++ b/arch/arm/include/asm/page.h @@ -161,10 +161,10 @@ extern int pfn_valid(unsigned long); #define pfn_valid pfn_valid #endif -#include - #endif /* !__ASSEMBLY__ */ +#include + #define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_TSK_EXEC #include diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index a58ccbb406ad..34662a9d4cab 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h @@ -27,7 +27,7 @@ extern struct page *empty_zero_page; #else #include -#include +#include #include diff --git a/arch/arm/include/asm/proc-fns.h b/arch/arm/include/asm/proc-fns.h index c82f7a29ec4a..280396483f5d 100644 --- a/arch/arm/include/asm/proc-fns.h +++ b/arch/arm/include/asm/proc-fns.h @@ -147,8 +147,6 @@ static inline void init_proc_vtable(const struct processor *p) extern void cpu_resume(void); -#include - #ifdef CONFIG_MMU #define cpu_switch_mm(pgd,mm) cpu_do_switch_mm(virt_to_phys(pgd),mm) diff --git a/arch/arm/include/asm/sparsemem.h b/arch/arm/include/asm/sparsemem.h index d362233856a5..421e3415338a 100644 --- a/arch/arm/include/asm/sparsemem.h +++ b/arch/arm/include/asm/sparsemem.h @@ -2,7 +2,7 @@ #ifndef ASMARM_SPARSEMEM_H #define ASMARM_SPARSEMEM_H -#include +#include /* * Two definitions are required for sparsemem: diff --git a/arch/arm/include/asm/uaccess-asm.h b/arch/arm/include/asm/uaccess-asm.h index 6451a433912c..65da32e1f1c1 100644 --- a/arch/arm/include/asm/uaccess-asm.h +++ b/arch/arm/include/asm/uaccess-asm.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include .macro csdb diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 2fcbec9c306c..bb5c81823117 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -9,7 +9,7 @@ * User space memory access functions */ #include -#include +#include #include #include #include diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 38121c59cbc2..6a80d4be743b 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index c39303e5c234..112fd6cd3f26 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 03d4c5578c5c..bcc4c9ec3aa4 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -9,7 +9,7 @@ #include #include #include -#include +#include #ifdef CONFIG_AEABI #include #endif diff --git a/arch/arm/kernel/entry-v7m.S b/arch/arm/kernel/entry-v7m.S index de8a60363c85..52bacf07ba16 100644 --- a/arch/arm/kernel/entry-v7m.S +++ b/arch/arm/kernel/entry-v7m.S @@ -6,7 +6,7 @@ * * Low-level vector interface routines for the ARMv7-M architecture */ -#include +#include #include #include #include diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S index 950bef83339f..b9d6818f1ee1 100644 --- a/arch/arm/kernel/head-nommu.S +++ b/arch/arm/kernel/head-nommu.S @@ -14,12 +14,11 @@ #include #include #include -#include +#include #include #include #include #include -#include /* * Kernel startup entry point. diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 656991055bc1..1ec35f065617 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_SEMIHOSTING) diff --git a/arch/arm/kernel/hibernate.c b/arch/arm/kernel/hibernate.c index 2373020af965..38a90a3d12b2 100644 --- a/arch/arm/kernel/hibernate.c +++ b/arch/arm/kernel/hibernate.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include "reboot.h" diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c index 43f0a3ebf390..c3ec3861dd07 100644 --- a/arch/arm/kernel/suspend.c +++ b/arch/arm/kernel/suspend.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/kernel/tcm.c b/arch/arm/kernel/tcm.c index d3a85f01b328..f59927bcfbce 100644 --- a/arch/arm/kernel/tcm.c +++ b/arch/arm/kernel/tcm.c @@ -15,7 +15,7 @@ #include /* memcpy */ #include #include -#include +#include #include #include #include diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S index 76678732c60d..c16d196b5aad 100644 --- a/arch/arm/kernel/vmlinux-xip.lds.S +++ b/arch/arm/kernel/vmlinux-xip.lds.S @@ -12,9 +12,8 @@ #include #include #include -#include -#include #include +#include OUTPUT_ARCH(arm) ENTRY(stext) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index aa12b65a7fd6..bd9127c4b451 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -12,9 +12,8 @@ #include #include #include -#include -#include #include +#include OUTPUT_ARCH(arm) ENTRY(stext) diff --git a/arch/arm/mach-berlin/platsmp.c b/arch/arm/mach-berlin/platsmp.c index 593fc4a69d84..ed94758d30ff 100644 --- a/arch/arm/mach-berlin/platsmp.c +++ b/arch/arm/mach-berlin/platsmp.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include diff --git a/arch/arm/mach-keystone/keystone.c b/arch/arm/mach-keystone/keystone.c index aa352c2de313..68039aad3014 100644 --- a/arch/arm/mach-keystone/keystone.c +++ b/arch/arm/mach-keystone/keystone.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "memory.h" diff --git a/arch/arm/mach-omap2/sleep33xx.S b/arch/arm/mach-omap2/sleep33xx.S index ac3d0b363c51..3bfd8b5e03ed 100644 --- a/arch/arm/mach-omap2/sleep33xx.S +++ b/arch/arm/mach-omap2/sleep33xx.S @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "iomap.h" #include "cm33xx.h" diff --git a/arch/arm/mach-omap2/sleep43xx.S b/arch/arm/mach-omap2/sleep43xx.S index 832c91327945..ec0972a48f08 100644 --- a/arch/arm/mach-omap2/sleep43xx.S +++ b/arch/arm/mach-omap2/sleep43xx.S @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include "cm33xx.h" #include "common.h" diff --git a/arch/arm/mach-omap2/sleep44xx.S b/arch/arm/mach-omap2/sleep44xx.S index f60f6a9aed73..f09c9197808b 100644 --- a/arch/arm/mach-omap2/sleep44xx.S +++ b/arch/arm/mach-omap2/sleep44xx.S @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "omap-secure.h" diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c index 72b08a9bf0fd..ebeee82e649e 100644 --- a/arch/arm/mach-pxa/gumstix.c +++ b/arch/arm/mach-pxa/gumstix.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-rockchip/sleep.S b/arch/arm/mach-rockchip/sleep.S index 3eca3922c944..38b6c5186c3c 100644 --- a/arch/arm/mach-rockchip/sleep.S +++ b/arch/arm/mach-rockchip/sleep.S @@ -6,7 +6,7 @@ #include #include -#include +#include .data /* diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c index 9a7079f565bd..9cf5d917bb92 100644 --- a/arch/arm/mach-sa1100/pm.c +++ b/arch/arm/mach-sa1100/pm.c @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include diff --git a/arch/arm/mach-shmobile/headsmp-scu.S b/arch/arm/mach-shmobile/headsmp-scu.S index d0234296ae62..e892ee794d64 100644 --- a/arch/arm/mach-shmobile/headsmp-scu.S +++ b/arch/arm/mach-shmobile/headsmp-scu.S @@ -7,7 +7,7 @@ #include #include -#include +#include /* * Boot code for secondary CPUs. diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S index 9466ae61f56a..a956b489b6ea 100644 --- a/arch/arm/mach-shmobile/headsmp.S +++ b/arch/arm/mach-shmobile/headsmp.S @@ -11,7 +11,7 @@ #include #include #include -#include +#include #define SCTLR_MMU 0x01 #define BOOTROM_ADDRESS 0xE6340000 diff --git a/arch/arm/mach-socfpga/headsmp.S b/arch/arm/mach-socfpga/headsmp.S index 54f1844eac03..f7e91a772428 100644 --- a/arch/arm/mach-socfpga/headsmp.S +++ b/arch/arm/mach-socfpga/headsmp.S @@ -6,7 +6,7 @@ */ #include #include -#include +#include #include .arch armv7-a diff --git a/arch/arm/mach-spear/spear.h b/arch/arm/mach-spear/spear.h index 432efd407c76..f23eaf1e522f 100644 --- a/arch/arm/mach-spear/spear.h +++ b/arch/arm/mach-spear/spear.h @@ -10,7 +10,7 @@ #ifndef __MACH_SPEAR_H #define __MACH_SPEAR_H -#include +#include #if defined(CONFIG_ARCH_SPEAR3XX) || defined (CONFIG_ARCH_SPEAR6XX) diff --git a/arch/arm/mm/cache-fa.S b/arch/arm/mm/cache-fa.S index 3a464d1649b4..71c64e92dead 100644 --- a/arch/arm/mm/cache-fa.S +++ b/arch/arm/mm/cache-fa.S @@ -13,7 +13,6 @@ #include #include #include -#include #include #include "proc-macros.S" diff --git a/arch/arm/mm/cache-v4wb.S b/arch/arm/mm/cache-v4wb.S index 905ac2fa2b1e..ad382cee0fdb 100644 --- a/arch/arm/mm/cache-v4wb.S +++ b/arch/arm/mm/cache-v4wb.S @@ -7,7 +7,6 @@ #include #include #include -#include #include #include "proc-macros.S" diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index b4a33358d2e9..0549bee68a67 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c index 059eb4cdc9c2..a9381095ab36 100644 --- a/arch/arm/mm/dump.c +++ b/arch/arm/mm/dump.c @@ -15,7 +15,7 @@ #include #include -#include +#include #include static struct addr_marker address_markers[] = { diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index ce64bdb55a16..a42e4cd11db2 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/mm/kasan_init.c b/arch/arm/mm/kasan_init.c index 46d9f4a622cb..24d71b5db62d 100644 --- a/arch/arm/mm/kasan_init.c +++ b/arch/arm/mm/kasan_init.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 463fc2a8448f..22292cf3381c 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/arm/mm/physaddr.c b/arch/arm/mm/physaddr.c index cf75819e4c13..3f263c840ebc 100644 --- a/arch/arm/mm/physaddr.c +++ b/arch/arm/mm/physaddr.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/arch/arm/mm/pmsa-v8.c b/arch/arm/mm/pmsa-v8.c index 8359748a19a1..28cdc5468406 100644 --- a/arch/arm/mm/pmsa-v8.c +++ b/arch/arm/mm/pmsa-v8.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include "mm.h" diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 6b4ef9539b68..193c7aeb6703 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include "proc-macros.S" diff --git a/arch/arm/mm/proc-v7m.S b/arch/arm/mm/proc-v7m.S index 335144d50134..d65a12f851a9 100644 --- a/arch/arm/mm/proc-v7m.S +++ b/arch/arm/mm/proc-v7m.S @@ -9,7 +9,7 @@ */ #include #include -#include +#include #include #include "proc-macros.S" diff --git a/arch/arm/mm/pv-fixup-asm.S b/arch/arm/mm/pv-fixup-asm.S index f8e11f7c7880..1d9f52c71ad0 100644 --- a/arch/arm/mm/pv-fixup-asm.S +++ b/arch/arm/mm/pv-fixup-asm.S @@ -9,7 +9,7 @@ #include #include #include -#include +#include .section ".idmap.text", "ax" diff --git a/drivers/memory/ti-emif-sram-pm.S b/drivers/memory/ti-emif-sram-pm.S index d60a8cfd63f3..7756b3971244 100644 --- a/drivers/memory/ti-emif-sram-pm.S +++ b/drivers/memory/ti-emif-sram-pm.S @@ -8,7 +8,7 @@ #include #include -#include +#include #include "emif.h" #include "ti-emif-asm-offsets.h" From patchwork Thu May 11 11:59:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92494 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4313809vqo; Thu, 11 May 2023 05:04:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ77YVzC2ekDSJy1ZCx//0UHHsKQ7VUgs489rLY8ZGplMUdHYET8rQdAMulLuFWKXMfkajKx X-Received: by 2002:a05:6a20:7353:b0:fb:8140:cec6 with SMTP id v19-20020a056a20735300b000fb8140cec6mr25219778pzc.8.1683806684758; Thu, 11 May 2023 05:04:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683806684; cv=none; d=google.com; s=arc-20160816; b=gCHswfjQdsd7KQQHpgap2l+Yawo8rra+8q7s+GT5MTH//ISsjkUqkgBYDr4l98+EYg eiYnmUai1oZjmg0xQut9107YKFoGLAbnzxpCCRx1VybfoizLyvzThFfIh7j2WlSssFF6 fXCaqSVobjtYwcdMhlaDDbNuqsIMvsQaXDUvx6vz6rVZ1IBCUfj0wNzYdr5yhlk6j+Rs kT8TpMdJP3Ba1UBVJZ8JlfUol6yGOqyzYHFL3NpNfAMYeyq2GnidZGJbf5fTJCYRr5DY ZJBmIwNiX8NwMxABaioUkByWG5PgBNV+KsB6T3J47DjZCmYgfuTOVjN/TFJMutCI+c27 Ji1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=uJU163QagIQsrvP5Rw+8jaAtPEKkrWxHz6dgH9Ny+pM=; b=OSeC4RZuMIL3nwD8c7GAlyjMCx+tQgKbS+Xu2gEbPL6VApznBl/yk6IZ1JRtH4KK4b 5DwfGXofSTwHW5BSCubaz5kjZ6cJo9+39NP7dLnyocTlmKFfOUEDyPeHAK5PBx7Z1pR6 MY9k9ji/UjLfR5uarHifhbwvWUUhlRhULasfksoCz1X42KArr8ByYBjh4/GW8SvMnOMC PCtUvbhlyOKKlRE4o96KO1habf+sHdGpw2m4drJSKq7coV+9D1dB3YOSW9ubGziRKV1C dYDRvpdQs001/DlRm4ljJMJhtisGORItzCZxBTVdZJvq+VbPWzFOX94+HxJExPBbZmbb cswA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OVzygYKF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a63770a000000b0052c885da616si7453011pgc.337.2023.05.11.05.04.11; Thu, 11 May 2023 05:04:44 -0700 (PDT) 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=@linaro.org header.s=google header.b=OVzygYKF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238091AbjEKMBT (ORCPT + 99 others); Thu, 11 May 2023 08:01:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237989AbjEKMA0 (ORCPT ); Thu, 11 May 2023 08:00:26 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F19A7D050 for ; Thu, 11 May 2023 04:59:57 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4effb818c37so9655020e87.3 for ; Thu, 11 May 2023 04:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806397; x=1686398397; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=uJU163QagIQsrvP5Rw+8jaAtPEKkrWxHz6dgH9Ny+pM=; b=OVzygYKFGH1TTuxbFUj+CoSj3NrTaizXuR71JpjrxDkWl2PVUYhH5JT70fm6co/+NH tgSpK7iB7XOIFx/oZ27wrlRvxiiOU0TkhphL4Cjxz38b+G77ryH+u4qiryaQVZOcLNF0 H0/G73Db2ZLdNZ+R+FwIBPtPTT8FO9chca9MkRhxDx0g0MNcweB6mimyP670IWhPwMJJ Zi33byy7BPYmwDP7tGDqy3rZxw7unhbkfjS7DQcxkZzUfpvfhpgVrM2yoH5+zUDj/FTE k6lQKniemblf8dnVu3vStZsdx03og3rxM39S2DuvQLZfuDbOnEOTZqUyvlVqW9qAn7Vc 1b6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806397; x=1686398397; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uJU163QagIQsrvP5Rw+8jaAtPEKkrWxHz6dgH9Ny+pM=; b=hFn06hG4Y1kEAoK3aRmXFFq5VvOMeE9Kb83wQmyyl/BIobIzLpo+PlRNVqD+kAsMEl pDvq3likdkd+g8NiUfEY0+sA1ZoyTSc+76N4YvrmmCW5Uv+iHgBe1DNyT0HFH2+YWvUz IgynAxEz+g1ZZcSYnmLelos29WYBrYWbSubQ2s8uIIYHtIvYR60qWz0uH3za1XTh2PHh 2ug1T2uGEUsNhpelHSa3yUK0/PCuAwA4/qaCl+wsc30my7y49ThqOKr5RrHDlDoBFY8x thkyyTR1a5HRhbd8ySs3P1v6LL/0b9Ilq8Q949ypfXX6iKA4g6tStme48FDWA8ZNqHJ0 tz+g== X-Gm-Message-State: AC+VfDy8aqEJI8wzdd5zaLBLSUsxZbTfRsFNX0KXFzzMSop/H/4Xw5ea laUuOF6JLkgFE4Yi0iQ0LRAAEw== X-Received: by 2002:a19:ad43:0:b0:4ef:d5fb:c37c with SMTP id s3-20020a19ad43000000b004efd5fbc37cmr2214552lfd.69.1683806397378; Thu, 11 May 2023 04:59:57 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:57 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:28 +0200 Subject: [PATCH 11/12] arm64: memory: Make virt_to_pfn() a static inline MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-11-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599278261121061?= X-GMAIL-MSGID: =?utf-8?q?1765599278261121061?= Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as arguments without warnings. Since arm64 is using to provide __phys_to_pfn() we need to move the inclusion of that header up, so we can resolve the static inline at compile time. Signed-off-by: Linus Walleij Acked-by: Catalin Marinas --- arch/arm64/include/asm/memory.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index c735afdf639b..4d85212b622e 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -331,6 +331,14 @@ static inline void *phys_to_virt(phys_addr_t x) return (void *)(__phys_to_virt(x)); } +/* Needed already here for resolving __phys_to_pfn() in virt_to_pfn() */ +#include + +static inline unsigned long virt_to_pfn(const void *kaddr) +{ + return __phys_to_pfn(virt_to_phys(kaddr)); +} + /* * Drivers should NOT use these either. */ @@ -339,7 +347,6 @@ static inline void *phys_to_virt(phys_addr_t x) #define __pa_nodebug(x) __virt_to_phys_nodebug((unsigned long)(x)) #define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x))) #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) -#define virt_to_pfn(x) __phys_to_pfn(__virt_to_phys((unsigned long)(x))) #define sym_to_pfn(x) __phys_to_pfn(__pa_symbol(x)) /* From patchwork Thu May 11 11:59:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4318289vqo; Thu, 11 May 2023 05:10:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4XYob2Hj4JMjh2z14dD7fasz4Gm0NU83F3zga7l/IpJ491rLnqk8TqjSTlbKZtmY2ptfI3 X-Received: by 2002:a17:902:ea0c:b0:1a6:4a64:4d27 with SMTP id s12-20020a170902ea0c00b001a64a644d27mr28780782plg.40.1683807021143; Thu, 11 May 2023 05:10:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683807021; cv=none; d=google.com; s=arc-20160816; b=GI8kt1THUx4fhHVbX3HvqKmxKDrZANOe+7LTmsZcQAFkF6lRDtATNW3p4t50lm0AxC S/RnXKAKvaD500jz6H4k9gFO24bobBERkNUFRKCQC2zGzfHGl0GyNfpEdTKQKeK03W/Q Sco8xcZ1EqMH/ddIxCXI2Ck/7sOuyJi+HrpX6ho3cwX2DkOzC6YZSxj1ih2W/uZApMuV T3OtoSFzaxOICVd+zBZyEfwMHBvKcwj0fAaz03is6XmokjEJjWinRZX9WqhaJ/EQRe2+ 9DrL08Feqml130kCK6l36AZS/N6gED5TOr7FpsQg03GejGxDzanUfxd3Zz5TqHOCjl0f uQrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=vHjA668SX6CTsxzYO8Z8nc4Ecy//EJfwtQFWj2t6kqU=; b=WHGraSQz4/d2cYkGFkCc0tErzURmFxkc5L4z8mcTkhrrfYHbMV+bGckjZK2LPqKX1t E8RCMNPSXvNgNbqz3BQWicjwH7iAVwVE2reyyzUVLk3rdbg1+m4op2FBO+cdS3Oo49xn 4bbxxl89VeHefzhQW2p5sdIEHzLHaEGRu/nNp6wboX4Q1uKrHiK2lZ1uubjzzPe5dMWo j7p3Af46Rl5A0sy6KYzdJPmMP5FG89TTcqmpQZnCPIFmiq4GTF4p613OGy9Ifo85qzFI xgVy35g1Y3eQyRVUqjeB+ATg1cYStFK5Nbtrxx7TDjkQnV9tWkHI8aMaUNTmX7QXfRA8 CDMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kbc555pc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o16-20020a170902779000b001ac82e60516si6047881pll.323.2023.05.11.05.10.05; Thu, 11 May 2023 05:10:21 -0700 (PDT) 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=@linaro.org header.s=google header.b=Kbc555pc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238006AbjEKMB0 (ORCPT + 99 others); Thu, 11 May 2023 08:01:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238008AbjEKMA1 (ORCPT ); Thu, 11 May 2023 08:00:27 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E446A266 for ; Thu, 11 May 2023 05:00:01 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4eed764a10cso9484225e87.0 for ; Thu, 11 May 2023 05:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683806399; x=1686398399; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=vHjA668SX6CTsxzYO8Z8nc4Ecy//EJfwtQFWj2t6kqU=; b=Kbc555pcdKJLogrS9D2fpTuZbCLYtRRslUUmtE3xLf7EzdNZYf1OzcE9wV1Z90iGk3 NIk4MKV6b+X0k2N3VL5lQ56i9UXtaetINfk3JT4UgzFD7yBuaWIOfZWXEKT5PzupCvP/ bamqIQqMgGCRriAPRj2xemXl7nSVYfhgFkSm0NP8XdgPgFP+JDpOUwXIwzQsFylS4IVi tfsy8c7iyORHTNygYljmk4DBR7XlBqGcbH84OblELC60Ek8nQDNUr7Skn4YvyNLuLFxu E+aTQ0Z1NbLg7cPj3DH6p8fVNfeCCf6YY3IJLOUYGk/XToeDr9UU3eGzOCWV1mI1abGA My9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683806399; x=1686398399; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vHjA668SX6CTsxzYO8Z8nc4Ecy//EJfwtQFWj2t6kqU=; b=D/ZeSvSBQFeZkJ78puo/I8sJvfCoj06+KPZl3MTG+e0RX6Q21LRCsK4tCPK752/UCU IJH1MCh+Uwl6Or9K1F5T3DhOyB3YFdNn375h9f/2hnaYrBHArGQTYh2Wvz70kelWE5lz MIhwBwdYrZ3bkBi63Jz4kzrL417BrUc6omcaA9HrPvB8dXMxxWSfEc5WPgiALGuh7Jd6 3i+9JE6Fv2xMmb3rvOI23nJN16i+1MTjkUF0/0oHRivgjDxD2qD90dWK0wnWV3rKYsnh pl7znFr+GFWWPj4bzHeX/Ko9or6h2G8+x1Y5ftSTYK6w62wi+UoSSGQ9nnTbSmTphDK3 e/bg== X-Gm-Message-State: AC+VfDz0FVQ259KV5pJB7RQzqaV5SghIkLfZGxn0KxDp0G2OYPuT/SXq ON8FM5Feh67ox8HfS2ujHgDnXw== X-Received: by 2002:ac2:4e51:0:b0:4ee:e10f:8e5d with SMTP id f17-20020ac24e51000000b004eee10f8e5dmr2439363lfr.4.1683806398938; Thu, 11 May 2023 04:59:58 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id f16-20020ac25090000000b004cb23904bd9sm1100841lfm.144.2023.05.11.04.59.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 04:59:58 -0700 (PDT) From: Linus Walleij Date: Thu, 11 May 2023 13:59:29 +0200 Subject: [PATCH 12/12] m68k/mm: Make pfn accessors static inlines MIME-Version: 1.0 Message-Id: <20230503-virt-to-pfn-v6-4-rc1-v1-12-6c4698dcf9c8@linaro.org> References: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> In-Reply-To: <20230503-virt-to-pfn-v6-4-rc1-v1-0-6c4698dcf9c8@linaro.org> To: Geert Uytterhoeven , Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.1 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765599630922373164?= X-GMAIL-MSGID: =?utf-8?q?1765599630922373164?= Making virt_to_pfn() a static inline taking a strongly typed (const void *) makes the contract of a passing a pointer of that type to the function explicit and exposes any misuse of the macro virt_to_pfn() acting polymorphic and accepting many types such as (void *), (unitptr_t) or (unsigned long) as arguments without warnings. For symmetry, do the same with pfn_to_virt(). Signed-off-by: Linus Walleij --- arch/m68k/include/asm/page_mm.h | 11 +++++++++-- arch/m68k/include/asm/page_no.h | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h index 3903db2e8da7..40bcc6aa33da 100644 --- a/arch/m68k/include/asm/page_mm.h +++ b/arch/m68k/include/asm/page_mm.h @@ -121,8 +121,15 @@ static inline void *__va(unsigned long x) * TODO: implement (fast) pfn<->pgdat_idx conversion functions, this makes lots * of the shifts unnecessary. */ -#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) -#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) +static inline unsigned long virt_to_pfn(const void *kaddr) +{ + return __pa(kaddr) >> PAGE_SHIFT; +} + +static inline void * pfn_to_virt(unsigned long pfn) +{ + return __va(pfn << PAGE_SHIFT); +} extern int m68k_virt_to_node_shift; diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h index 060e4c0e7605..f1daf466a57b 100644 --- a/arch/m68k/include/asm/page_no.h +++ b/arch/m68k/include/asm/page_no.h @@ -19,8 +19,15 @@ extern unsigned long memory_end; #define __pa(vaddr) ((unsigned long)(vaddr)) #define __va(paddr) ((void *)((unsigned long)(paddr))) -#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) -#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) +static inline unsigned long virt_to_pfn(const void *kaddr) +{ + return __pa(kaddr) >> PAGE_SHIFT; +} + +static inline void * pfn_to_virt(unsigned long pfn) +{ + return __va(pfn << PAGE_SHIFT); +} #define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) #define page_to_virt(page) __va(((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET))