xen/mm: Clean up share_xen_page_with_guest() API
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 8 Mar 2018 19:24:58 +0000 (19:24 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 16 Mar 2018 12:51:45 +0000 (12:51 +0000)
commit2aee8425acfb1ea741660d0d8d6f4fe373228f7e
tree68b7f8bfc0565938eb256333e86a3f2eb2ad4dfa
parent822f21458ff9cd0ee6b910e7f115bb615b8796ec
xen/mm: Clean up share_xen_page_with_guest() API

The share_xen_page_with_guest() functions are used by common code, and are
implemented the same by each arch.  Move the declarations into the common mm.h
rather than duplicating them in each arch/mm.h

Turn an int readonly into a boolean enum, to retain ro/rw context at the
callsites, but use shorter labels which avoids a large number of split lines.

Implement share_xen_page_with_privileged_guests() as a static inline wrapper
around share_xen_page_with_guest() to avoid having a call into a separate
translation unit whose only purpose is to shuffle function arguments.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
15 files changed:
xen/arch/arm/domain.c
xen/arch/arm/mm.c
xen/arch/x86/domain.c
xen/arch/x86/hvm/dom0_build.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/mm.c
xen/arch/x86/pv/shim.c
xen/arch/x86/x86_64/mm.c
xen/common/trace.c
xen/common/xenoprof.c
xen/include/asm-arm/grant_table.h
xen/include/asm-arm/mm.h
xen/include/asm-x86/grant_table.h
xen/include/asm-x86/mm.h
xen/include/xen/mm.h