Return-Path: Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:53722 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932287AbeB1Qk0 (ORCPT ); Wed, 28 Feb 2018 11:40:26 -0500 From: Punit Agrawal To: stable@vger.kernel.org Cc: ioana.ciornei@nxp.com, Punit Agrawal , Marc Zyngier , Christoffer Dall Subject: [PATCH] KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2 Date: Wed, 28 Feb 2018 16:40:09 +0000 Message-Id: <20180228164009.3907-1-punit.agrawal@arm.com> Sender: stable-owner@vger.kernel.org List-ID: Commit 45ee9d5e97a4 ("KVM: arm/arm64: Check pagesize when allocating a hugepage at Stage 2") lost the check for PMD_SIZE during the backport to 4.9. Fix this by correcting the condition to detect hugepages during stage 2 allocation. Fixes: 45ee9d5e97a4 ("KVM: arm/arm64: Check pagesize when allocating a hugepage at Stage 2") Reported-by: Ioana Ciornei Signed-off-by: Punit Agrawal Cc: Marc Zyngier Cc: Christoffer Dall -- Hi Greg, This patch fixes a commit in the stable tree that was backported from upstream. I am not sure what the tag convention is for such a commit - so sending as a fix. Thanks, Punit --- arch/arm/kvm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index 2a35c1963f6d..7f868d9bb5ed 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -1284,7 +1284,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, return -EFAULT; } - if (vma_kernel_pagesize(vma) && !logging_active) { + if (vma_kernel_pagesize(vma) == PMD_SIZE && !logging_active) { hugetlb = true; gfn = (fault_ipa & PMD_MASK) >> PAGE_SHIFT; } else { -- 2.16.1