Re: [PATCH v2 3/9] KVM: MMU: introduce for_each_slot_rmap_range

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

 




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)

?

> +		   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);
		...
	}
Thanks,

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux