Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10040039rwr; Fri, 12 May 2023 03:00:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4wVyWrIge58zs+4qYdOUeqQRLuBosP6pY1fqSH8lcdBi5h0+RibXL2LFMfM6rPBZD6hyxP X-Received: by 2002:a17:90a:2981:b0:247:6be7:8cc0 with SMTP id h1-20020a17090a298100b002476be78cc0mr23372016pjd.35.1683885627240; Fri, 12 May 2023 03:00:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683885627; cv=none; d=google.com; s=arc-20160816; b=QjzNUDVGx9t8NknOxhV2SsEkFUW5LvUCwd+5y/qtnzmJdGg0ImWptI/9Ff0N6ZPOgG PvnlLOLmHfBSGCoeY2LQb5z4JEUHzoAFtPh/h+UExQ8ISiuasmMeHmkYWE4xjTRo2hyZ /VjoYPhBOXYTup2ly3aI5tyGB8ymrSaq9TY+NM8FD17tiYwdw6NSOAK+sz4sUj0e7uvz 8iE3sjHqBtX/l3OIKNGTb/kPa1ZAdW5ngDeD7QYKqfOYHHsQcHQZmyGczuklSqCN8QAo OTuiiucX/veW8ZguLqlcPYXGzIn5L40MwaHSsXS5KwsZQiUpBbAmwZt/pT/EYTWcNhGc dSEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=YBamFM8vwEZ3oSJYGhhDTo787h3g3JKLc8PVTJnqXiE=; b=yMRmHTWY6sRak8vTDfdlY4MOlJ63fPJahyV8tpYk3ZG0ykowuGg+P2n7wCFvbTWCfW xIZSyz1BQeWJO+nJOVgD0X2YZsBdY3/qbMtRTxWOqHKXrOYVm+bckDc7ZsVW+mQy7YQV YWhgKuKyFpuJmPrL4BEp9rA2T1U/9pHoCgnUMIxC5JZc3j1OYHbS9guRoXCQWfhmQmtT +cfXUoKTj8Q6D2gQxfb/VjDkoQQ9K8xM4YhDE2yWyqYL6/Jp59gHwaxD4bPBJKsv/+ZN PNbKgx+uiGzJ+SAbW8jyhZTQQXS+j/f9hc2s8rzDB2ViKTnSGRQdvqrZHY65+UHROMoE uzPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a17090a8a0b00b0024dee3457b1si22456661pjn.49.2023.05.12.03.00.12; Fri, 12 May 2023 03:00:27 -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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240442AbjELJ5y convert rfc822-to-8bit (ORCPT + 99 others); Fri, 12 May 2023 05:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240449AbjELJ5r (ORCPT ); Fri, 12 May 2023 05:57:47 -0400 Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0EE118C; Fri, 12 May 2023 02:57:20 -0700 (PDT) Received: by mail-yb1-f175.google.com with SMTP id 3f1490d57ef6-b9d8b458e10so12375654276.1; Fri, 12 May 2023 02:57:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683885440; x=1686477440; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=27/Fbt6wOw+aeS9WaGgothEj3OntQ06F+YuUTxkvogA=; b=dbx3Y1x+1axQQiceI8mRcHF3mG3OLNwLg+fpbFOaET0DgQZyGXO7CkO4H8ZG864zpP Q1XIoRsTPm7WmrzNvHfZrJHAbUQbwOA4bMCIRSB/dGAQYWArCUH6tWlRUxbhZDM1jMKo L+kpkhZd8i7+3Z9G0wslPz1Nk0mCM3o/v9XZxorWKviFYRLaDI430iC4eD1VaaRHBNE+ pnIvojaFvzsUTfy88FwjqA8GO6WtIdIorfXmHM+8Pi74DIXoa0A8x7+JPbf9BvjETPPE DCSNWuaHdRDZzUpC7hoD4BH5o/LdOan9K7/J/l25sZJGNYZ5x/SIcxln199Mx4zcT3Tz XH2w== X-Gm-Message-State: AC+VfDzQP5V/KD1UuPWYeyacAMeyuMwggkVcoipkYp/VU3AZzhEwtK8X pjLxIlz1Bmx6KhuHZM+71vam/vpeqcYwQQ== X-Received: by 2002:a25:844:0:b0:b9d:9f01:770a with SMTP id 65-20020a250844000000b00b9d9f01770amr23732825ybi.37.1683885439871; Fri, 12 May 2023 02:57:19 -0700 (PDT) Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com. [209.85.128.172]) by smtp.gmail.com with ESMTPSA id a205-20020a254dd6000000b00b8f54571fc0sm5008404ybb.5.2023.05.12.02.57.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 May 2023 02:57:18 -0700 (PDT) Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-55a44a2637bso143308887b3.2; Fri, 12 May 2023 02:57:18 -0700 (PDT) X-Received: by 2002:a0d:e209:0:b0:555:cbdc:c6 with SMTP id l9-20020a0de209000000b00555cbdc00c6mr23583778ywe.9.1683885438128; Fri, 12 May 2023 02:57:18 -0700 (PDT) MIME-Version: 1.0 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> From: Geert Uytterhoeven Date: Fri, 12 May 2023 11:57:07 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 00/12] arch: Make virt_to_pfn into a static inline To: Linus Walleij Cc: Vineet Gupta , Catalin Marinas , Will Deacon , Arnd Bergmann , Russell King , Greg Ungerer , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Linus, On Thu, May 11, 2023 at 1:59 PM Linus Walleij wrote: > This is an attempt to harden the typing on virt_to_pfn() > and pfn_to_virt(). > > 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 with pfn_to_virt(). > > The problem with this inconsistent typing was pointed out by > Russell King: > https://lore.kernel.org/linux-arm-kernel/YoJDKJXc0MJ2QZTb@shell.armlinux.org.uk/ > > And confirmed by Andrew Morton: > https://lore.kernel.org/linux-mm/20220701160004.2ffff4e5ab59a55499f4c736@linux-foundation.org/ > > So the recognition of the problem is widespread. > > These platforms have been chosen as initial conversion targets: > > - ARC > - ARM > - ARM64/Aarch64 > - asm-generic (including for example x86) > - m68k Thanks, builds fine on m68k with MMU, and boots fine on ARAnyM, with the extra changes I replied on patch 2/12. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds