lkml.org 
[lkml]   [2018]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv3 07/17] x86/mm: Preserve KeyID on pte_modify() and pgprot_modify()
On Fri, Jun 15, 2018 at 04:58:24PM +0000, Dave Hansen wrote:
> On 06/15/2018 09:06 AM, Kirill A. Shutemov wrote:
> > I have no idea what such concept should be called. I cannot come with
> > anything better than PTE_PFN_MASK_MAX. Do you?
>
> PTE_PRESERVE_MASK
>
> Or maybe:
>
> PTE_MODIFY_PRESERVE_MASK

It just replacing one confusion with another. Preserve what? How does it
differ from _PAGE_CHG_MASK?

I frankly think my name proposal convey more meaning.

> Maybe a comment to go along with it:
>
> /*
> * These are the bits that must be preserved during when doing a
> * PTE permission modification operation, like taking a PTE from
> * R/W->R/O. They include the physical address and the memory
> * encryption keyID. The paddr and the keyID never occupy the same
> * bits at the same time. But, a given bit might be used for the keyID
> * on one system and used for the physical address on another. As an
> * optimization, we manage them in one unit here since their combination
> * always occupies the same hardware bits.
> */

Thanks, this is useful.

--
Kirill A. Shutemov

\
 
 \ /
  Last update: 2018-06-15 22:45    [W:0.144 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site