diff options
author | Sean Christopherson <seanjc@google.com> | 2024-01-11 05:00:46 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2024-02-23 03:28:45 +0300 |
commit | f5238c2a60f1e0eb48ce21037bce6f4781afa37f (patch) | |
tree | 0c4b42d809c9aea798d8213540c903af985551d7 /lib/memory-notifier-error-inject.c | |
parent | d746182337c205660fd4d8eaa5fdc4f4e8320b9a (diff) | |
download | linux-f5238c2a60f1e0eb48ce21037bce6f4781afa37f.tar.xz |
KVM: x86/mmu: Check for usable TDP MMU root while holding mmu_lock for read
When allocating a new TDP MMU root, check for a usable root while holding
mmu_lock for read and only acquire mmu_lock for write if a new root needs
to be created. There is no need to serialize other MMU operations if a
vCPU is simply grabbing a reference to an existing root, holding mmu_lock
for write is "necessary" (spoiler alert, it's not strictly necessary) only
to ensure KVM doesn't end up with duplicate roots.
Allowing vCPUs to get "new" roots in parallel is beneficial to VM boot and
to setups that frequently delete memslots, i.e. which force all vCPUs to
reload all roots.
Link: https://lore.kernel.org/r/20240111020048.844847-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions