KVM: check for !is_zero_pfn() in kvm_is_mmio_pfn()
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 12 Sep 2014 13:16:00 +0000 (15:16 +0200)
committerChristoffer Dall <christoffer.dall@linaro.org>
Wed, 8 Oct 2014 09:11:27 +0000 (11:11 +0200)
commit331a9a729183832840d656036c5bc2b81942c294
tree6516b6bd3dc0cfdc50009f9dfb66f49652f11c33
parentc4673ca7850dae7146ecc35c69e8f17f2337c7d2
KVM: check for !is_zero_pfn() in kvm_is_mmio_pfn()

Read-only memory ranges may be backed by the zero page, so avoid
misidentifying it a a MMIO pfn.

This fixes another issue I identified when testing QEMU+KVM_UEFI, where
a read to an uninitialized emulated NOR flash brought in the zero page,
but mapped as a read-write device region, because kvm_is_mmio_pfn()
misidentifies it as a MMIO pfn due to its PG_reserved bit being set.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Fixes: b88657674d39 ("ARM: KVM: user_mem_abort: support stage 2 MMIO page mapping")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 85c8555ff07ef09261bd50d603cd4290cff5a8cc)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
virt/kvm/kvm_main.c