linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] KVM: MMU: cleanup mapping-level
@ 2012-11-05 12:09 Xiao Guangrong
  2012-11-05 12:10 ` [PATCH 2/5] KVM: MMU: simplify mmu_set_spte Xiao Guangrong
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Xiao Guangrong @ 2012-11-05 12:09 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Marcelo Tosatti, LKML, KVM

Use min() to cleanup mapping_level

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
---
 arch/x86/kvm/mmu.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 1d8869c..692ebb1 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -831,8 +831,7 @@ static int mapping_level(struct kvm_vcpu *vcpu, gfn_t large_gfn)
 	if (host_level == PT_PAGE_TABLE_LEVEL)
 		return host_level;

-	max_level = kvm_x86_ops->get_lpage_level() < host_level ?
-		kvm_x86_ops->get_lpage_level() : host_level;
+	max_level = min(kvm_x86_ops->get_lpage_level(), host_level);

 	for (level = PT_DIRECTORY_LEVEL; level <= max_level; ++level)
 		if (has_wrprotected_page(vcpu->kvm, large_gfn, level))
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-11-21  3:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-05 12:09 [PATCH 1/5] KVM: MMU: cleanup mapping-level Xiao Guangrong
2012-11-05 12:10 ` [PATCH 2/5] KVM: MMU: simplify mmu_set_spte Xiao Guangrong
2012-11-12 23:12   ` Marcelo Tosatti
2012-11-13  8:39     ` Xiao Guangrong
2012-11-20 22:18       ` Marcelo Tosatti
2012-11-20 23:23         ` Xiao Guangrong
2012-11-20 23:51           ` Marcelo Tosatti
2012-11-21  3:19             ` Xiao Guangrong
2012-11-05 12:11 ` [PATCH 3/5] KVM: MMU: simplify set_spte Xiao Guangrong
2012-11-20 22:24   ` Marcelo Tosatti
2012-11-20 23:26     ` Xiao Guangrong
2012-11-05 12:12 ` [PATCH 4/5] KVM: MMU: move adjusting softmmu pte access to FNAME(page_fault) Xiao Guangrong
2012-11-20 22:27   ` Marcelo Tosatti
2012-11-20 23:28     ` Xiao Guangrong
2012-11-05 12:12 ` [PATCH 5/5] KVM: MMU: remove pt_access in mmu_set_spte Xiao Guangrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).