Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp138452ybh; Fri, 17 Jul 2020 22:08:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaaEdMK6nCJmS1kqTTHTjqxvoEat0s2RvkzINBSn/KfJFZ9Vr+UafmS1XjADMJ0m4jGVF+ X-Received: by 2002:a17:906:248a:: with SMTP id e10mr9958372ejb.454.1595048909317; Fri, 17 Jul 2020 22:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595048909; cv=none; d=google.com; s=arc-20160816; b=vbaO/8WP624AVgsPmiRCySV3iPOmMOnEvf/JYeqZZiCvuRV+TCW7sElkEBibnDQhSr 3yDm5T+ZyfvmOq28o8fLWsPhFQc6dye6JJhTNjcy9yiAykehvjb0V3Um4XN0uKc6pO3R 2Rte+R0lN+jZjoKhe7k9Mn/QVEfRHtHVl7ax34xkb8c3wB4jDU9v0MjEimnqiPM6IT1v kfrU5V2puVjtPs6q3rivhXN+wxSezs8JpDMAD1GsnsTMpbOgaG09y2vMmjXEZzJBUoXv 6lVHPbNHmRfr6o4FG1TtfWlo7Jw7j7YBI2ZgIwNEbA+B0Sk7ZL7HemvXwBev/VnlgmEZ J6xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=7O7843yMvD+mAX1HGxcOa9dMgfQQKe7mTNG7AmPjRA4=; b=jtGp3gmzNtieNnvta+hYZpGAzdpyzjwX0OzHfySf5HE2SnOTfp3c8GGw9zmFsbDkJ+ 4r6oWmiRkjbMZLwvyS49CkJJ2SK8tcdpXeUhnGMVflY4BJC6Qj5pAR1Qoaanbh0C+tjc zixnE0Y5EFmf53QRLE22Zp4CFq58K4ham+SBPyc8FJZ2qIz5Jj5q6sCA5Z4LSmgG32tR 0qiYjQBqLTWOBAf+5B7JQzZPz2tPKepzMjhb+KQK/6ucdjrrCjpV1cIimPVDpYAar7Me 2cgPteMki/oVyC3FFNgomw18tBGPt3UUEDYo6UrzeoI7AcWB6ocQh6r+8MpBJZL00FCG USXw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si6384574ejb.157.2020.07.17.22.08.06; Fri, 17 Jul 2020 22:08:29 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726611AbgGRFGw (ORCPT + 99 others); Sat, 18 Jul 2020 01:06:52 -0400 Received: from mga18.intel.com ([134.134.136.126]:7941 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbgGRFGv (ORCPT ); Sat, 18 Jul 2020 01:06:51 -0400 IronPort-SDR: 7YftjD1FvMeh2cfhLU+Hl2Z19UHAwH4voI2BitVIuI/J9Dh24sj6d2cuBq5Vr4Rv5+msav1Td9 Dd7iw7W5Prww== X-IronPort-AV: E=McAfee;i="6000,8403,9685"; a="137184356" X-IronPort-AV: E=Sophos;i="5.75,365,1589266800"; d="scan'208";a="137184356" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2020 22:06:50 -0700 IronPort-SDR: PY3XuV+vuuAtpY8rxRvZ+3vMP/33Vq1wquR8p4Yg18XVLAL6vT+hjMFvaGQsieLHuShfCSaRfd pufbVEiCB0pQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,365,1589266800"; d="scan'208";a="270979648" Received: from iweiny-desk2.sc.intel.com ([10.3.52.147]) by fmsmga008.fm.intel.com with ESMTP; 17 Jul 2020 22:06:50 -0700 Date: Fri, 17 Jul 2020 22:06:50 -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 12/17] memremap: Add zone device access protection Message-ID: <20200718050650.GT3008823@iweiny-DESK2.sc.intel.com> References: <20200717072056.73134-1-ira.weiny@intel.com> <20200717072056.73134-13-ira.weiny@intel.com> <20200717091053.GZ10769@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200717091053.GZ10769@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 17, 2020 at 11:10:53AM +0200, Peter Zijlstra wrote: > On Fri, Jul 17, 2020 at 12:20:51AM -0700, ira.weiny@intel.com wrote: > > +static pgprot_t dev_protection_enable_get(struct dev_pagemap *pgmap, pgprot_t prot) > > +{ > > + if (pgmap->flags & PGMAP_PROT_ENABLED && dev_page_pkey != PKEY_INVALID) { > > + pgprotval_t val = pgprot_val(prot); > > + > > + static_branch_inc(&dev_protection_static_key); > > + prot = __pgprot(val | _PAGE_PKEY(dev_page_pkey)); > > + } > > + return prot; > > +} > > Every other pgprot modifying function is called pgprot_*(), although I > suppose we have the exceptions phys_mem_access_prot() and dma_pgprot(). Yea... this function kind of morphed. The issue is that this is also a 'get' with a corresponding 'put'. So I'm at a loss for what makes sense between the 2 functions. > > How about we call this one devm_pgprot() ? Dan Williams mentioned to me that the devm is not an appropriate prefix. Thus the 'dev' prefix instead. How about dev_pgprot_{get,put}()? Ira