x86/boot: Initialise the debug registers correctly
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 5 Nov 2018 14:02:59 +0000 (15:02 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 5 Nov 2018 14:02:59 +0000 (15:02 +0100)
commitfe10c229a404594a7cd5f2aaf3bd909dfc4e14e8
tree5c68cf1abb977feef7629328d97d8e906e266750
parente2436396ed340ade278c29faa9da52a0bd4ae7bc
x86/boot: Initialise the debug registers correctly

In particular, initialising %dr6 with the value 0 is buggy, because on
hardware supporting Transactional Memory, it will cause the sticky RTM bit to
be asserted, even though a debug exception from a transaction hasn't actually
been observed.

Move X86_DR6_DEFAULT into x86-defns.h along with the other architectural
register constants, and introduce a new X86_DR7_DEFAULT.  Use the existing
write_debugreg() helper, rather than opencoded inline assembly.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
master commit: 721da6d41a70fe08b3fcd9c31a62f6709a54c6ba
master date: 2018-10-24 14:43:05 +0100
xen/arch/x86/cpu/common.c
xen/include/asm-x86/debugreg.h
xen/include/asm-x86/x86-defns.h