linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: MMU: fix huge page adapted on non-PAE host
@ 2012-05-28  6:10 Xiao Guangrong
  2012-05-28 10:57 ` Avi Kivity
  0 siblings, 1 reply; 15+ messages in thread
From: Xiao Guangrong @ 2012-05-28  6:10 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Marcelo Tosatti, LKML, KVM

The huge page size is 4M on non-PAE host, but 2M page size is used in
transparent_hugepage_adjust(), so the page we get after adjust the
mapping level is not the head page, the BUG_ON() will be triggered

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 72102e0..be3cea4 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2595,8 +2595,7 @@ static void transparent_hugepage_adjust(struct kvm_vcpu *vcpu,
 			*gfnp = gfn;
 			kvm_release_pfn_clean(pfn);
 			pfn &= ~mask;
-			if (!get_page_unless_zero(pfn_to_page(pfn)))
-				BUG();
+			kvm_get_pfn(pfn);
 			*pfnp = pfn;
 		}
 	}
-- 
1.7.7.6


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

end of thread, other threads:[~2012-05-29 14:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-28  6:10 [PATCH] KVM: MMU: fix huge page adapted on non-PAE host Xiao Guangrong
2012-05-28 10:57 ` Avi Kivity
2012-05-28 11:39   ` Xiao Guangrong
2012-05-28 12:24     ` Avi Kivity
2012-05-28 12:56       ` Xiao Guangrong
2012-05-28 13:14         ` Avi Kivity
2012-05-28 13:41           ` Xiao Guangrong
2012-05-28 13:53             ` Avi Kivity
2012-05-28 14:05               ` Xiao Guangrong
2012-05-28 14:20                 ` Avi Kivity
2012-05-28 14:42                   ` Andrea Arcangeli
2012-05-28 14:32               ` Andrea Arcangeli
2012-05-28 14:40                 ` Avi Kivity
2012-05-28 14:44                   ` Andrea Arcangeli
2012-05-29 14:23                     ` Avi Kivity

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).