KVM: mmu: allow page tables to be in read-only slots
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 9 Sep 2013 11:52:33 +0000 (13:52 +0200)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 15:18:05 +0000 (17:18 +0200)
commit02ef4f0c0d0930d9d44e9929caaee12043447010
treee19856e6b54954921ddfc65c21a5b24f9df90cd1
parent215ed7558daf77d296ee388f64df34b0d479ea07
KVM: mmu: allow page tables to be in read-only slots

Page tables in a read-only memory slot will currently cause a triple
fault because the page walker uses gfn_to_hva and it fails on such a slot.

OVMF uses such a page table; however, real hardware seems to be fine with
that as long as the accessed/dirty bits are set.  Save whether the slot
is readonly, and later check it when updating the accessed and dirty bits.

Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Reviewed-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit ba6a3541545542721ce821d1e7e5ce35752e6fdf)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/x86/kvm/paging_tmpl.h
include/linux/kvm_host.h
virt/kvm/kvm_main.c