]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Use try_cmpxchg64 in fast_pf_fix_direct_spte
authorUros Bizjak <ubizjak@gmail.com>
Fri, 20 May 2022 14:46:35 +0000 (16:46 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 15 Jun 2022 12:12:17 +0000 (08:12 -0400)
commitb7b236a4227ed74714e68d812650963c4ad0b8a4
tree1940c829fbe942726c44d801206b3ed482cf70b1
parentb127a89ab1700301b389af6d00234e98ae9b7304
KVM: x86/mmu: Use try_cmpxchg64 in fast_pf_fix_direct_spte

Use try_cmpxchg64 instead of cmpxchg64 (*ptr, old, new) != old in
fast_pf_fix_direct_spte. cmpxchg returns success in ZF flag, so this
change saves a compare after cmpxchg (and related move instruction
in front of cmpxchg).

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Wanpeng Li <wanpengli@tencent.com>
Cc: Jim Mattson <jmattson@google.com>
Cc: Joerg Roedel <joro@8bytes.org>
Message-Id: <20220520144635.63134-1-ubizjak@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c