linux/arch/x86/kvm/mmu
Lai Jiangshan f6f6195b88 kvm x86/mmu: use KVM_REQ_MMU_SYNC to sync when needed
When kvm_mmu_get_page() gets a page with unsynced children, the spt
pagetable is unsynchronized with the guest pagetable. But the
guest might not issue a "flush" operation on it when the pagetable
entry is changed from zero or other cases. The hypervisor has the
responsibility to synchronize the pagetables.

KVM behaved as above for many years, But commit 8c8560b833
("KVM: x86/mmu: Use KVM_REQ_TLB_FLUSH_CURRENT for MMU specific flushes")
inadvertently included a line of code to change it without giving any
reason in the changelog. It is clear that the commit's intention was to
change KVM_REQ_TLB_FLUSH -> KVM_REQ_TLB_FLUSH_CURRENT, so we don't
needlessly flush other contexts; however, one of the hunks changed
a nearby KVM_REQ_MMU_SYNC instead.  This patch changes it back.

Link: https://lore.kernel.org/lkml/20200320212833.3507-26-sean.j.christopherson@intel.com/
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
Message-Id: <20200902135421.31158-1-jiangshanlai@gmail.com>
fixes: 8c8560b833 ("KVM: x86/mmu: Use KVM_REQ_TLB_FLUSH_CURRENT for MMU specific flushes")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-11 13:16:55 -04:00
..
mmu_audit.c KVM: x86/mmu: Rename page_header() to to_shadow_page() 2020-07-08 16:21:55 -04:00
mmu_internal.h KVM: x86/mmu: Rename page_header() to to_shadow_page() 2020-07-08 16:21:55 -04:00
mmu.c kvm x86/mmu: use KVM_REQ_MMU_SYNC to sync when needed 2020-09-11 13:16:55 -04:00
mmutrace.h KVM: x86/mmu: Move mmu_audit.c and mmutrace.h into the mmu/ sub-directory 2020-07-08 16:21:53 -04:00
page_track.c KVM: x86/mmu: Add MMU-internal header 2020-07-08 16:21:54 -04:00
paging_tmpl.h s390: implement diag318 2020-08-06 12:59:31 -07:00