Re: [PATCH v2 4/9] KVM: MMU: introduce slot_handle_level_range() and its helpers

2015-05-12 Thread Xiao Guangrong
On 05/12/2015 04:22 PM, Paolo Bonzini wrote: On 12/05/2015 04:32, Xiao Guangrong wrote: + if (iterator.rmap) + flush |= fn(kvm, iterator.rmap); + + if (need_resched() || spin_needbreak(>mmu_lock)) { + if (flush &

Re: [PATCH v2 4/9] KVM: MMU: introduce slot_handle_level_range() and its helpers

2015-05-12 Thread Paolo Bonzini
On 12/05/2015 04:32, Xiao Guangrong wrote: > + if (iterator.rmap) > + flush |= fn(kvm, iterator.rmap); > + > + if (need_resched() || spin_needbreak(>mmu_lock)) { > + if (flush & lock_flush_tlb) { &&, not &. (Cosmetic only). Paolo

Re: [PATCH v2 4/9] KVM: MMU: introduce slot_handle_level_range() and its helpers

2015-05-12 Thread Paolo Bonzini
On 12/05/2015 04:32, Xiao Guangrong wrote: + if (iterator.rmap) + flush |= fn(kvm, iterator.rmap); + + if (need_resched() || spin_needbreak(kvm-mmu_lock)) { + if (flush lock_flush_tlb) { , not . (Cosmetic only). Paolo -- To

Re: [PATCH v2 4/9] KVM: MMU: introduce slot_handle_level_range() and its helpers

2015-05-12 Thread Xiao Guangrong
On 05/12/2015 04:22 PM, Paolo Bonzini wrote: On 12/05/2015 04:32, Xiao Guangrong wrote: + if (iterator.rmap) + flush |= fn(kvm, iterator.rmap); + + if (need_resched() || spin_needbreak(kvm-mmu_lock)) { + if (flush

[PATCH v2 4/9] KVM: MMU: introduce slot_handle_level_range() and its helpers

2015-05-11 Thread Xiao Guangrong
There are several places walking all rmaps for the memslot so that introduce common functions to cleanup the code Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 69 ++ 1 file changed, 69 insertions(+) diff --git a/arch/x86/kvm/mmu.c

[PATCH v2 4/9] KVM: MMU: introduce slot_handle_level_range() and its helpers

2015-05-11 Thread Xiao Guangrong
There are several places walking all rmaps for the memslot so that introduce common functions to cleanup the code Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mmu.c | 69 ++ 1 file changed, 69 insertions(+)