+ i386-define-__pa_symbol.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     i386: define __pa_symbol()
has been added to the -mm tree.  Its filename is
     i386-define-__pa_symbol.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: i386: define __pa_symbol()
From: Vivek Goyal <vgoyal@xxxxxxxxxx>

On x86_64 we have to be careful with calculating the physical address of
kernel symbols.  Both because of compiler odditities and because the symbols
live in a different range of the virtual address space.

Having a defintition of __pa_symbol that works on both x86_64 and i386
simplifies writing code that works for both x86_64 and i386 that has these
kinds of dependencies.

So this patch adds the trivial i386 __pa_symbol definition.

Added assembly magic similar to RELOC_HIDE as suggested by Andi Kleen.  Just
picked it up from x86_64.

Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
Signed-off-by: Vivek Goyal <vgoyal@xxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 include/asm-i386/page.h |    3 +++
 1 file changed, 3 insertions(+)

diff -puN include/asm-i386/page.h~i386-define-__pa_symbol include/asm-i386/page.h
--- a/include/asm-i386/page.h~i386-define-__pa_symbol
+++ a/include/asm-i386/page.h
@@ -126,6 +126,9 @@ extern int page_is_ram(unsigned long pag
 #define VMALLOC_RESERVE		((unsigned long)__VMALLOC_RESERVE)
 #define MAXMEM			(-__PAGE_OFFSET-__VMALLOC_RESERVE)
 #define __pa(x)			((unsigned long)(x)-PAGE_OFFSET)
+/* __pa_symbol should be used for C visible symbols.
+   This seems to be the official gcc blessed way to do such arithmetic. */
+#define __pa_symbol(x)          __pa(RELOC_HIDE((unsigned long)(x),0))
 #define __va(x)			((void *)((unsigned long)(x)+PAGE_OFFSET))
 #define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
 #ifdef CONFIG_FLATMEM
_

Patches currently in -mm which might be from vgoyal@xxxxxxxxxx are

i386-distinguish-absolute-symbols.patch
i386-remove-unnecessary-align-in-vmlinuxldss.patch
i386-force-data-segment-to-be-4k-aligned.patch
i386-define-__pa_symbol.patch
i386-reserve-kernel-memory-starting-from-_text.patch
i386-config_physical_start-cleanup.patch
i386-kallsyms-generate-relocatable-symbols.patch
i386-relocatable-kernel-support.patch
i386-warn-upon-absolute-relocations-being-present.patch
i386-implement-config_physical_align.patch
i386-extend-bzimage-protocol-for-relocatable-protected-mode-kernel.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux