> 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
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
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
>>> 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
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
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
... 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