Re: [PATCH v2] x86-64/Xen: eliminate W+X mappings

From: Juergen Gross
Date: Mon Dec 18 2017 - 06:50:27 EST

On 18/12/17 12:11, Jan Beulich wrote:
> A few thousand such pages are usually left around due to the re-use of
> L1 tables having been provided by the hypervisor (Dom0) or tool stack
> (DomU). Set NX in the direct map variant, which needs to be done in L2
> due to the dual use of the re-used L1s.
> For x86_configure_nx() to actually do what it is supposed to do, call
> get_cpu_cap() first. This was broken by commit 4763ed4d45 ("x86, mm:
> Clean up and simplify NX enablement") when switching away from the
> direct EFER read.
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> v2: Adjust comment style and indentation.
> ---
> While I certainly dislike the added header inclusion to obtain the
> prototype for get_cpu_cap(), I couldn't find a better alternative. I'm
> open to suggestions.

Move the prototype to arch/x86/include/asm/cpu.h ?

With that fixed (or without it in case the x86 maintainers don't like
the prototype to be moved):

Reviewed-by: Juergen Gross <jgross@xxxxxxxx>