]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MMU: flush tlb out of mmu lock when write-protect the sptes
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Thu, 17 Apr 2014 09:06:16 +0000 (17:06 +0800)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 23 Apr 2014 20:49:52 +0000 (17:49 -0300)
commitd94b76fc542174f6e34530f08dbf3b1abff476fd
treeaac35e7d0e127e2a553282a686085b000d786791
parentd4b0ede7a89984df3a19d726cb7bd106efe6fa5f
KVM: MMU: flush tlb out of mmu lock when write-protect the sptes

Now we can flush all the TLBs out of the mmu lock without TLB corruption when
write-proect the sptes, it is because:
- we have marked large sptes readonly instead of dropping them that means we
  just change the spte from writable to readonly so that we only need to care
  the case of changing spte from present to present (changing the spte from
  present to nonpresent will flush all the TLBs immediately), in other words,
  the only case we need to care is mmu_spte_update()

- in mmu_spte_update(), we haved checked
  SPTE_HOST_WRITEABLE | PTE_MMU_WRITEABLE instead of PT_WRITABLE_MASK, that
  means it does not depend on PT_WRITABLE_MASK anymore

Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/mmu.c
arch/x86/kvm/mmu.h
arch/x86/kvm/x86.c