[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 05/13] include/processor.h: define cpu_relax(
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH v2 05/13] include/processor.h: define cpu_relax() |
Date: |
Fri, 8 Apr 2016 11:33:17 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 |
On 04/07/2016 10:32 AM, Emilio G. Cota wrote:
> Taken from the linux kernel.
>
> Signed-off-by: Emilio G. Cota <address@hidden>
> ---
> include/qemu/processor.h | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
> create mode 100644 include/qemu/processor.h
Reviewed-by: Richard Henderson <address@hidden>
> +#if defined(__i386__) || defined(__x86_64__)
> +#define cpu_relax() asm volatile("rep; nop" ::: "memory")
> +#endif
Not that it matters much, but for the record there's an ICC inspired builtin in
<xmmintrin.h> for this: _mm_pause(). But so long as we're always using gcc or
clang, that's probably just an extra dependency to worry about.
r~
- [Qemu-devel] [PATCH v2 00/10] tb hash improvements, Emilio G. Cota, 2016/04/07
- [Qemu-devel] [PATCH v2 05/13] include/processor.h: define cpu_relax(), Emilio G. Cota, 2016/04/07
- Re: [Qemu-devel] [PATCH v2 05/13] include/processor.h: define cpu_relax(),
Richard Henderson <=
- [Qemu-devel] [PATCH v2 12/13] qht: add test program, Emilio G. Cota, 2016/04/07
- [Qemu-devel] [PATCH v2 09/13] exec: add tb_hash_func5, derived from xxhash, Emilio G. Cota, 2016/04/07
- [Qemu-devel] [PATCH v2 04/13] seqlock: rename write_lock/unlock to write_begin/end, Emilio G. Cota, 2016/04/07
- [Qemu-devel] [PATCH v2 06/13] qemu-thread: add simple test-and-set spinlock, Emilio G. Cota, 2016/04/07