lkml.org 
[lkml]   [2015]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/9] KVM: MMU: introduce for_each_slot_rmap_range


On 05/12/2015 04:22 PM, Paolo Bonzini wrote:
>
>
> On 12/05/2015 04:32, Xiao Guangrong wrote:
>> +#define for_each_slot_rmap_range(_slot_, _start_level_, _end_level_, \
>> + _start_gfn, _end_gfn, _iter_) \
>> + for (slot_rmap_walk_init(_iter_, _slot_, _start_level_, \
>> + _end_level_, _start_gfn, _end_gfn); \
>> + slot_rmap_walk_okay(_iter_); \
>> + slot_rmap_walk_next(_iter_))
>> +
>
>
>> + for_each_slot_rmap_range(memslot, PT_PAGE_TABLE_LEVEL,
>> + PT_PAGE_TABLE_LEVEL + KVM_NR_PAGE_SIZES - 1,
>
>
> What about adding a
>
> #define for PT_MAX_HUGEPAGE_LEVEL (PT_PAGE_TABLE_LEVEL + KVM_NR_PAGE_SIZES - 1)

Good to me.

>
> ?
>
>> + gfn_start, gfn_end - 1, &iterator)
>> + ret |= handler(kvm, iterator.rmap, memslot,
>> + iterator.gfn, iterator.level, data);
>
> I prefer to indent by two tabs:
>
> for_each_slot_rmap_range(memslot,
> PT_PAGE_TABLE_LEVEL, PT_MAX_HUGEPAGE_LEVEL,
> gfn_start, gfn_end - 1, &iterator)
> ret |= handler(kvm, iterator.rmap, memslot,
> iterator.gfn, iterator.level, data);
>
>
> Same in the next patch:
>
> for_each_slot_rmap_range(memslot,
> start_level, end_level,
> start_gfn, end_gfn, &iterator) {
> if (iterator.rmap)
> flush |= fn(kvm, iterator.rmap);
> ...
> }

looks nice, will follow your style. :)



\
 
 \ /
  Last update: 2015-05-12 12:01    [W:0.040 / U:4.720 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site