]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 14 Sep 2014 14:26:05 +0000 (16:26 +0200)
commitcf37f825d1f779b1dc203d918ff3a37a8caaefef
tree34a42659b3e0cbb905c3083b37a62d4e9594d206
parenta9f85d12016a58ed536409a17fe35749b84150d6
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: 4d03e60f17f2 ("ARM: KVM: user_mem_abort: support stage 2 MMIO page mapping")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c