[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8967ea5a-99bf-8990-6ee1-8e0d32031f16@intel.com>
Date: Fri, 28 Jan 2022 14:47:30 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: ira.weiny@...el.com, Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Dan Williams <dan.j.williams@...el.com>
Cc: Fenghua Yu <fenghua.yu@...el.com>,
Rick Edgecombe <rick.p.edgecombe@...el.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V8 04/44] x86/pkeys: Add additional PKEY helper macros
On 1/27/22 09:54, ira.weiny@...el.com wrote:
> +#define PKR_AD_KEY(pkey) (PKR_AD_BIT << PKR_PKEY_SHIFT(pkey))
> +#define PKR_WD_KEY(pkey) (PKR_WD_BIT << PKR_PKEY_SHIFT(pkey))
I don't _hate_ this, but naming here is wonky for me. PKR_WD_KEY reads
to me as "pkey register write-disable key", as in, please write-disable
this key, or maybe "make a write-disable key".
It's generating a mask, so I'd probably name it:
#define PKR_WD_MASK(pkey) (PKR_WD_BIT << PKR_PKEY_SHIFT(pkey))
Which says, "generate a write-disabled mask for this pkey".
Powered by blists - more mailing lists