Re: [Xen-devel] [PATCH for 4.9 6/6] x86/emul: Require callers to provide LMA in the emulation context

2017-04-07 Thread Jan Beulich
>>> On 06.04.17 at 18:32, wrote: > On 06/04/17 15:14, Jan Beulich wrote: > On 06.04.17 at 11:47, wrote: >>> On 06/04/17 07:58, Jan Beulich wrote: >>> On 05.04.17 at 18:24, wrote: > On 03/04/17 11:10, Jan Beulich wrote: > On 31.03.17 at 21:50, wrote: >>> --- a/xen/arch/x8

Re: [Xen-devel] [PATCH for 4.9 6/6] x86/emul: Require callers to provide LMA in the emulation context

2017-04-06 Thread Andrew Cooper
On 06/04/17 15:14, Jan Beulich wrote: On 06.04.17 at 11:47, wrote: >> On 06/04/17 07:58, Jan Beulich wrote: >> On 05.04.17 at 18:24, wrote: On 03/04/17 11:10, Jan Beulich wrote: On 31.03.17 at 21:50, wrote: >> --- a/xen/arch/x86/mm.c >> +++ b/xen/arch/x86/mm.c

Re: [Xen-devel] [PATCH for 4.9 6/6] x86/emul: Require callers to provide LMA in the emulation context

2017-04-06 Thread Jan Beulich
>>> On 06.04.17 at 11:47, wrote: > On 06/04/17 07:58, Jan Beulich wrote: > On 05.04.17 at 18:24, wrote: >>> On 03/04/17 11:10, Jan Beulich wrote: >>> On 31.03.17 at 21:50, wrote: > --- a/xen/arch/x86/mm.c > +++ b/xen/arch/x86/mm.c > @@ -5410,6 +5410,7 @@ int ptwr_do_page_faul

Re: [Xen-devel] [PATCH for 4.9 6/6] x86/emul: Require callers to provide LMA in the emulation context

2017-04-06 Thread Andrew Cooper
On 06/04/17 07:58, Jan Beulich wrote: On 05.04.17 at 18:24, wrote: >> On 03/04/17 11:10, Jan Beulich wrote: >> On 31.03.17 at 21:50, wrote: --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5410,6 +5410,7 @@ int ptwr_do_page_fault(struct vcpu *v, unsigned long addr

Re: [Xen-devel] [PATCH for 4.9 6/6] x86/emul: Require callers to provide LMA in the emulation context

2017-04-05 Thread Jan Beulich
>>> On 05.04.17 at 18:24, wrote: > On 03/04/17 11:10, Jan Beulich wrote: > On 31.03.17 at 21:50, wrote: >>> --- a/xen/arch/x86/mm.c >>> +++ b/xen/arch/x86/mm.c >>> @@ -5410,6 +5410,7 @@ int ptwr_do_page_fault(struct vcpu *v, unsigned long >>> addr, >>> .ctxt = { >>> .re

Re: [Xen-devel] [PATCH for 4.9 6/6] x86/emul: Require callers to provide LMA in the emulation context

2017-04-05 Thread Andrew Cooper
On 03/04/17 11:10, Jan Beulich wrote: On 31.03.17 at 21:50, wrote: >> --- a/xen/arch/x86/mm.c >> +++ b/xen/arch/x86/mm.c >> @@ -5410,6 +5410,7 @@ int ptwr_do_page_fault(struct vcpu *v, unsigned long >> addr, >> .ctxt = { >> .regs = regs, >> .vendor = d->arc

Re: [Xen-devel] [PATCH for 4.9 6/6] x86/emul: Require callers to provide LMA in the emulation context

2017-04-05 Thread Jan Beulich
>>> On 31.03.17 at 21:50, wrote: > @@ -1818,10 +1802,8 @@ protmode_load_seg( > > if ( !is_x86_user_segment(seg) ) > { > -int lm = (desc.b & (1u << 12)) ? 0 : in_longmode(ctxt, ops); > +bool lm = (desc.b & (1u << 12)) ? 0 : ctxt->lma; One more minor thing: You want to u

Re: [Xen-devel] [PATCH for 4.9 6/6] x86/emul: Require callers to provide LMA in the emulation context

2017-04-03 Thread Jan Beulich
>>> On 31.03.17 at 21:50, wrote: > --- a/xen/arch/x86/mm.c > +++ b/xen/arch/x86/mm.c > @@ -5410,6 +5410,7 @@ int ptwr_do_page_fault(struct vcpu *v, unsigned long > addr, > .ctxt = { > .regs = regs, > .vendor = d->arch.cpuid->x86_vendor, > +.lma = tru

Re: [Xen-devel] [PATCH for 4.9 6/6] x86/emul: Require callers to provide LMA in the emulation context

2017-04-03 Thread Paul Durrant
> -Original Message- > From: Andrew Cooper [mailto:andrew.coop...@citrix.com] > Sent: 31 March 2017 20:51 > To: Xen-devel > Cc: Andrew Cooper ; Jan Beulich > ; Paul Durrant ; Tim > (Xen.org) ; Julien Grall > Subject: [PATCH for 4.9 6/6] x86/emul: Require callers to provide LMA in the > em

[Xen-devel] [PATCH for 4.9 6/6] x86/emul: Require callers to provide LMA in the emulation context

2017-03-31 Thread Andrew Cooper
Long mode (or not) influences emulation behaviour in a number of cases. Instead of reusing the ->read_msr() hook to obtain EFER.LMA, require callers to provide it directly. This simplifies all long mode checks during emulation to a simple boolean read, removing embedded msr reads. It also allows