x86/pv: map_ldt_shadow_page() cleanup
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Aug 2017 17:49:31 +0000 (17:49 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 30 Aug 2017 10:03:08 +0000 (11:03 +0100)
commitf71ebada585502e552ceea1be6178db6a38b6d57
tree9ea8ed3e92f1697e3f539e415d2f8d418f783f27
parent2baad3cee3903795d676e9662c0ddeb511120b42
x86/pv: map_ldt_shadow_page() cleanup

Switch the return value from int to bool, to match its semantics.  Switch its
parameter from a frame offset to a byte offset (simplifying the sole caller)
and allowing for an extra sanity check that the fault is within the LDT limit.

Drop the unnecessary gmfn and okay local variables, and correct the gva
parameter to be named linear.  Rename l1e to gl1e, and simplify the
construction of the new pte by simply taking (the now validated) gl1e and
ensuring that _PAGE_RW is set.

Calculate the pte to be updated outside of the spinlock, which halves the size
of the critical region.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm.c
xen/arch/x86/traps.c
xen/include/asm-x86/mm.h