Re: IP32 prom crashes due to __pa() funkiness

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

 



Kumba wrote:

After going through all the fun to get rid of CPHYSADDR, I see no
point really to bring it back.

The patch restores CPHYSADDR() but in __pa()'s _implementation_. It
makes a huge difference.

I think CPHYSADDR() is not that bad for 64 bits kernels. With such
beasts we need to handle two PAGE_OFFSET values if we stick with the
current implementation of __pa(). Magically using CPHYSADDR() removes
this need. OTOH, CPHYSADDR() is quite bad for mapped kernels.

But do we really care in 64 bits world ?

 Plus that patch unnecessarily complicates those defines.  As I
highlighted in my original mail, O2 doesn't need CPHYSADDR added to
__pa(), it just needs the conditional define for __pa_page_offset to
be a little bit more flexible.


I don't see why the patch complicates those defines. It actually gets
rid of CONFIG_BUILD_ELF64 and __pa_page_offset(). OK I could have
written it a little bit more readable:

#ifdef CONFIG_64BIT
#define __pa(x)							\
({								\
	unsigned long __x = (unsigned long)(x);			\
	__x < CKSEG0 ? XPHYSADDR(__x) : CPHYSADDR(__x);		\
})
#else
#define __pa(x)							\
	((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET)
#endif

Yes, it actually increases size code for CONFIG_64BIT because we
always test if the virtual address is from XKPHYS or CKSEG0. But how
much ? I would say not a lot, and it maybe worths it since we get rid
of an obscure config option.

		Franck

--
              Franck


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux