On 22.09.2011, at 08:50, Liu Yu-B13201 wrote: > > >> -----Original Message----- >> From: kvm-ppc-owner@xxxxxxxxxxxxxxx >> [mailto:kvm-ppc-owner@xxxxxxxxxxxxxxx] On Behalf Of Alexander Graf >> Sent: Tuesday, September 20, 2011 7:36 AM >> To: kvm-ppc@xxxxxxxxxxxxxxx >> Cc: kvm@xxxxxxxxxxxxxxx >> Subject: [PATCH] KVM: PPC: E500: Support hugetlbfs >> >> With hugetlbfs support emerging on e500, we should also support KVM >> backing its guest memory by it. >> >> This patch adds support for hugetlbfs into the e500 shadow mmu code. >> >> Signed-off-by: Alexander Graf <agraf@xxxxxxx> >> --- >> arch/powerpc/kvm/e500_tlb.c | 22 ++++++++++++++++++++++ >> 1 files changed, 22 insertions(+), 0 deletions(-) >> >> diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c >> index ec17148..64f75eb 100644 >> --- a/arch/powerpc/kvm/e500_tlb.c >> +++ b/arch/powerpc/kvm/e500_tlb.c >> @@ -24,6 +24,7 @@ >> #include <linux/sched.h> >> #include <linux/rwsem.h> >> #include <linux/vmalloc.h> >> +#include <linux/hugetlb.h> >> #include <asm/kvm_ppc.h> >> #include <asm/kvm_e500.h> >> >> @@ -673,13 +674,34 @@ static inline void >> kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500, >> pfn &= ~(tsize_pages - 1); >> break; >> } >> + } else if (vma && hva >= vma->vm_start && >> + (vma->vm_flags & VM_HUGETLB)) { > > Why check (vma && hva >= vma->vm_start) twice? What would you do? :) In fact, I only copied the vm_start condition from the pfn code. Scott, why do we have to check this in the first place? We're calling find_vma. Can that return a vma that does not cover the hva we're passing in? Alex -- 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