From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87638C433F2 for ; Tue, 21 Jul 2020 16:31:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 35654207BB for ; Tue, 21 Jul 2020 16:31:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35654207BB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 55C6F6B0002; Tue, 21 Jul 2020 12:31:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 50DB46B0003; Tue, 21 Jul 2020 12:31:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3FB8F6B0005; Tue, 21 Jul 2020 12:31:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0162.hostedemail.com [216.40.44.162]) by kanga.kvack.org (Postfix) with ESMTP id 26F226B0002 for ; Tue, 21 Jul 2020 12:31:56 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 909C9869BAA0 for ; Tue, 21 Jul 2020 16:31:55 +0000 (UTC) X-FDA: 77062624590.11.force27_0c1372326f2e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 64ED3181BC820 for ; Tue, 21 Jul 2020 16:31:55 +0000 (UTC) X-HE-Tag: force27_0c1372326f2e X-Filterd-Recvd-Size: 3685 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Tue, 21 Jul 2020 16:31:54 +0000 (UTC) IronPort-SDR: RjtmeI5hOTFlQjRmxqDpME7PM60isny2ZUO1hJdBODuq/3ow4PCk1B0PogppCpjs+pLJsMs8iM XrPm4fQUaq4g== X-IronPort-AV: E=McAfee;i="6000,8403,9689"; a="138261050" X-IronPort-AV: E=Sophos;i="5.75,379,1589266800"; d="scan'208";a="138261050" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2020 09:31:52 -0700 IronPort-SDR: QIqyg569mkeyzGevueJJ0WqfJG1wbbgWKT8l7gfSm5T3TqYGXngLSHY7sbeaPpwcZZol3ESKK7 P6/eMlyR/hZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,379,1589266800"; d="scan'208";a="270482086" Received: from iweiny-desk2.sc.intel.com ([10.3.52.147]) by fmsmga007.fm.intel.com with ESMTP; 21 Jul 2020 09:31:52 -0700 Date: Tue, 21 Jul 2020 09:31:52 -0700 From: Ira Weiny To: Peter Zijlstra 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: <20200721163151.GA643353@iweiny-DESK2.sc.intel.com> 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> <20200720091740.GP10769@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200720091740.GP10769@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.11.1 (2018-12-01) X-Rspamd-Queue-Id: 64ED3181BC820 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jul 20, 2020 at 11:17:40AM +0200, Peter Zijlstra wrote: > 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 ;-) I've thought about it a bit. I think I agree with both you and Dave. How about: dev_page_{en,dis}able_access() ?? I've made that change for now. Thanks, Ira