KVM: x86/mmu: Use atomic ops to set SPTEs in TDP MMU map
authorBen Gardon <bgardon@google.com>
Tue, 2 Feb 2021 18:57:26 +0000 (10:57 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Feb 2021 10:27:44 +0000 (05:27 -0500)
commit9a77daacc87dee9fd63e31243f21894132ed8407
tree1286e1602eb7e55325e92b8cb8565f72587e7064
parenta9442f594147f95307f691cfba0c31e25dc79b9d
KVM: x86/mmu: Use atomic ops to set SPTEs in TDP MMU map

To prepare for handling page faults in parallel, change the TDP MMU
page fault handler to use atomic operations to set SPTEs so that changes
are not lost if multiple threads attempt to modify the same SPTE.

Reviewed-by: Peter Feiner <pfeiner@google.com>
Signed-off-by: Ben Gardon <bgardon@google.com>
Message-Id: <20210202185734.1680553-21-bgardon@google.com>
[Document new locking rules. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Documentation/virt/kvm/locking.rst
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/mmu/tdp_mmu.c