diff options
author | Paul Mackerras <paulus@ozlabs.org> | 2020-04-16 14:23:43 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2020-04-21 09:23:41 +1000 |
commit | ae49dedaa92b55258544aace7c585094b862ef79 (patch) | |
tree | 98437fd801e53fb7602f2eb0253070fb05d4881c /arch/arm/mach-pxa/z2.c | |
parent | dbef2808af6c594922fe32833b30f55f35e9da6d (diff) | |
download | linux-stable-ae49dedaa92b55258544aace7c585094b862ef79.tar.gz linux-stable-ae49dedaa92b55258544aace7c585094b862ef79.tar.bz2 linux-stable-ae49dedaa92b55258544aace7c585094b862ef79.zip |
KVM: PPC: Book3S HV: Handle non-present PTEs in page fault functions
Since cd758a9b57ee "KVM: PPC: Book3S HV: Use __gfn_to_pfn_memslot in HPT
page fault handler", it's been possible in fairly rare circumstances to
load a non-present PTE in kvmppc_book3s_hv_page_fault() when running a
guest on a POWER8 host.
Because that case wasn't checked for, we could misinterpret the non-present
PTE as being a cache-inhibited PTE. That could mismatch with the
corresponding hash PTE, which would cause the function to fail with -EFAULT
a little further down. That would propagate up to the KVM_RUN ioctl()
generally causing the KVM userspace (usually qemu) to fall over.
This addresses the problem by catching that case and returning to the guest
instead.
For completeness, this fixes the radix page fault handler in the same
way. For radix this didn't cause any obvious misbehaviour, because we
ended up putting the non-present PTE into the guest's partition-scoped
page tables, leading immediately to another hypervisor data/instruction
storage interrupt, which would go through the page fault path again
and fix things up.
Fixes: cd758a9b57ee "KVM: PPC: Book3S HV: Use __gfn_to_pfn_memslot in HPT page fault handler"
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1820402
Reported-by: David Gibson <david@gibson.dropbear.id.au>
Tested-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/arm/mach-pxa/z2.c')
0 files changed, 0 insertions, 0 deletions