kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] x86/KVM/VMX: Introduce and use try_cmpxchg64()
@ 2020-12-15 18:28 Uros Bizjak
  2020-12-15 18:28 ` [PATCH 1/3] asm-generic/atomic: Add try_cmpxchg64() instrumentation Uros Bizjak
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Uros Bizjak @ 2020-12-15 18:28 UTC (permalink / raw)
  To: x86, kvm, linux-kernel
  Cc: Uros Bizjak, Will Deacon, Peter Zijlstra, Boqun Feng,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
	Paolo Bonzini, Sean Christopherson, Vitaly Kuznetsov, Wanpeng Li,
	Jim Mattson, Joerg Roedel

This patch series introduces try_cmpxchg64() atomic locking function.

try_cmpxchg64() provides the same interface for 64 bit and 32 bit targets,
emits CMPXCHGQ for 64 bit targets and CMPXCHG8B for 32 bit targets,
and provides appropriate fallbacks when CMPXCHG8B is unavailable.

try_cmpxchg64() reuses flags from CMPXCHGQ/CMPXCHG8B instructions and
avoids unneeded CMP for 64 bit targets or XOR/XOR/OR sequence for
32 bit targets.

Cc: Will Deacon <will@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.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>

Uros Bizjak (3):
  asm-generic/atomic: Add try_cmpxchg64() instrumentation
  locking/atomic/x86: Introduce arch_try_cmpxchg64()
  KVM/VMX: Use try_cmpxchg64() in posted_intr.c

 arch/x86/include/asm/cmpxchg_32.h         | 62 +++++++++++++++++++----
 arch/x86/include/asm/cmpxchg_64.h         |  6 +++
 arch/x86/kvm/vmx/posted_intr.c            |  9 ++--
 include/asm-generic/atomic-instrumented.h | 46 ++++++++++++++++-
 scripts/atomic/gen-atomic-instrumented.sh |  2 +-
 5 files changed, 108 insertions(+), 17 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-01-18 18:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 18:28 [PATCH 0/3] x86/KVM/VMX: Introduce and use try_cmpxchg64() Uros Bizjak
2020-12-15 18:28 ` [PATCH 1/3] asm-generic/atomic: Add try_cmpxchg64() instrumentation Uros Bizjak
2020-12-15 18:28 ` [PATCH 2/3] locking/atomic/x86: Introduce arch_try_cmpxchg64() Uros Bizjak
2020-12-15 20:08   ` Uros Bizjak
2020-12-16 15:37   ` kernel test robot
2020-12-15 18:28 ` [PATCH 3/3] KVM/VMX: Use try_cmpxchg64() in posted_intr.c Uros Bizjak
2021-01-15 19:28   ` Sean Christopherson
2021-01-15 18:09 ` [PATCH 0/3] x86/KVM/VMX: Introduce and use try_cmpxchg64() Sean Christopherson
2021-01-18 18:26 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).