x86/hvm: Improvements to external users of decode_register()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 25 Jan 2018 12:16:12 +0000 (12:16 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 31 Jan 2018 12:23:11 +0000 (12:23 +0000)
commit8e67c41795d426e53ef23fe3d220b4d9b4dc2fb4
treec0f13357832d3ff1ba819ca2ef5a5b8b95955cb8
parent004f98ffc7e57cac17365341c07389aa8d0418be
x86/hvm: Improvements to external users of decode_register()

 * Rename to decode_gpr() to be more specific as to its purpose
 * Drop the highbyte encoding handling, as no users currently care, and it
   unlikely that future users would care.
 * Change to a static inline, returning an unsigned long pointer.

Doing so highlights that the "invalid gpr" paths in hvm_mov_{to,from}_cr()
were actually unreachable.  All callers already passed in-range GPRs, and
out-of-range GPRs would have hit the BUG() previously.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/vmx/vvmx.c
xen/arch/x86/x86_emulate/x86_emulate.c
xen/arch/x86/x86_emulate/x86_emulate.h