On 05.10.2011, at 18:06, Scott Wood wrote: > On 10/05/2011 09:37 AM, Alexander Graf wrote: >> diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c >> index ec17148..1dd96a9 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,12 +674,31 @@ 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)) { >> + unsigned long psize = vma_kernel_pagesize(vma); >> + >> + tsize = (gtlbe->mas1 & MAS1_TSIZE_MASK) >> >> + MAS1_TSIZE_SHIFT; >> + >> + /* >> + * Take the largest page size that satisfies both host >> + * and guest mapping >> + */ >> + tsize = min(__ilog2(psize) - 10, tsize); > > Any reason for __ilog2() rather than ilog2()? Shouldn't make a > difference, just curious about avoiding the public interface. I grep'ed through the kernel tree and only found __ilog2 defined as well as mostly users for __ilog2, so I figured there's got to be a reason ;) 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