x86emul: correct EFLAGS.TF handling
authorJan Beulich <jbeulich@suse.com>
Wed, 11 Jan 2017 12:43:04 +0000 (13:43 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 11 Jan 2017 12:43:04 +0000 (13:43 +0100)
commit14a6be89ec04bfadba978dc4c2f1e7f96db8cdf0
treefe37e7ca93692e4dbe7acc6c6ad591f6253f9200
parent4fb1aceed5888932b3426b76bd9d3d9ca2a7e7d6
x86emul: correct EFLAGS.TF handling

For repeated string instructions we should not emulate multiple
iterations in one go when a single step trap needs injecting (which
needs to happen after every iteration).

For all non-branch instructions as well as not taken conditional
branches we additionally need to take DebugCtl.BTF into consideration.

For mov-to/pop-into %ss there should be no #DB at all (EFLAGS.TF
remaining set means there'll be #DB after the next instruction).

Additionally retire.sti should remain clear when retire.singlestep gets
set to true.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citirx.com>
xen/arch/x86/x86_emulate/x86_emulate.c