Re: [PATCH, RFC 09/62] x86/mm: Preserve KeyID on pte_modify() and pgprot_modify()

2019-06-14 Thread Kirill A. Shutemov
On Fri, Jun 14, 2019 at 11:15:14AM +0200, Peter Zijlstra wrote: > On Wed, May 08, 2019 at 05:43:29PM +0300, Kirill A. Shutemov wrote: > > + * Cast PAGE_MASK to a signed type so that it is sign-extended if > > + * virtual addresses are 32-bits but physical addresses are larger > > + * (ie, 32-bit

Re: [PATCH, RFC 09/62] x86/mm: Preserve KeyID on pte_modify() and pgprot_modify()

2019-06-14 Thread Peter Zijlstra
On Wed, May 08, 2019 at 05:43:29PM +0300, Kirill A. Shutemov wrote: > + * Cast PAGE_MASK to a signed type so that it is sign-extended if > + * virtual addresses are 32-bits but physical addresses are larger > + * (ie, 32-bit PAE). On 32bit, 'long' is still 32bit, did you want to cast to 'long

[PATCH, RFC 09/62] x86/mm: Preserve KeyID on pte_modify() and pgprot_modify()

2019-05-08 Thread Kirill A. Shutemov
An encrypted VMA will have KeyID stored in vma->vm_page_prot. This way we don't need to do anything special to setup encrypted page table entries and don't need to reserve space for KeyID in a VMA. This patch changes _PAGE_CHG_MASK to include KeyID bits. Otherwise they are going to be stripped