Re: [Xen-devel] [PATCH 1/3] x86/HVM: introduce hvm_get_cpl() and respective hook

2016-12-06 Thread Tian, Kevin
> From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: Tuesday, December 06, 2016 7:43 PM > > ... instead of repeating the same code in various places (and getting > it wrong in some of them). > > In vmx_inst_check_privilege() also stop open coding vmx_get_x86_mode(). > > Signed-off-by: Jan Beu

Re: [Xen-devel] [PATCH 1/3] x86/HVM: introduce hvm_get_cpl() and respective hook

2016-12-06 Thread Boris Ostrovsky
On 12/06/2016 06:43 AM, Jan Beulich wrote: > ... instead of repeating the same code in various places (and getting > it wrong in some of them). > > In vmx_inst_check_privilege() also stop open coding vmx_get_x86_mode(). vmx_guest_x86_mode() > > Signed-off-by: Jan Beulich Reviewed-by: Boris Ost

Re: [Xen-devel] [PATCH 1/3] x86/HVM: introduce hvm_get_cpl() and respective hook

2016-12-06 Thread Andrew Cooper
On 06/12/16 14:07, Jan Beulich wrote: On 06.12.16 at 14:49, wrote: >> On 06/12/16 11:43, Jan Beulich wrote: >>> @@ -921,6 +921,26 @@ static void vmx_ctxt_switch_to(struct vc >>> } >>> >>> >>> +unsigned int vmx_get_cpl(void) >>> +{ >>> +unsigned long attr; >>> + >>> +__vmread(GUES

Re: [Xen-devel] [PATCH 1/3] x86/HVM: introduce hvm_get_cpl() and respective hook

2016-12-06 Thread Jan Beulich
>>> On 06.12.16 at 14:49, wrote: > On 06/12/16 11:43, Jan Beulich wrote: >> @@ -921,6 +921,26 @@ static void vmx_ctxt_switch_to(struct vc >> } >> >> >> +unsigned int vmx_get_cpl(void) >> +{ >> +unsigned long attr; >> + >> +__vmread(GUEST_SS_AR_BYTES, &attr); >> + >> +return (attr

Re: [Xen-devel] [PATCH 1/3] x86/HVM: introduce hvm_get_cpl() and respective hook

2016-12-06 Thread Andrew Cooper
On 06/12/16 11:43, Jan Beulich wrote: > @@ -921,6 +921,26 @@ static void vmx_ctxt_switch_to(struct vc > } > > > +unsigned int vmx_get_cpl(void) > +{ > +unsigned long attr; > + > +__vmread(GUEST_SS_AR_BYTES, &attr); > + > +return (attr >> 5) & 3; > +} > + > +static unsigned int _vmx

Re: [Xen-devel] [PATCH 1/3] x86/HVM: introduce hvm_get_cpl() and respective hook

2016-12-06 Thread Razvan Cojocaru
On 12/06/2016 01:43 PM, Jan Beulich wrote: > ... instead of repeating the same code in various places (and getting > it wrong in some of them). > > In vmx_inst_check_privilege() also stop open coding vmx_get_x86_mode(). > > Signed-off-by: Jan Beulich Acked-by: Razvan Cojocaru May I just say

[Xen-devel] [PATCH 1/3] x86/HVM: introduce hvm_get_cpl() and respective hook

2016-12-06 Thread Jan Beulich
... instead of repeating the same code in various places (and getting it wrong in some of them). In vmx_inst_check_privilege() also stop open coding vmx_get_x86_mode(). Signed-off-by: Jan Beulich --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -2744,7 +2744,7 @@ static void hvm_un