Hi, On 9/2/20 12:53 PM, Alexandru Elisei wrote: > [..] > And we end up jumping back to retry forever. IMO, in user_mem_abort(), if PUD_SIZE > == PMD_SIZE, we should try to map PMD_SIZE instead of PUD_SIZE. Maybe something > like this? > > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c > index ba00bcc0c884..178267dec511 100644 > --- a/arch/arm64/kvm/mmu.c > +++ b/arch/arm64/kvm/mmu.c > @@ -1886,8 +1886,10 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, > phys_addr_t fault_ipa, > * As for PUD huge maps, we must make sure that we have at least > * 3 levels, i.e, PMD is not folded. > */ > - if (vma_pagesize == PMD_SIZE || > - (vma_pagesize == PUD_SIZE && kvm_stage2_has_pmd(kvm))) > + if (vma_pagesize == PUD_SIZE && !kvm_stage2_has_pmd(kvm)) > + vma_pagesize = PMD_SIZE; > + > + if (vma_pagesize == PUD_SIZE || vma_pagesize == PUD_SIZE) > gfn = (fault_ipa & huge_page_mask(hstate_vma(vma))) >> PAGE_SHIFT; > mmap_read_unlock(current->mm); Erm... goes without saying, completely untested and the check should have been: + if (vma_pagesize == PUD_SIZE || vma_pagesize == PMD_SIZE) Thanks, Alex _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm