Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2236116rwb; Thu, 19 Jan 2023 23:34:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXtlYwfpMV7Wmhemqp1jl4O8qJ0UHge+vXFWKSjltjECulLFsi6+tDe4dGnwpkVgpweWCwcg X-Received: by 2002:a17:906:22c9:b0:7c1:65d1:c4ca with SMTP id q9-20020a17090622c900b007c165d1c4camr13160755eja.33.1674200066013; Thu, 19 Jan 2023 23:34:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674200065; cv=none; d=google.com; s=arc-20160816; b=aPZrq9E6jT5UrwN8AkXhZ3sNHDopN3kJnkoHRg6zNI/FzmwWpxzwoXaMVEsmDNriGA r4jSpONB2qm5yFOQ0B/hYTwV3iorqr1C9+9NIzOpFsa6gS9kwT+MGSHrYfBY2R7uFScU 1FNdcHb3J35wWy+0IXszlTOXYhUW+JAL9m9ooPhBCQaUV8WKfRQBF5Twr68a6ofBpu4w bFOb7O+UW2ZouCYY/GpFE0tVgnPJy/IckhA+GlkJBXQ7/92ymYe+zyikxpPwFgB4YXMd 6nHvRxUl8EU7Dbk0gRyyUdzWrKtMJi5vhO9MsIn5SrXgnjHk9LcDt1sRd/diLFu47MiH t1rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=PYlvYmLhvCStpUlIWgDK7qRLjsofn2WUHqFGFFc5/3w=; b=GE4N4cjwSAe+qVwEwwslF/MAPwHNJJapWtdY3E0US2qpNSbU0VZgK4242I6afb0Q5I jKMoCWKtSnmv9QpbQfQgkj3elZj548SVwhf6g9jkkjn5jjbLYd41KkUBn3tHCgSdbKoj YdYdRdxl/IvdY8/nthE5cQ/amsYsRTVotD71ypHMCOlNBCR8kiyFfZLESqOcytb6rt9y P9x5Zg3U598G0ISnAcNSusayIv0qDq9iXmBbKzl2ewoPEicpSvD28PN6o2sGjcvMRnDu tl72/ewpErgvHegbccPxbq5vMzjIt3j4dLeufcp0+JdKcyF4Jnez62YKdYRhLEAtAxT1 LQIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=PKQEzm3a; 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=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf17-20020a1709077f1100b007c17420be5bsi17181621ejc.178.2023.01.19.23.34.10; Thu, 19 Jan 2023 23:34:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=PKQEzm3a; 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=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbjATHTL (ORCPT + 49 others); Fri, 20 Jan 2023 02:19:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230180AbjATHSb (ORCPT ); Fri, 20 Jan 2023 02:18:31 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F2741632C; Thu, 19 Jan 2023 23:17:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1674199043; bh=80y1MrhjmMjLHjFUtuMNBWfKyaa5GeSPeR9E2iNImV0=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=PKQEzm3apQCB5altG0YYIdc821vvm/YhBkp1eS4J3LAm9L6c74Jw7NGLgH0XfmKWg 6FZiJpZsMR3ZbeAU88wiq/c0pSlVAspy562ArvvgfnoOEaHoQgWxnsZ0U0QJauzYy8 v+2pmH7Hf9rtQ6Y2IMDnpRt9jOfCp5UhRQc7Yd1aixOuKuGv9iEzqhwnbrduaWa/Ux vHj/EOpsnJnQr+jFlmEOpFrOam0WgFQqXzmNLewl7ck+BszgHcilPW/WjJf2gZrKNO zaDAI/xa2hS9WrrtoQsPvxGpn1Ec8v3Ud2SuBgmO07BLmOtPwP2LcMtJxlLJ33qnhZ BuAt2iU7fuNiw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.20.60] ([92.116.164.19]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MJmGP-1ozBX81ku9-00K9Dm; Fri, 20 Jan 2023 08:17:23 +0100 Message-ID: <99978295-6643-0cf2-8760-43e097f20dad@gmx.de> Date: Fri, 20 Jan 2023 08:17:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v3 4/4] fs/sysv: Replace kmap() with kmap_local_page() Content-Language: en-US To: Al Viro , Matthew Wilcox Cc: "Fabio M. De Francesco" , Christoph Hellwig , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Ira Weiny , linux-parisc@vger.kernel.org References: <20230119153232.29750-1-fmdefrancesco@gmail.com> <20230119153232.29750-5-fmdefrancesco@gmail.com> From: Helge Deller In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:+rmzJQ5b+xbugZINHznwY3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VDHsGWL/ZJitE0wywushk5Pia7Vw7ybuDI+cAiJ2vkoFtj+W3K77ZtUf+BFcobs40F JYaghDR3Z8nLpb7C+/94PkeBTwNBxA1852t7Jwj0T1ynj6Af9KZvW8RWg7/j/AJwo29dYqd0T 0Z9NBw== X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/20/23 06:56, Al Viro wrote: > On Fri, Jan 20, 2023 at 05:07:48AM +0000, Al Viro wrote: >> On Fri, Jan 20, 2023 at 04:54:51AM +0000, Matthew Wilcox wrote: >> >>>> Sure, but... there's also this: >>>> >>>> static inline void __kunmap_local(const void *addr) >>>> { >>>> #ifdef ARCH_HAS_FLUSH_ON_KUNMAP >>>> kunmap_flush_on_unmap(addr); >>>> #endif >>>> } >>>> >>>> Are you sure that the guts of that thing will be happy with address t= hat is not >>>> page-aligned? I've looked there at some point, got scared of parisc = (IIRC) >>>> MMU details and decided not to rely upon that... >>> >>> Ugh, PA-RISC (the only implementor) definitely will flush the wrong >>> addresses. I think we should do this, as having bugs that only manife= st >>> on one not-well-tested architecture seems Bad. >>> >>> static inline void __kunmap_local(const void *addr) >>> { >>> #ifdef ARCH_HAS_FLUSH_ON_KUNMAP >>> - kunmap_flush_on_unmap(addr); >>> + kunmap_flush_on_unmap(PAGE_ALIGN_DOWN(addr)); >>> #endif >>> } >> >> PTR_ALIGN_DOWN(addr, PAGE_SIZE), perhaps? > > Anyway, that's a question to parisc folks; I _think_ pdtlb > quietly ignores the lower bits of address, so that part seems > to be safe, but I wouldn't bet upon that. No, on PA2.0 (64bit) CPUs the lower bits of the address of pdtlb encodes the amount of memory (page size) to be flushed, see: http://ftp.parisc-linux.org/docs/arch/parisc2.0.pdf (page 7-106) So, the proposed page alignment with e.g. PTR_ALIGN_DON() is needed. Helge