mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
KVM: PPC: Book3S HV: Fix kvm_unmap_gfn_range_hv() for Hash MMU
Commit32b48bf851
("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:32b48bf851
("KVM: PPC: Book3S HV: Fix conversion to gfn-based MMU notifier callbacks") Reviewed-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210511105459.800788-1-mpe@ellerman.id.au
This commit is contained in:
parent
63970f3c37
commit
da3bb206c9
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
kvm_unmap_radix(kvm, range->slot, gfn);
|
||||||
} else {
|
} else {
|
||||||
for (gfn = range->start; gfn < range->end; gfn++)
|
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;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue