KVM: MMU: Adjust shadow paging to work when SMEP=1 and CR0.WP=0
authorAvi Kivity <avi@redhat.com>
Mon, 6 Jun 2011 13:11:54 +0000 (16:11 +0300)
committerAvi Kivity <avi@redhat.com>
Tue, 12 Jul 2011 10:16:26 +0000 (13:16 +0300)
commit411c588dfb863feee78b721d5e7c86ac38921c49
treebb60c136f0392fbbd8f222fd2049f265746a7eae
parenta01c8f9b4e266df1d7166d23216f2060648f862d
KVM: MMU: Adjust shadow paging to work when SMEP=1 and CR0.WP=0

When CR0.WP=0, we sometimes map user pages as kernel pages (to allow
the kernel to write to them).  Unfortunately this also allows the kernel
to fetch from these pages, even if CR4.SMEP is set.

Adjust for this by also setting NX on the spte in these circumstances.

Signed-off-by: Avi Kivity <avi@redhat.com>
Documentation/virtual/kvm/mmu.txt
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu.c