Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2163320rwb; Thu, 19 Jan 2023 22:15:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXvhtlYSc324NJwECGsKdO1NM+lE8MmprrcSYgpJXzkurq3LEbdsU/LF8SK7ifZMxrxWWnab X-Received: by 2002:a05:6402:221b:b0:493:a6eb:874f with SMTP id cq27-20020a056402221b00b00493a6eb874fmr13611197edb.7.1674195327553; Thu, 19 Jan 2023 22:15:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674195327; cv=none; d=google.com; s=arc-20160816; b=yoXM7OzJkASU4V0YKxc7WTwHtb8ZyOTcEAN3im1Ao3PolH1WDZIJf2Jl6UOeiyTojr xCrLPb4h11zI5f+PzMaHZ17hCPZ/0eJklCsZMt/aumj0LT/eNdmA9+KNyX+emj8vbtb6 jz1wexTSLFL6+5R3f9hh3dlBh78c1o7aq3Lf8sykyYNyvYe+CKYeU5vAJDerobU2VAI7 M4ntPalmIfnlHrku7sjW4TVgcHNN1J7UCVp6YQKfQ5Q8sM9biHRx7kJV4xesyVSixnn1 YG/V+OrBNfHfDmppzRftFQFCn8eoT242jQpC3aU7MaI8zznudyZ+S4ICnC6XA/mx1dhj BU2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=5L8b9+6lFLvmsEhRZ8nAxeepW7lwqOKRUfjfE9A+xf4=; b=nqoBWnY3G9e+kpiKZpOx9pCX9wIK7libWzjfP2dysu7RZFbESvgAKhooeAli2lGKOa Pr9BNWrjwqcbgJJATy6Lj1rtRLyzduptv1ZEqY+n0yPEodO3Pt+QYEScaQhjt4lsMCYy ceA4LnhZJUKxAcxjZP18FNQnz2lBzWWi6IM9O0otqVAx8aQTpn2hog3lQ2SAiFkxHjNz ia6wCQ4KS7G61rLg/SjcfWWYMzGIz7WhChxTAYjlA779/B6Ux0Vr8Va8Lgfbtp3BxSYe xH7n/+fIgI7WWhYflx0fV0g4ueG31JucxYNQSu/mzFu3OvjRqtABrE2Ks+6ZZMYTL345 iiPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=nvH1AyXr; 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=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw18-20020a170906479200b00866ea828d03si25471489ejc.605.2023.01.19.22.15.15; Thu, 19 Jan 2023 22:15:27 -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=@linux.org.uk header.s=zeniv-20220401 header.b=nvH1AyXr; 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=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230058AbjATF4O (ORCPT + 47 others); Fri, 20 Jan 2023 00:56:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbjATF4K (ORCPT ); Fri, 20 Jan 2023 00:56:10 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CB78AD09; Thu, 19 Jan 2023 21:56:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5L8b9+6lFLvmsEhRZ8nAxeepW7lwqOKRUfjfE9A+xf4=; b=nvH1AyXrH6mgsG41yfNyLvr0ar L4Bh8wYJLS/Axo9nm8GvLjYknRvqAA2UbIWop3KVkLAoaLc3NbaIhl2pOElDG2csVvEaIlcgp/TPD Tml/7R2TYACkWhHxh4aeYdJqDabkfLkw8JjN552Oi30xTNC6pSbPhVIiDWpCcUTseRejn18Xyv18t ks5yiRosowg9RUy2okDuD72dVGlM6I4M5eHQKSRlLdWO9ovZzyoDjzPKufMpfwOhDDnq5qnPqvZkh AwgkMd6U56w51Tci1yEAjj3q1uU73Qdkd8wHolQnsq0gU1K6c4q5e6xuFv4Krw2nDuvwXor8W1bpZ Tq5T49mg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1pIkNd-002vuk-2d; Fri, 20 Jan 2023 05:56:01 +0000 Date: Fri, 20 Jan 2023 05:56:01 +0000 From: Al Viro To: 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 Subject: Re: [PATCH v3 4/4] fs/sysv: Replace kmap() with kmap_local_page() Message-ID: References: <20230119153232.29750-1-fmdefrancesco@gmail.com> <20230119153232.29750-5-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE 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 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 that 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 manifest > > 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. And when I got to flush_kernel_dcache_page_asm I gave up - it's been a long time since I've dealt with parisc assembler.