From: Sean Christopherson <seanjc@google.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com,
kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
pbonzini@redhat.com
Subject: Re: [PATCH] KVM: PPC: Book3S HV: Fix kvm_unmap_gfn_range_hv() for Hash MMU
Date: Tue, 11 May 2021 16:39:03 +0000 [thread overview]
Message-ID: <YJqzJyBvU0A8VG9p@google.com> (raw)
In-Reply-To: <20210511105459.800788-1-mpe@ellerman.id.au>
On Tue, May 11, 2021, Michael Ellerman wrote:
> Commit 32b48bf8514c ("KVM: PPC: Book3S HV: Fix conversion to gfn-based
> MMU notifier callbacks") fixed kvm_unmap_gfn_range_hv() by adding a for
> loop over each gfn in the range.
>
> But for the Hash MMU it repeatedly calls kvm_unmap_rmapp() with the
> first gfn of the range, rather than iterating through the range.
>
> This exhibits as strange guest behaviour, sometimes crashing in firmare,
> or booting and then guest userspace crashing unexpectedly.
>
> Fix it by passing the iterator, gfn, to kvm_unmap_rmapp().
>
> Fixes: 32b48bf8514c ("KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks")
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
> arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> I plan to take this via the powerpc fixes branch.
FWIW,
Reviewed-by: Sean Christopherson <seanjc@google.com>
>
> diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> index 2d9193cd73be..c63e263312a4 100644
> --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
> +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> @@ -840,7 +840,7 @@ bool kvm_unmap_gfn_range_hv(struct kvm *kvm, struct kvm_gfn_range *range)
> kvm_unmap_radix(kvm, range->slot, gfn);
> } else {
> for (gfn = range->start; gfn < range->end; gfn++)
> - kvm_unmap_rmapp(kvm, range->slot, range->start);
> + kvm_unmap_rmapp(kvm, range->slot, gfn);
> }
>
> return false;
> --
> 2.25.1
>
next prev parent reply other threads:[~2021-05-11 16:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-11 10:54 [PATCH] KVM: PPC: Book3S HV: Fix kvm_unmap_gfn_range_hv() for Hash MMU Michael Ellerman
2021-05-11 16:39 ` Sean Christopherson [this message]
2021-05-12 3:20 ` Michael Ellerman
2021-05-15 22:43 ` Michael Ellerman
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=YJqzJyBvU0A8VG9p@google.com \
--to=seanjc@google.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=pbonzini@redhat.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