]> xenbits.xensource.com Git - xen.git/commit
x86/domain: Initialise vcpu debug registers correctly
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 28 May 2018 14:18:17 +0000 (14:18 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 24 Oct 2018 13:43:05 +0000 (14:43 +0100)
commitdfba4d2e91f63a8f40493c4fc2db03fd8287f6cb
treee3111cec8816487bd16de535f13d1c3165623d9e
parent721da6d41a70fe08b3fcd9c31a62f6709a54c6ba
x86/domain: Initialise vcpu 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.

Introduce arch_vcpu_regs_init() to set various architectural defaults, and
reuse this in the hvm_vcpu_reset_state() path.

Architecturally, %edx's init state contains the processors model information,
and 0xf looks to be a remnant of the old Intel processors.  We clearly have no
software which cares, seeing as it is wrong for the last decade's worth of
Intel hardware and for all other vendors, so lets use the value 0 for
simplicity.

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>
xen/arch/x86/domain.c
xen/arch/x86/hvm/hvm.c
xen/include/asm-x86/domain.h