diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-07-07 17:16:45 (GMT) |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-08-02 03:40:33 (GMT) |
commit | edba23e51578f7cb6781461568489fc1825db4ac (patch) | |
tree | 54ce6b22998c1bf7c40cfa43e3ebd8b9df271dcb /arch/x86/kvm/mmu.c | |
parent | fa7bff8f8a7d3de61c0473d0b6dc5a0f4fdc6ac9 (diff) | |
download | linux-fsl-qoriq-edba23e51578f7cb6781461568489fc1825db4ac.tar.xz |
KVM: Return EFAULT from kvm ioctl when guest accesses bad area
Currently if guest access address that belongs to memory slot but is not
backed up by page or page is read only KVM treats it like MMIO access.
Remove that capability. It was never part of the interface and should
not be relied upon.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d8d4832..89d7a2c 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2078,7 +2078,9 @@ static int kvm_handle_bad_page(struct kvm *kvm, gfn_t gfn, pfn_t pfn) if (is_hwpoison_pfn(pfn)) { kvm_send_hwpoison_signal(kvm, gfn); return 0; - } + } else if (is_fault_pfn(pfn)) + return -EFAULT; + return 1; } |