public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2
@ 2018-02-28 16:40 Punit Agrawal
  2018-02-28 17:45 ` Patch "KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2" has been added to the 4.9-stable tree gregkh
  2018-02-28 17:45 ` [PATCH] KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2 Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Punit Agrawal @ 2018-02-28 16:40 UTC (permalink / raw)
  To: stable; +Cc: ioana.ciornei, Punit Agrawal, Marc Zyngier, Christoffer Dall

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 <ioana.ciornei@nxp.com>
Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
--
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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Patch "KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2" has been added to the 4.9-stable tree
  2018-02-28 16:40 [PATCH] KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2 Punit Agrawal
@ 2018-02-28 17:45 ` gregkh
  2018-02-28 17:45 ` [PATCH] KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2 Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: gregkh @ 2018-02-28 17:45 UTC (permalink / raw)
  To: punit.agrawal, christoffer.dall, gregkh, ioana.ciornei,
	marc.zyngier
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kvm-arm-arm64-fix-check-for-hugepage-size-when-allocating-at-stage-2.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From punit.agrawal@arm.com  Wed Feb 28 18:44:38 2018
From: Punit Agrawal <punit.agrawal@arm.com>
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 <punit.agrawal@arm.com>, Marc Zyngier <marc.zyngier@arm.com>, Christoffer Dall <christoffer.dall@linaro.org>
Message-ID: <20180228164009.3907-1-punit.agrawal@arm.com>

From: Punit Agrawal <punit.agrawal@arm.com>

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 <ioana.ciornei@nxp.com>
Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 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 {


Patches currently in stable-queue which might be from punit.agrawal@arm.com are

queue-4.9/kvm-arm-arm64-fix-check-for-hugepage-size-when-allocating-at-stage-2.patch

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2
  2018-02-28 16:40 [PATCH] KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2 Punit Agrawal
  2018-02-28 17:45 ` Patch "KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2" has been added to the 4.9-stable tree gregkh
@ 2018-02-28 17:45 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2018-02-28 17:45 UTC (permalink / raw)
  To: Punit Agrawal; +Cc: stable, ioana.ciornei, Marc Zyngier, Christoffer Dall

On Wed, Feb 28, 2018 at 04:40:09PM +0000, Punit Agrawal wrote:
> 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 <ioana.ciornei@nxp.com>
> Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Christoffer Dall <christoffer.dall@linaro.org>
> --
> 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.

What you did here was just fine, now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-28 17:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-28 16:40 [PATCH] KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2 Punit Agrawal
2018-02-28 17:45 ` Patch "KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2" has been added to the 4.9-stable tree gregkh
2018-02-28 17:45 ` [PATCH] KVM: arm/arm64: Fix check for hugepage size when allocating at Stage 2 Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox