lkml.org 
[lkml]   [2020]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC V2 12/17] memremap: Add zone device access protection
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

\
 
 \ /
  Last update: 2020-07-18 07:07    [W:1.686 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site