VMX: make sure PI is in proper state before install the hooks
authorFeng Wu <feng.wu@intel.com>
Fri, 3 Mar 2017 10:58:13 +0000 (11:58 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 3 Mar 2017 10:58:13 +0000 (11:58 +0100)
commit17ee5853e21befd4db89e5c2929510e4a07a5430
treefa8d13ade7b101b0044e5ed1d6e42d4c37adf06e
parent7c00de17562e28f01e188c6a2c240ebc21b9d4b7
VMX: make sure PI is in proper state before install the hooks

We may hit the last ASSERT() in vmx_vcpu_block in the current code,
since vmx_vcpu_block() may get called before vmx_pi_switch_to()
has been installed or executed. Here We use cmpxchg to update
the NDST field, this can make sure we only update the NDST when
vmx_pi_switch_to() has not been called. So the NDST is in a
proper state in vmx_vcpu_block().

Suggested-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Feng Wu <feng.wu@intel.com>
Signed-off-by: Chao Gao <chao.gao@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/vmx/vmx.h