On Wed, May 3, 2017 at 5:10 AM, Razvan Cojocaru <rcojoc...@bitdefender.com> wrote: > > The introspection agent can reply to a vm_event faster than > vmx_vmexit_handler() can complete in some cases, where it is then > not safe for vm_event_set_registers() to modify v->arch.user_regs. > In the test scenario, we were stepping over an INT3 breakpoint by > setting RIP += 1. The quick reply tended to complete before the VCPU > triggering the introspection event had properly paused and been > descheduled. If the reply occurs before __context_switch() happens, > __context_switch() clobbers the reply by overwriting > v->arch.user_regs from the stack. If the reply occurs after > __context_switch(), we don't pass through __context_switch() when > transitioning to idle. > > This patch ensures that vm_event_resume() code only sets per-VCPU > data to be used for the actual setting of registers later in > hvm_do_resume() (similar to the model used to control setting of CRs > and MSRs). > > The patch additionally removes the sync_vcpu_execstate(v) call from > vm_event_resume(), which is no longer necessary, which removes the > associated broadcast TLB flush (read: performance improvement). > > Signed-off-by: Razvan Cojocaru <rcojoc...@bitdefender.com> > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
Acked-by: Tamas K Lengyel <ta...@tklengyel.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel