Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2798852pxv; Sun, 25 Jul 2021 06:04:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDUEQnl/s4v3/CHcaZ7GOf0tMdVwOfduxjH52SbTEIAHK5KikwWXonWjyk2fPPhGu6zvt9 X-Received: by 2002:a17:906:838f:: with SMTP id p15mr13156622ejx.300.1627218256178; Sun, 25 Jul 2021 06:04:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627218256; cv=none; d=google.com; s=arc-20160816; b=fyxbXmRbokrh99Nouru3jTULAz3eeOo8mx1eBiieJKGaKLqsAMjjGvorSAFFYEgie7 0wWU4T8CBl/mqUOi13Otj605NFkNpDn4YooQ0q6RA+YW/cQwB9YkXx+os4HI3ZPxfOUs EibsWPxL6yHwKlzUrPdWOgUr6Dw647qhnREpXB6DzdVIi+oJISiY9TmBhEs1mH27B3Yd dkDyWh3GuWfILtG0Htvt4JPI7O+cx4uMjH/uUOI6PvUXia/Dh2tZ7OVHfkY7karl7BHo TnIHXRHYAdDKiXWSSdooQKL2xSDDXPa8NmNoisBAcCwqHL0SwAI9Ql4Zz152L1y8SWpj +3TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=+9TKIFkZEA3YbMwU+rkBEvgT3VtPqwxHfrnGRJJcpqg=; b=JlRiGrWkZrptL9v4s3uBjmTi7W9nhtWvuyMm4GQAdDA0/IVA+x67ggpEU50nGjNgzy 0ek/FiV1NY0SLHqIGpNsva4ANdlE8n5dTafPpC/wm8YO+sKRTZaYV9pd3TSTsHz1/Chk nxh8yJy/3QLIK5hVDhySYpna1TTuBC+wIOGBUbIwdl5M8DACuCPXGWSZrUaeFoluX3KC syVbsZ1rAZWL0f3jFMMjmfEUr2UVSpz16Te0feOI9PQo94guD6TKH/UzUCJmQq5kwS6U mAabbdk3cYWVS6lIbrIEb8P6EIv6jdazoGyRafzSf3s4cufU7ffqK1+eyjrs0u0xAu/b 7w5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si341470edv.244.2021.07.25.06.03.08; Sun, 25 Jul 2021 06:04:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230393AbhGYMUk (ORCPT + 99 others); Sun, 25 Jul 2021 08:20:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230244AbhGYMUi (ORCPT ); Sun, 25 Jul 2021 08:20:38 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87B8EC061764 for ; Sun, 25 Jul 2021 06:01:08 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:fcbf:bbc7:105a:68c4]) by albert.telenet-ops.be with bizsmtp id ZR14250031nuCSN06R14sA; Sun, 25 Jul 2021 15:01:05 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1m7dkd-000iIZ-Co; Sun, 25 Jul 2021 15:01:03 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1m7beF-001XHi-MS; Sun, 25 Jul 2021 12:46:19 +0200 From: Geert Uytterhoeven To: Greg Ungerer , Will Deacon , Peter Zijlstra , Boqun Feng Cc: Brendan Jackman , kernel test robot , Arnd Bergmann , Alexander Viro , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] m68k: Fix asm register constraints for atomic ops Date: Sun, 25 Jul 2021 12:46:18 +0200 Message-Id: <20210725104618.365790-1-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Depending on register assignment by the compiler: {standard input}:3084: Error: operands mismatch -- statement `andl %a1,%d1' ignored {standard input}:3145: Error: operands mismatch -- statement `orl %a1,%d1' ignored {standard input}:3195: Error: operands mismatch -- statement `eorl %a1,%d1' ignored Indeed, the first operand must not be an address register. Fix this by adjusting the register constraint from "g" (general purpose register) to "d" (data register). Fixes: e39d88ea3ce4a471 ("locking/atomic, arch/m68k: Implement atomic_fetch_{add,sub,and,or,xor}()") Fixes: d839bae4269aea46 ("locking,arch,m68k: Fold atomic_ops") Reported-by: kernel test robot Reported-by: Arnd Bergmann Reported-by: Alexander Viro Signed-off-by: Geert Uytterhoeven --- Personally, I have never seen this failure in an 68020+ build, but I can reproduce it on Coldfire with the config provided by lkp (with bogus CONFIG_RMW_INSNS=y). Technically, the issue was present before, but I doubt adding pre-v3.18 Fixes tags would make any difference for stable... --- arch/m68k/include/asm/atomic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/m68k/include/asm/atomic.h b/arch/m68k/include/asm/atomic.h index 8637bf8a2f652009..2d5a6e556754290b 100644 --- a/arch/m68k/include/asm/atomic.h +++ b/arch/m68k/include/asm/atomic.h @@ -48,7 +48,7 @@ static inline int arch_atomic_##op##_return(int i, atomic_t *v) \ " casl %2,%1,%0\n" \ " jne 1b" \ : "+m" (*v), "=&d" (t), "=&d" (tmp) \ - : "g" (i), "2" (arch_atomic_read(v))); \ + : "d" (i), "2" (arch_atomic_read(v))); \ return t; \ } @@ -63,7 +63,7 @@ static inline int arch_atomic_fetch_##op(int i, atomic_t *v) \ " casl %2,%1,%0\n" \ " jne 1b" \ : "+m" (*v), "=&d" (t), "=&d" (tmp) \ - : "g" (i), "2" (arch_atomic_read(v))); \ + : "d" (i), "2" (arch_atomic_read(v))); \ return tmp; \ } -- 2.25.1