x86/HVM: cancel emulation when register state got altered
authorJan Beulich <jbeulich@suse.com>
Thu, 23 Apr 2020 07:51:18 +0000 (09:51 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 23 Apr 2020 07:51:18 +0000 (09:51 +0200)
commita141051d7695265c721863dc91a2dc206b9ff5b1
tree6799a7b671fa104235d08574909f9055fe33b531
parenta62c6fe05c4ae905b7d4cb0ca946508b7f96d522
x86/HVM: cancel emulation when register state got altered

Re-execution (after having received data from a device model) relies on
the same register state still being in place as it was when the request
was first sent to the device model. Therefore vCPU state changes
effected by remote sources need to result in no attempt of re-execution.
Instead the returned data is to simply be ignored.

Note that any such asynchronous state changes happen with the vCPU at
least paused (potentially down and/or not marked ->is_initialised), so
there's no issue with fiddling with register state behind the actively
running emulator's back. Hence the new function doesn't need to
synchronize with the core emulation logic.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <pdurrant@amzn.com>
xen/arch/x86/domctl.c
xen/arch/x86/hvm/domain.c
xen/arch/x86/hvm/emulate.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/vlapic.c
xen/include/asm-x86/hvm/emulate.h
xen/include/asm-x86/hvm/hvm.h