x86/vmx: add hvm functions to get/set non-register state
authorTamas K Lengyel <tamas.lengyel@intel.com>
Wed, 27 Apr 2022 07:13:39 +0000 (09:13 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 27 Apr 2022 07:13:39 +0000 (09:13 +0200)
commit010bc50adaf58c78db4ad1329b0130d96e13f8e2
tree0bad0e5a55a3c146ab32c22beee9805fb9767858
parent3f5d61466345ed2213de2d7e391b6cd6d4b86015
x86/vmx: add hvm functions to get/set non-register state

During VM forking and resetting a failed vmentry has been observed due
to the guest non-register state going out-of-sync with the guest register
state. For example, a VM fork reset right after a STI instruction can trigger
the failed entry. This is due to the guest non-register state not being saved
from the parent VM, thus the reset operation only copies the register state.

Fix this by adding a new pair of hvm functions to get/set the guest
non-register state so that the overall vCPU state remains in sync.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/include/asm/hvm/hvm.h
xen/arch/x86/mm/mem_sharing.c