|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/3] x86/HVM: introduce hvm_get_cpl() and respective hook
>>> On 06.12.16 at 14:49, <andrew.cooper3@xxxxxxxxxx> 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 >> 5) & 3;
>> +}
>> +
>> +static unsigned int _vmx_get_cpl(struct vcpu *v)
>> +{
>> + unsigned int cpl;
>> +
>> + vmx_vmcs_enter(v);
>> + cpl = vmx_get_cpl();
>> + vmx_vmcs_exit(v);
>> +
>> + return cpl;
>> +}
>
> Our ususal convention for functions with leading underscores would have
> these the other way around.
Our usual convention doesn't fit here: The static function is the
only one allowed to have an underscore prefix.
> As an alternative, how about vmx_hvmfunc_get_cpl() ? It is never called
> directly.
I don't like this. If anything, vmx_do_get_cpl(), albeit it's only
slightly better imo.
> Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Let me know if you can live with the existing naming.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |