From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752844AbbJFSyU (ORCPT ); Tue, 6 Oct 2015 14:54:20 -0400 Received: from mail-yk0-f178.google.com ([209.85.160.178]:34652 "EHLO mail-yk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752293AbbJFSyS (ORCPT ); Tue, 6 Oct 2015 14:54:18 -0400 From: Pranith Kumar To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), linux-kernel@vger.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Subject: [PATCH] x86: cmpxchg_double: Add missing memory clobber Date: Tue, 6 Oct 2015 14:54:29 -0400 Message-Id: <1444157670-19951-1-git-send-email-bobby.prani@gmail.com> X-Mailer: git-send-email 2.5.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We are reading from memory locations pointed to by p1 and p2 in the asm block. Add a memory clobber flag to make gcc aware of this. Signed-off-by: Pranith Kumar --- arch/x86/include/asm/cmpxchg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h index 4a2e5bc..3e83949 100644 --- a/arch/x86/include/asm/cmpxchg.h +++ b/arch/x86/include/asm/cmpxchg.h @@ -214,7 +214,8 @@ extern void __add_wrong_size(void) : "=a" (__ret), "+d" (__old2), \ "+m" (*(p1)), "+m" (*(p2)) \ : "i" (2 * sizeof(long)), "a" (__old1), \ - "b" (__new1), "c" (__new2)); \ + "b" (__new1), "c" (__new2) \ + : "memory"); \ __ret; \ }) -- 2.5.3