Messages in this thread | | | Date | Fri, 15 Jan 2021 11:28:40 -0800 | From | Sean Christopherson <> | Subject | Re: [PATCH 3/3] KVM/VMX: Use try_cmpxchg64() in posted_intr.c |
| |
On Tue, Dec 15, 2020, Uros Bizjak wrote: > Use try_cmpxchg64() instead of cmpxchg64() to reuse flags from > cmpxchg/cmpxchg8b instruction. For 64 bit targets flags reuse > avoids a CMP instruction,
It ends up doing way more (in a good way) than eliminate the CMP, at least with gcc-10. There's a ripple effect and the compiler ends up generating the loop in-line, whereas without the "try" version the loop is put out-of-line.
> while for 32 bit targets flags reuse avoids XOR/XOR/OR instruction sequence. > > Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
| |