[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 4/4] KVM: VMX: Simplify segment_base



On Tue, Feb 14, 2017 at 7:57 PM, Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote:
> On Tue, Feb 14, 2017 at 11:42 AM, Thomas Garnier <thgarnie@xxxxxxxxxx> wrote:
>> The KVM segment_base function is confusing. This patch replaces integers
>> with appropriate flags, simplify constructs and add comments.
>
> It could pay to put this first in the series, but last is probably fine, too.
>

:)

>>
>> Signed-off-by: Thomas Garnier <thgarnie@xxxxxxxxxx>
>> ---
>> Based on next-20170213
>> ---
>>  arch/x86/kvm/vmx.c | 26 ++++++++++++++++++--------
>>  1 file changed, 18 insertions(+), 8 deletions(-)
>>
>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>> index 99167f20bc34..edb8326108dd 100644
>> --- a/arch/x86/kvm/vmx.c
>> +++ b/arch/x86/kvm/vmx.c
>> @@ -2062,25 +2062,35 @@ static unsigned long segment_base(u16 selector)
>>         struct desc_struct *d;
>>         unsigned long table_base;
>
> This should go away IMO.  It should be struct desc_struct *table;
>
>> +               table_base = get_current_gdt_rw_vaddr();
>
> Then this can go away, too, and you can stop having the silly
> get_current_gdt_rw_vaddr() function at all.
>
>> +       d = (struct desc_struct *)table_base + (selector >> 3);
>
> And this cast goes away too.

No problem.

-- 
Thomas

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.