]> xenbits.xensource.com Git - xen.git/commit
x86/traps: Fix error handling of the pv %dr7 shadow state
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 4 Jul 2018 10:35:16 +0000 (12:35 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 4 Jul 2018 10:35:16 +0000 (12:35 +0200)
commitc4cb7d3b0b3e8b077057a2c13c539f80105c7337
tree7f90d8fbc15124727203dc195b4e26de37ed312a
parent8cdaac2d39e2c089255f878145c690ff1f3ec6f9
x86/traps: Fix error handling of the pv %dr7 shadow state

c/s "x86/pv: Introduce and use x86emul_write_dr()" fixed a bug with IO shadow
handling, in that it remained stale and visible until %dr7.L/G got set again.

However, it neglected the -EPERM return inbetween these two hunks, introducing
a different bug in which a write to %dr7 which tries to set IO breakpoints
without %cr4.DE being set clobbers the IO state, rather than leaves it alone.

Instead, move the zeroing slightly later, which guarentees that the shadow
gets written exactly once, on a successful update to %dr7.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 237c31b5a1d5aa88cdb59b8c31b1b62eb13e82d1
master date: 2018-06-04 11:05:45 +0100
xen/arch/x86/traps.c