kvm: x86/mmu: Separate making SPTEs from set_spte
authorBen Gardon <bgardon@google.com>
Wed, 14 Oct 2020 18:26:41 +0000 (20:26 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 21 Oct 2020 22:16:58 +0000 (18:16 -0400)
commit799a4190e7341b9bb24549245f2b8f7d11c65360
tree9486e46fb5cfdcfb5cacca151e18dd52578341a0
parentcc4674d0ded069c1673fd6fec94a18e436828195
kvm: x86/mmu: Separate making SPTEs from set_spte

Separate the functions for generating leaf page table entries from the
function that inserts them into the paging structure. This refactoring
will facilitate changes to the MMU sychronization model to use atomic
compare / exchanges (which are not guaranteed to succeed) instead of a
monolithic MMU lock.

No functional change expected.

Tested by running kvm-unit-tests and KVM selftests on an Intel Haswell
machine. This commit introduced no new failures.

This series can be viewed in Gerrit at:
https://linux-review.googlesource.com/c/virt/kvm/kvm/+/2538

Signed-off-by: Ben Gardon <bgardon@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c