KVM: MMU: Push clean gpte write protection out of gpte_access()
authorAvi Kivity <avi@redhat.com>
Wed, 12 Sep 2012 10:44:53 +0000 (13:44 +0300)
committerAvi Kivity <avi@redhat.com>
Thu, 20 Sep 2012 10:00:07 +0000 (13:00 +0300)
commit8ea667f259e3767fd3ee85a885c14e417835695e
treed9fd33bd07ac8c497ba5fc94528da5b28626edef
parent879238fecc051d95037ae76332916209a7770709
KVM: MMU: Push clean gpte write protection out of gpte_access()

gpte_access() computes the access permissions of a guest pte and also
write-protects clean gptes.  This is wrong when we are servicing a
write fault (since we'll be setting the dirty bit momentarily) but
correct when instantiating a speculative spte, or when servicing a
read fault (since we'll want to trap a following write in order to
set the dirty bit).

It doesn't seem to hurt in practice, but in order to make the code
readable, push the write protection out of gpte_access() and into
a new protect_clean_gpte() which is called explicitly when needed.

Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/mmu.c
arch/x86/kvm/mmu.h
arch/x86/kvm/paging_tmpl.h
This page took 0.031583 seconds and 5 git commands to generate.