Re: [Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-30 Thread Tian, Kevin
> From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: Monday, October 15, 2018 6:36 PM > > 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 pupose. > > With the PV emulation out of the

Re: [Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-26 Thread Jan Beulich
>>> On 15.10.18 at 12:36, wrote: > @@ -970,9 +972,13 @@ int arch_set_info_guest( > v->arch.pv.ctrlreg[4] = cr4 ? pv_guest_cr4_fixup(v, cr4) : > real_cr4_to_pv_guest_cr4(mmu_cr4_features); > > -memset(v->arch.debugreg, 0, sizeof(v->arch.debugreg)); > -for ( i = 0; i < 8;

Re: [Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-15 Thread Roger Pau Monné
On Mon, Oct 15, 2018 at 11:36:20AM +0100, Andrew Cooper wrote: > 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 pupose. > > With the PV emulation out of the way, debugreg[4,5] are entirely unused

Re: [Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-15 Thread Roger Pau Monné
On Mon, Oct 15, 2018 at 03:07:21PM +0100, Andrew Cooper wrote: > On 15/10/18 14:56, Roger Pau Monné wrote: > > On Mon, Oct 15, 2018 at 11:36:20AM +0100, Andrew Cooper wrote: > >> diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c > >> + > >> /* data breakpoint extension MSRs */ > >>

Re: [Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-15 Thread Andrew Cooper
On 15/10/18 14:56, Roger Pau Monné wrote: > On Mon, Oct 15, 2018 at 11:36:20AM +0100, Andrew Cooper wrote: >> diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c >> index 115ddf6..cc85395 100644 >> --- a/xen/arch/x86/domctl.c >> +++ b/xen/arch/x86/domctl.c >> @@ -1576,8 +1576,11 @@ void

Re: [Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-15 Thread Roger Pau Monné
On Mon, Oct 15, 2018 at 11:36:20AM +0100, Andrew Cooper wrote: > diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c > index 115ddf6..cc85395 100644 > --- a/xen/arch/x86/domctl.c > +++ b/xen/arch/x86/domctl.c > @@ -1576,8 +1576,11 @@ void arch_get_info_guest(struct vcpu *v, >

Re: [Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-15 Thread Boris Ostrovsky
On 10/15/18 9:32 AM, Andrew Cooper wrote: > On 15/10/18 14:28, Boris Ostrovsky wrote: >> On 10/15/18 6:36 AM, Andrew Cooper wrote: >>> >>> @@ -567,7 +573,10 @@ struct arch_vcpu >>> void *fpu_ctxt; >>> unsigned long vgc_flags; >>> struct cpu_user_regs user_regs;

Re: [Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-15 Thread Andrew Cooper
On 15/10/18 14:28, Boris Ostrovsky wrote: > On 10/15/18 6:36 AM, Andrew Cooper wrote: >> >> @@ -567,7 +573,10 @@ struct arch_vcpu >> void *fpu_ctxt; >> unsigned long vgc_flags; >> struct cpu_user_regs user_regs; >> -unsigned long debugreg[8]; >> + >> +

Re: [Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-15 Thread Boris Ostrovsky
On 10/15/18 6:36 AM, Andrew Cooper wrote: > > @@ -567,7 +573,10 @@ struct arch_vcpu > void *fpu_ctxt; > unsigned long vgc_flags; > struct cpu_user_regs user_regs; > -unsigned long debugreg[8]; > + > +/* Debug registers. */ > +unsigned long dr[4],

Re: [Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-15 Thread Andrew Cooper
On 15/10/18 11:50, Razvan Cojocaru wrote: > On 10/15/18 1:36 PM, Andrew Cooper wrote: >> 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 pupose. >> >> With the PV emulation out of the way,

Re: [Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-15 Thread Razvan Cojocaru
On 10/15/18 1:36 PM, Andrew Cooper wrote: > 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 pupose. > > With the PV emulation out of the way, debugreg[4,5] are entirely unused and > don't need to be

[Xen-devel] [PATCH v2 5/5] x86: Reorganise and rename debug register fields in struct vcpu

2018-10-15 Thread Andrew Cooper
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 pupose. 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