x86/hypercall: Make the HVM hcall_preempted boolean common
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 14 Feb 2017 17:02:04 +0000 (17:02 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 16 Feb 2017 14:15:25 +0000 (14:15 +0000)
commit928ea919fc3c5476aa9df55c3b95debc8904927f
tree7590e7c4c6e44abab6ebfa4e0c8fb5150205d55d
parent3044a2a81910bf993c0fe6fa34bee0bf5b410911
x86/hypercall: Make the HVM hcall_preempted boolean common

HVM guests currently make use of arch.hvm_vcpu.hcall_preempted to track
hypercall preemption in struct vcpu.  Move this boolean to being common at the
top level of struct vcpu, which will allow it to be reused elsewhere.

Alter the PV preemption logic to use this boolean.  This simplifies the code
by removing guest-type-specific knowledge, and removes the risk of accidently
skipping backwards or forwards multiple times and corrupting %rip.

In pv_hypercall() the old_rip bodge can be removed, and parameter clobbering
can happen based on a more obvious condition.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain.c
xen/arch/x86/hvm/hypercall.c
xen/arch/x86/hypercall.c
xen/include/asm-x86/hvm/vcpu.h
xen/include/xen/sched.h