[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5551CA21.7030001@linux.intel.com>
Date: Tue, 12 May 2015 17:38:41 +0800
From: Xiao Guangrong <guangrong.xiao@...ux.intel.com>
To: Paolo Bonzini <pbonzini@...hat.com>
CC: gleb@...nel.org, mtosatti@...hat.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [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. :)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists