From: Marc Zyngier <marc.zyngier@arm.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org, Alex Graf <agraf@suse.de>,
Andrew Jones <drjones@redhat.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Christoffer Dall <cdall@linaro.org>,
Shanker Donthineni <shankerd@codeaurora.org>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Suzuki K Poulose <Suzuki.Poulose@arm.com>
Subject: [PATCH 3/4] KVM: arm/arm64: Handle hva aging while destroying the vm
Date: Thu, 3 Aug 2017 16:28:56 +0100 [thread overview]
Message-ID: <20170803152857.32055-4-marc.zyngier@arm.com> (raw)
In-Reply-To: <20170803152857.32055-1-marc.zyngier@arm.com>
From: Suzuki K Poulose <Suzuki.Poulose@arm.com>
The mmu_notifier_release() callback of KVM triggers cleaning up
the stage2 page table on kvm-arm. However there could be other
notifier callbacks in parallel with the mmu_notifier_release(),
which could cause the call backs ending up in an empty stage2
page table. Make sure we check it for all the notifier callbacks.
Cc: stable@vger.kernel.org
Fixes: commit 293f29363 ("kvm-arm: Unmap shadow pagetables properly")
Reported-by: Alex Graf <agraf@suse.de>
Reviewed-by: Christoffer Dall <cdall@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
virt/kvm/arm/mmu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
index 0e1fc75f3585..2ea21dac0b44 100644
--- a/virt/kvm/arm/mmu.c
+++ b/virt/kvm/arm/mmu.c
@@ -1718,12 +1718,16 @@ static int kvm_test_age_hva_handler(struct kvm *kvm, gpa_t gpa, u64 size, void *
int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end)
{
+ if (!kvm->arch.pgd)
+ return 0;
trace_kvm_age_hva(start, end);
return handle_hva_to_gpa(kvm, start, end, kvm_age_hva_handler, NULL);
}
int kvm_test_age_hva(struct kvm *kvm, unsigned long hva)
{
+ if (!kvm->arch.pgd)
+ return 0;
trace_kvm_test_age_hva(hva);
return handle_hva_to_gpa(kvm, hva, hva, kvm_test_age_hva_handler, NULL);
}
--
2.11.0
next prev parent reply other threads:[~2017-08-03 15:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-03 15:28 [PATCH 0/4] KVM/ARM fixes for 4.13-rc4 Marc Zyngier
2017-08-03 15:28 ` [PATCH 1/4] KVM: arm/arm64: Fix bug in advertising KVM_CAP_MSI_DEVID capability Marc Zyngier
2017-08-03 15:28 ` [PATCH 2/4] KVM: arm/arm64: PMU: Fix overflow interrupt injection Marc Zyngier
2017-08-03 15:28 ` Marc Zyngier [this message]
2017-08-03 15:28 ` [PATCH 4/4] KVM: arm/arm64: vgic: Use READ_ONCE fo cmpxchg Marc Zyngier
2017-08-03 17:44 ` [PATCH 0/4] KVM/ARM fixes for 4.13-rc4 Radim Krčmář
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170803152857.32055-4-marc.zyngier@arm.com \
--to=marc.zyngier@arm.com \
--cc=agraf@suse.de \
--cc=catalin.marinas@arm.com \
--cc=cdall@linaro.org \
--cc=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=shankerd@codeaurora.org \
--cc=suzuki.poulose@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox