linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: mroos@linux.ee
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org,
	peterz@infradead.org, x86@kernel.org
Subject: Re: cmpxchg.h:245:2: error: ‘asm’ operand has impossible constraints
Date: Thu, 6 Sep 2018 15:54:06 +0200	[thread overview]
Message-ID: <cfc3163c-40f2-ad5e-b303-bb8dc4288022@suse.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1808312122300.1349@nanos.tec.linutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1322 bytes --]

Hey Meelis,

On Mon, 27 Aug 2018, Meelis Roos wrote:

> While trying to compile v4.18-13105-gaba16dc5cf93 with gcc 5.3.1 on a
> 32-bit x86 configured for AMD K6
>   CC      mm/slub.o
> In file included from ./arch/x86/include/asm/atomic.h:8:0,
>                  from ./include/linux/atomic.h:7,
>                  from ./arch/x86/include/asm/thread_info.h:54,
>                  from ./include/linux/thread_info.h:38,
>                  from ./arch/x86/include/asm/preempt.h:7,
>                  from ./include/linux/preempt.h:81,
>                  from ./include/linux/spinlock.h:51,
>                  from ./include/linux/mmzone.h:8,
>                  from ./include/linux/gfp.h:6,
>                  from ./include/linux/mm.h:10,
>                  from mm/slub.c:13:
> mm/slub.c: In function ‘__slab_free’:
> ./arch/x86/include/asm/cmpxchg.h:245:2: error: ‘asm’ operand has
impossible constraints
>   asm volatile(pfx "cmpxchg%c4b %2; sete %0"   \

Could you give the attched patch a try? I've been hit by this issue
via kbuild robot complaining about one of my patches which didn't
touch the asm stuff above.

I suspect the "=a" contraint of the outputs and "a" of the inputs
are the culprit. You could save me from having to search through
all the debian repos for a gcc showing that issue...


Juergen

[-- Attachment #2: 0001-x86-correct-inline-asm-constraints-in-__cmpxchg_doub.patch --]
[-- Type: text/x-patch, Size: 1147 bytes --]

From 252450d28ffc8fbfd5b332d0b97990ae12a207d9 Mon Sep 17 00:00:00 2001
From: Juergen Gross <jgross@suse.com>
Date: Wed, 5 Sep 2018 11:32:26 +0200
Subject: [PATCH] x86: correct inline asm constraints in __cmpxchg_double()

Specifying "=a" for output constraints and "a" for input seems to be
wrong. Instead "0" should be used for the input constraint.

Fixes: cdcd629869fab ("x86: Fix and improve cmpxchg_double{,_local}()")
Cc: stable@vger.kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/include/asm/cmpxchg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h
index a55d79b233d3..b3b4d61a8969 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/arch/x86/include/asm/cmpxchg.h
@@ -245,7 +245,7 @@ extern void __add_wrong_size(void)
 	asm volatile(pfx "cmpxchg%c4b %2; sete %0"			\
 		     : "=a" (__ret), "+d" (__old2),			\
 		       "+m" (*(p1)), "+m" (*(p2))			\
-		     : "i" (2 * sizeof(long)), "a" (__old1),		\
+		     : "i" (2 * sizeof(long)), "0" (__old1),		\
 		       "b" (__new1), "c" (__new2));			\
 	__ret;								\
 })
-- 
2.16.4


  parent reply	other threads:[~2018-09-06 13:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-26 21:27 cmpxchg.h:245:2: error: ‘asm’ operand has impossible constraints Meelis Roos
2018-08-31 20:01 ` Thomas Gleixner
2018-08-31 20:10   ` Meelis Roos
2018-08-31 20:30     ` Thomas Gleixner
     [not found]       ` <alpine.LRH.2.21.1808312335560.6505@math.ut.ee>
2018-08-31 20:43         ` Thomas Gleixner
2018-08-31 20:45           ` Meelis Roos
2018-09-06 13:54   ` Juergen Gross [this message]
2018-09-06 14:43     ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cfc3163c-40f2-ad5e-b303-bb8dc4288022@suse.com \
    --to=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mroos@linux.ee \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).