]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86/mmu: Add functions to handle changed TDP SPTEs
authorBen Gardon <bgardon@google.com>
Wed, 14 Oct 2020 18:26:45 +0000 (20:26 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 21 Oct 2020 22:17:01 +0000 (18:17 -0400)
commit97b6c3308c7b5b9ab149c769851e1cf5be2dc380
tree2a240ade0144f4efd8ad877b02f6e08aec260aa1
parented5c11e27840d58d2abad7644ad36246dae6e595
kvm: x86/mmu: Add functions to handle changed TDP SPTEs

The existing bookkeeping done by KVM when a PTE is changed is spread
around several functions. This makes it difficult to remember all the
stats, bitmaps, and other subsystems that need to be updated whenever a
PTE is modified. When a non-leaf PTE is marked non-present or becomes a
leaf PTE, page table memory must also be freed. To simplify the MMU and
facilitate the use of atomic operations on SPTEs in future patches, create
functions to handle some of the bookkeeping required as a result of
a change.

Tested by running kvm-unit-tests and KVM selftests on an Intel Haswell
machine. This series 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>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/mmu_internal.h
arch/x86/kvm/mmu/tdp_mmu.c