Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Namhyung Kim and committed by
Ingo Molnar
8fd49936 5989cd6a

+7
+7
arch/x86/include/asm/page.h
··· 37 37 #define __pa_nodebug(x) __phys_addr_nodebug((unsigned long)(x)) 38 38 /* __pa_symbol should be used for C visible symbols. 39 39 This seems to be the official gcc blessed way to do such arithmetic. */ 40 + /* 41 + * We need __phys_reloc_hide() here because gcc may assume that there is no 42 + * overflow during __pa() calculation and can optimize it unexpectedly. 43 + * Newer versions of gcc provide -fno-strict-overflow switch to handle this 44 + * case properly. Once all supported versions of gcc understand it, we can 45 + * remove this Voodoo magic stuff. (i.e. once gcc3.x is deprecated) 46 + */ 40 47 #define __pa_symbol(x) __pa(__phys_reloc_hide((unsigned long)(x))) 41 48 42 49 #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))