]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Require mmu_lock be held for write in unyielding root iter
authorSean Christopherson <seanjc@google.com>
Sat, 26 Feb 2022 00:15:24 +0000 (00:15 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Mar 2022 14:31:47 +0000 (09:31 -0500)
commit3c63a89459a4be4fdcf88114573d5f63a524f14e
tree58281acdb4f1677fdb7c228e14723f689b399ca9
parent14f209241b4e02c362e60fd04be4aee0b70ca4e1
KVM: x86/mmu: Require mmu_lock be held for write in unyielding root iter

Assert that mmu_lock is held for write by users of the yield-unfriendly
TDP iterator.  The nature of a shared walk means that the caller needs to
play nice with other tasks modifying the page tables, which is more or
less the same thing as playing nice with yielding.  Theoretically, KVM
could gain a flow where it could legitimately take mmu_lock for read in
a non-preemptible context, but that's highly unlikely and any such case
should be viewed with a fair amount of scrutiny.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Ben Gardon <bgardon@google.com>
Message-Id: <20220226001546.360188-7-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/tdp_mmu.c