All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot for Jan-Simon Möller" <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	dl9pf@gmx.de, tglx@linutronix.de, hpa@linux.intel.com
Subject: [tip:x86/asm] x86, asm: Fix a compilation issue with clang
Date: Thu, 29 Aug 2013 13:31:05 -0700	[thread overview]
Message-ID: <tip-bdfc017eead9bc17cd23317ff42eb7297cb9468a@git.kernel.org> (raw)
In-Reply-To: <1377803585-5913-3-git-send-email-dl9pf@gmx.de>

Commit-ID:  bdfc017eead9bc17cd23317ff42eb7297cb9468a
Gitweb:     http://git.kernel.org/tip/bdfc017eead9bc17cd23317ff42eb7297cb9468a
Author:     Jan-Simon Möller <dl9pf@gmx.de>
AuthorDate: Thu, 29 Aug 2013 21:13:05 +0200
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Thu, 29 Aug 2013 13:26:33 -0700

x86, asm: Fix a compilation issue with clang

Clang does not support the "shortcut" we're taking here for gcc (see below).
The patch uses the macro _ASM_DX to do the job.

>From arch/x86/include/asm/uaccess.h:
/*
 * Careful: we have to cast the result to the type of the pointer
 * for sign reasons.
 *
 * The use of %edx as the register specifier is a bit of a
 * simplification, as gcc only cares about it as the starting point
 * and not size: for a 64-bit value it will use %ecx:%edx on 32 bits
 * (%ecx being the next register in gcc's x86 register sequence), and
 * %rdx on 64 bits.
 */

[ hpa: I consider this a compatibility bug in clang as this reflects a
  bit of a misunderstanding about how register strings are used by
  gcc, but the workaround is straightforward and there is no
  particular reason to not do it. ]

Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de>
Link: http://lkml.kernel.org/r/1377803585-5913-3-git-send-email-dl9pf@gmx.de
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/include/asm/uaccess.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 5ee2687..f715fee 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -162,7 +162,7 @@ __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL))
 #define get_user(x, ptr)						\
 ({									\
 	int __ret_gu;							\
-	register __inttype(*(ptr)) __val_gu asm("%edx");		\
+	register __inttype(*(ptr)) __val_gu asm("%"_ASM_DX);		\
 	__chk_user_ptr(ptr);						\
 	might_fault();							\
 	asm volatile("call __get_user_%P3"				\

  reply	other threads:[~2013-08-29 20:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-29 17:13 [PATCH] [RFC] [X86] Fix a compilation issue with clang dl9pf
2013-08-29 17:28 ` H. Peter Anvin
2013-08-29 18:00   ` [llvmlinux] " Jan-Simon Möller
2013-08-29 18:11     ` H. Peter Anvin
2013-08-29 18:11       ` Jan-Simon Möller
2013-08-29 18:18         ` H. Peter Anvin
2013-08-29 18:23           ` Jan-Simon Möller
2013-08-29 18:31             ` H. Peter Anvin
2013-08-29 18:36               ` Jan-Simon Möller
2013-08-29 18:41                 ` H. Peter Anvin
2013-08-29 19:13                 ` dl9pf
2013-08-29 19:13                   ` [PATCH 1/2] Extend definitions of _ASM_* with a raw format dl9pf
2013-08-29 20:30                     ` [tip:x86/asm] x86, asm: " tip-bot for Jan-Simon Möller
2013-08-29 19:13                   ` [PATCH 2/2] [X86] Fix a compilation issue with clang dl9pf
2013-08-29 20:31                     ` tip-bot for Jan-Simon Möller [this message]
2013-08-29 20:42                     ` [tip:x86/asm] x86, doc: Update uaccess.h comment to reflect clang changes tip-bot for H. Peter Anvin

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=tip-bdfc017eead9bc17cd23317ff42eb7297cb9468a@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=dl9pf@gmx.de \
    --cc=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.