]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Flush TLBs after zap in TDP MMU PF handler
authorBen Gardon <bgardon@google.com>
Tue, 2 Feb 2021 18:57:27 +0000 (10:57 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Feb 2021 10:27:44 +0000 (05:27 -0500)
commite952b8e705642dc280be30a2271e16aac7964e9e
tree44c42033d98884e06469bf488e178b399c40e75e
parent6d749a90f42b716a0550d1dcf7b394c594b025ec
KVM: x86/mmu: Flush TLBs after zap in TDP MMU PF handler

When the TDP MMU is allowed to handle page faults in parallel there is
the possiblity of a race where an SPTE is cleared and then imediately
replaced with a present SPTE pointing to a different PFN, before the
TLBs can be flushed. This race would violate architectural specs. Ensure
that the TLBs are flushed properly before other threads are allowed to
install any present value for the SPTE.

Reviewed-by: Peter Feiner <pfeiner@google.com>
Signed-off-by: Ben Gardon <bgardon@google.com>
Message-Id: <20210202185734.1680553-22-bgardon@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/spte.h
arch/x86/kvm/mmu/tdp_mmu.c