From: Xiao Guangrong Date: Thu, 17 Apr 2014 09:06:15 +0000 (+0800) Subject: KVM: MMU: flush tlb if the spte can be locklessly modified X-Git-Tag: omap-for-v3.16/fixes-against-rc1~39^2~8^2~55 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f31c9595e3c87f68dc54b3269e900f3017ed405;p=pandora-kernel.git KVM: MMU: flush tlb if the spte can be locklessly modified Relax the tlb flush condition since we will write-protect the spte out of mmu lock. Note lockless write-protection only marks the writable spte to readonly and the spte can be writable only if both SPTE_HOST_WRITEABLE and SPTE_MMU_WRITEABLE are set (that are tested by spte_is_locklessly_modifiable) This patch is used to avoid this kind of race: VCPU 0 VCPU 1 lockless wirte protection: set spte.w = 0 lock mmu-lock write protection the spte to sync shadow page, see spte.w = 0, then without flush tlb unlock mmu-lock !!! At this point, the shadow page can still be writable due to the corrupt tlb entry Flush all TLB Reviewed-by: Marcelo Tosatti Signed-off-by: Xiao Guangrong Signed-off-by: Marcelo Tosatti --- Reading git-diff-tree failed