x86: Reorganise and rename debug register fields in struct vcpu
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 28 May 2018 14:22:49 +0000 (15:22 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 30 Oct 2018 13:26:21 +0000 (13:26 +0000)
commit30f43f4aa81e2dea6f754dddaf794518587022c2
tree41d768d59251bd42127e407f342a018ae7ae3ee8
parent2b3218eb6bf27d3b66885dde8ae05e4e7864370d
x86: Reorganise and rename debug register fields in struct vcpu

Reusing debugreg[5] for the PV emulated IO breakpoint information is confusing
to read.  Instead, introduce a dr7_emul field in pv_vcpu for the purpose.

With the PV emulation out of the way, debugreg[4,5] are entirely unused and
don't need to be stored.

Rename debugreg[0..3] to dr[0..3] to reduce code volume, but keep them as an
array because their behaviour is identical and this helps simplfy some of the
PV handling.  Introduce dr6 and dr7 fields to replace debugreg[6,7] which
removes the storage for debugreg[4,5].

In arch_get_info_guest(), handle the merging of emulated dr7 state alongside
all other dr handling, rather than much later.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
xen/arch/x86/domain.c
xen/arch/x86/domctl.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/pv/emul-priv-op.c
xen/arch/x86/pv/emulate.c
xen/arch/x86/traps.c
xen/arch/x86/vm_event.c
xen/arch/x86/x86_emulate.c
xen/include/asm-x86/domain.h