Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1595165ybh; Mon, 20 Jul 2020 02:18:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGS2aIJt4Ig9wCsV5ie39Mp+FVfb1O9V69Ocf0w4JI0vek166AXNcZksnO8izO2ZZpiKSt X-Received: by 2002:a05:6402:354:: with SMTP id r20mr21644583edw.32.1595236715158; Mon, 20 Jul 2020 02:18:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595236715; cv=none; d=google.com; s=arc-20160816; b=stB8LdpbvdMoWkYZmQGZmsQtHdW438AFye6sdLxCLdnY9J+VVSpSEK5DGgamyD1FMm Rw0KZR+MA1LHcF//cni3ZAUHARksLtdzzjosdieVURU1waFJOkVtWf4HujtufDUwmH/U HtLUmrx8lipQJSsgHxGw1jqWpShrpFuhjUjEf3Duexdi390MR09+1gpDBAQkJToSDLIm rd/aRfDGv955dvupl/WY4iSXk1x5gcJWYaWrXlTRUvY/rhrTU9JJYPWdPQEMYimuGWpE zQoyIk5rqUjMnlG94uS1zBiKPD798bVVjDmPCIn8QtXtxpHG91B1PEWJTPF8BddrnNSu Nklg== 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=9k1ombCB/XhICcqxKFVOjQ1AGpkCxpa4eC8EdBJWgkY=; b=w6TWMGbP+OSMYGP8PVcTRVWL7mwylNd9phXi/vQM+6xkgaNoBZjZBZ0+cYnlxMy00D DyVEw9x3OY7dK3dC4YUVatKMJrsCZV34Sp4Y++gKpPGYq9uN0wJ6XGlCAj56ysgR7c5y 9bhUz8Ab9ACR5k1G9hLUB4aH7xCwAYhulFKz3B+Xc785OQeeil3fL21m4347G+C216tM iFE+zIGMZ4vWE11LUqni6/kRzoJDVEEP+UxklAKJDUYUTZP5P/z14Mz6hUoKDxtMRY/3 MDEYmnyODJOa2zfMM3zd/K1yf9TgrizSMB/lMbbt4gmrLL1ceR8bFQgAGVLKHjmMRbnd NGOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=BwLB0hGg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si10719566ejd.449.2020.07.20.02.18.12; Mon, 20 Jul 2020 02:18:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=BwLB0hGg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728114AbgGTJRx (ORCPT + 99 others); Mon, 20 Jul 2020 05:17:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727780AbgGTJRx (ORCPT ); Mon, 20 Jul 2020 05:17:53 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33D03C061794; Mon, 20 Jul 2020 02:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=9k1ombCB/XhICcqxKFVOjQ1AGpkCxpa4eC8EdBJWgkY=; b=BwLB0hGgSaqBkwLtMWDBnHXKfa y7KAxz2bvDvF28yAcByni6ft1LZoY+n7qXz+5Poaoi7g+/6sfr6GteFHgRvelLQIKZNHsgFcjyqz1 /AqTtFK1HwwxUaSbQIh77cuNL+w4fZNtWq+ryKADWQMt+4pqOMsCSvXicIUyJItyjjRkCcN18/M4m sIKPVkl/Toz0xyLQqTr4OjhenYlHlihU5FH2u4zr7B5dyinii+jIF/lP/ajnPkCRs9UrZkovvo0dH cbu7HHK7n/aOJC7/YrfYdPuIfqJK6w6DvqqGIsmDvMd7NIWQv8IueXLrH7qkCHuXA1pIwiFCtIwDh UYlS5ZNQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxRvZ-00061o-To; Mon, 20 Jul 2020 09:17:42 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id B6F05301AC6; Mon, 20 Jul 2020 11:17:40 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A63AA205A7673; Mon, 20 Jul 2020 11:17:40 +0200 (CEST) Date: Mon, 20 Jul 2020 11:17:40 +0200 From: Peter Zijlstra To: Ira Weiny Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Andy Lutomirski , x86@kernel.org, Dave Hansen , Dan Williams , Vishal Verma , Andrew Morton , Fenghua Yu , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH RFC V2 13/17] kmap: Add stray write protection for device pages Message-ID: <20200720091740.GP10769@hirez.programming.kicks-ass.net> References: <20200717072056.73134-1-ira.weiny@intel.com> <20200717072056.73134-14-ira.weiny@intel.com> <20200717092139.GC10769@hirez.programming.kicks-ass.net> <20200719041319.GA478573@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200719041319.GA478573@iweiny-DESK2.sc.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 18, 2020 at 09:13:19PM -0700, Ira Weiny wrote: > On Fri, Jul 17, 2020 at 11:21:39AM +0200, Peter Zijlstra wrote: > > On Fri, Jul 17, 2020 at 12:20:52AM -0700, ira.weiny@intel.com wrote: > > > @@ -31,6 +32,20 @@ static inline void invalidate_kernel_vmap_range(void *vaddr, int size) > > > > > > #include > > > > > > +static inline void enable_access(struct page *page) > > > +{ > > > + if (!page_is_access_protected(page)) > > > + return; > > > + dev_access_enable(); > > > +} > > > + > > > +static inline void disable_access(struct page *page) > > > +{ > > > + if (!page_is_access_protected(page)) > > > + return; > > > + dev_access_disable(); > > > +} > > > > These are some very generic names, do we want them to be a little more > > specific? > > I had them named kmap_* but Dave (I think it was Dave) thought they did not > really apply strictly to kmap_*. > > They are static to this file which I thought may be sufficient to 'uniqify' > them? They're static to a .h, which means they're all over the place ;-)