x86/vmx: correctly gather gs_shadow value for current vCPU
authorTamas K Lengyel <tamas@tklengyel.com>
Mon, 13 May 2019 07:55:59 +0000 (09:55 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 13 May 2019 07:55:59 +0000 (09:55 +0200)
commitf69fc1c2f36e8a74ba54c9c8fa5c904ea1ad319e
tree9c37113bdf2517f04c920e13fdbfea9c21843ad2
parentce65c0226db8d112c28a588802e43a482b210621
x86/vmx: correctly gather gs_shadow value for current vCPU

Currently the gs_shadow value is only cached when the vCPU is being scheduled
out by Xen. Reporting this (usually) stale value through vm_event is incorrect,
since it doesn't represent the actual state of the vCPU at the time the event
was recorded. This prevents vm_event subscribers from correctly finding kernel
structures in the guest when it is trapped while in ring3.

Refresh shadow_gs value when the context being saved is for the current vCPU.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmx.c