All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Namhyung Kim <namhyung@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	tglx@linutronix.de, namhyung@gmail.com, mingo@elte.hu
Subject: [tip:x86/urgent] x86: Document __phys_reloc_hide() usage in __pa_symbol()
Date: Wed, 11 Aug 2010 07:44:12 GMT	[thread overview]
Message-ID: <tip-8fd49936a8cac246fc9ed85508556c82cd44cf68@git.kernel.org> (raw)
In-Reply-To: <1281508661-29507-1-git-send-email-namhyung@gmail.com>

Commit-ID:  8fd49936a8cac246fc9ed85508556c82cd44cf68
Gitweb:     http://git.kernel.org/tip/8fd49936a8cac246fc9ed85508556c82cd44cf68
Author:     Namhyung Kim <namhyung@gmail.com>
AuthorDate: Wed, 11 Aug 2010 15:37:41 +0900
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 11 Aug 2010 08:43:49 +0200

x86: Document __phys_reloc_hide() usage in __pa_symbol()

Until all supported versions of gcc recognize
-fno-strict-overflow, we should keep the RELOC_HIDE() magic in
__pa_symbol(). Comment it.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
LKML-Reference: <1281508661-29507-1-git-send-email-namhyung@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/include/asm/page.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h
index 625c3f0..8ca8283 100644
--- a/arch/x86/include/asm/page.h
+++ b/arch/x86/include/asm/page.h
@@ -37,6 +37,13 @@ static inline void copy_user_page(void *to, void *from, unsigned long vaddr,
 #define __pa_nodebug(x)	__phys_addr_nodebug((unsigned long)(x))
 /* __pa_symbol should be used for C visible symbols.
    This seems to be the official gcc blessed way to do such arithmetic. */
+/*
+ * We need __phys_reloc_hide() here because gcc may assume that there is no
+ * overflow during __pa() calculation and can optimize it unexpectedly.
+ * Newer versions of gcc provide -fno-strict-overflow switch to handle this
+ * case properly. Once all supported versions of gcc understand it, we can
+ * remove this Voodoo magic stuff. (i.e. once gcc3.x is deprecated)
+ */
 #define __pa_symbol(x)	__pa(__phys_reloc_hide((unsigned long)(x)))
 
 #define __va(x)			((void *)((unsigned long)(x)+PAGE_OFFSET))

  reply	other threads:[~2010-08-11  7:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-08 21:38 [PATCH] x86: remove __phys_reloc_hide Namhyung Kim
2010-08-09  6:22 ` Andi Kleen
2010-08-09  6:40   ` Namhyung Kim
2010-08-09  6:44     ` Andi Kleen
2010-08-09  7:04       ` Namhyung Kim
2010-08-09  7:22         ` Andi Kleen
2010-08-09  7:47           ` Namhyung Kim
2010-08-09 18:56           ` H. Peter Anvin
2010-08-10  7:05             ` Ingo Molnar
2010-08-10 10:46               ` Namhyung Kim
2010-08-11  5:44                 ` Namhyung Kim
2010-08-11 19:09                   ` H. Peter Anvin
2010-08-11  6:37               ` [PATCH] x86: add a comment to __pa_symbol Namhyung Kim
2010-08-11  7:44                 ` tip-bot for Namhyung Kim [this message]
2018-06-19 23:00   ` [PATCH] x86: remove __phys_reloc_hide Thomas Gleixner
2010-08-09  8:07 ` Ingo Molnar
2010-08-09 18:56   ` 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-8fd49936a8cac246fc9ed85508556c82cd44cf68@git.kernel.org \
    --to=namhyung@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --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.