KVM: x86/mmu: Add a helper function to check if an SPTE needs atomic write
authorVipin Sharma <vipinsh@google.com>
Tue, 21 Mar 2023 22:00:09 +0000 (15:00 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 4 Apr 2023 19:37:30 +0000 (12:37 -0700)
commit41e07665f1a683064f4c69b0d652dff1baf5d689
treec4afdb7b81cbacd4c969703e4e8d8167d765056d
parent50f13998451effea5c5fdc70fe576f8b435d6224
KVM: x86/mmu: Add a helper function to check if an SPTE needs atomic write

Move conditions in kvm_tdp_mmu_write_spte() to check if an SPTE should
be written atomically or not to a separate function.

This new function, kvm_tdp_mmu_spte_need_atomic_write(),  will be used
in future commits to optimize clearing bits in SPTEs.

Signed-off-by: Vipin Sharma <vipinsh@google.com>
Reviewed-by: David Matlack <dmatlack@google.com>
Reviewed-by: Ben Gardon <bgardon@google.com>
Link: https://lore.kernel.org/r/20230321220021.2119033-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/mmu/tdp_iter.h