From e43c6908409c8bdaa31ee0b80f463b6d1c53f7e2 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 28 Feb 2018 18:45:14 +0100 Subject: [PATCH] 4.9-stable patches added patches: kvm-arm-arm64-fix-check-for-hugepage-size-when-allocating-at-stage-2.patch --- ...page-size-when-allocating-at-stage-2.patch | 38 +++++++++++++++++++ queue-4.9/series | 1 + 2 files changed, 39 insertions(+) create mode 100644 queue-4.9/kvm-arm-arm64-fix-check-for-hugepage-size-when-allocating-at-stage-2.patch diff --git a/queue-4.9/kvm-arm-arm64-fix-check-for-hugepage-size-when-allocating-at-stage-2.patch b/queue-4.9/kvm-arm-arm64-fix-check-for-hugepage-size-when-allocating-at-stage-2.patch new file mode 100644 index 00000000000..d9cebed5126 --- /dev/null +++ b/queue-4.9/kvm-arm-arm64-fix-check-for-hugepage-size-when-allocating-at-stage-2.patch @@ -0,0 +1,38 @@ +From punit.agrawal@arm.com Wed Feb 28 18:44:38 2018 +From: Punit Agrawal +Date: Wed, 28 Feb 2018 16:40:09 +0000 +Subject: KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2 +To: stable@vger.kernel.org +Cc: ioana.ciornei@nxp.com, Punit Agrawal , Marc Zyngier , Christoffer Dall +Message-ID: <20180228164009.3907-1-punit.agrawal@arm.com> + +From: Punit Agrawal + +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 +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm/kvm/mmu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/kvm/mmu.c ++++ b/arch/arm/kvm/mmu.c +@@ -1284,7 +1284,7 @@ static int user_mem_abort(struct kvm_vcp + 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 { diff --git a/queue-4.9/series b/queue-4.9/series index e3c88130b9d..231264a2fa9 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -52,3 +52,4 @@ xen-gntdev-fix-off-by-one-error-when-unmapping-with-holes.patch xen-gntdev-fix-partial-gntdev_mmap-cleanup.patch sctp-make-use-of-pre-calculated-len.patch net-gianfar_ptp-move-set_fipers-to-spinlock-protecting-area.patch +kvm-arm-arm64-fix-check-for-hugepage-size-when-allocating-at-stage-2.patch -- 2.47.3