From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aobDg-0002Up-2h for qemu-devel@nongnu.org; Fri, 08 Apr 2016 14:33:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aobDc-0008Of-QN for qemu-devel@nongnu.org; Fri, 08 Apr 2016 14:33:24 -0400 Received: from mail-qg0-x241.google.com ([2607:f8b0:400d:c04::241]:34852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aobDc-0008Ob-MV for qemu-devel@nongnu.org; Fri, 08 Apr 2016 14:33:20 -0400 Received: by mail-qg0-x241.google.com with SMTP id b32so10775070qgf.2 for ; Fri, 08 Apr 2016 11:33:20 -0700 (PDT) Sender: Richard Henderson References: <1460050358-25025-1-git-send-email-cota@braap.org> <1460050358-25025-6-git-send-email-cota@braap.org> From: Richard Henderson Message-ID: <5707F96D.8040705@twiddle.net> Date: Fri, 8 Apr 2016 11:33:17 -0700 MIME-Version: 1.0 In-Reply-To: <1460050358-25025-6-git-send-email-cota@braap.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 05/13] include/processor.h: define cpu_relax() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" , QEMU Developers , MTTCG Devel Cc: =?UTF-8?Q?Alex_Benn=c3=a9e?= , Paolo Bonzini , Peter Crosthwaite , Peter Maydell , Sergey Fedorov On 04/07/2016 10:32 AM, Emilio G. Cota wrote: > Taken from the linux kernel. > > Signed-off-by: Emilio G. Cota > --- > include/qemu/processor.h | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > create mode 100644 include/qemu/processor.h Reviewed-by: Richard Henderson > +#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 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~