Franck Bui-Huu wrote: > From: Franck Bui-Huu <fbuihuu@xxxxxxxxx> > > This patch introduces __pa_symbol() macro which should be used to > calculate the physical address of kernel symbols. We should fix any > linker issues in this macro, if any, but more importantly > __pa_symbol() uses __pa() to do the real conversion. > > One resulting thing is that we can see that most of CPHYSADDR() uses > weren't needed. > > It also rely on RELOC_HIDE() to avoid any compiler's oddities when > doing arithmetics on symbols. > > Signed-off-by: Franck Bui-Huu <fbuihuu@xxxxxxxxx> > --- > arch/mips/kernel/setup.c | 17 ++++++++++------- > include/asm-mips/page.h | 1 + > 2 files changed, 11 insertions(+), 7 deletions(-) > > diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c > index fdbb508..cccccd5 100644 > --- a/arch/mips/kernel/setup.c > +++ b/arch/mips/kernel/setup.c > @@ -204,12 +204,12 @@ static void __init finalize_initrd(void) > printk(KERN_INFO "Initrd not found or empty"); > goto disable; > } > - if (CPHYSADDR(initrd_end) > PFN_PHYS(max_low_pfn)) { > + if (__pa(initrd_end) > PFN_PHYS(max_low_pfn)) { ISTR this failed on O2, where kernel+initrd are loaded into KSEG0 but the PAGE_OFFSET is for XKPHYS. Thiemo