lkml.org 
[lkml]   [2019]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH 12/13] mmap: Add XO support for KVM XO
Date
On Fri, 2019-10-04 at 09:34 +0200, Paolo Bonzini wrote:
> On 03/10/19 23:23, Rick Edgecombe wrote:
> > +
> > + protection_map[4] = PAGE_EXECONLY;
> > + protection_map[12] = PAGE_EXECONLY;
>
> Can you add #defines for the bits in protection_map? Also perhaps you
> can replace the p_xo/p_xr/s_xo/s_xr checks with just with "if
> (pgtable_kvmxo_enabled()".
>
> Paolo

PAGE_EXECONLY is not known at compile time since the NR bit position depends
on the number of physical address bits. So it can't be set the way the other
ones are in protection_map[], if thats what you are saying.

I didn't love the p_xo/p_xr/s_xo/s_xr checks, but since mm/mmap.c is cross arch
it seemed the best option. Maybe a cross arch helper like
non_pkey_xo_supported() instead?
\
 
 \ /
  Last update: 2019-10-04 21:14    [W:0.038 / U:13.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site