[Top] [All Lists]

Re: IP32 prom crashes due to __pa() funkiness

To: Kumba <>
Subject: Re: IP32 prom crashes due to __pa() funkiness
From: "Franck Bui-Huu" <>
Date: Fri, 23 Mar 2007 16:12:10 +0100
Cc: "Linux MIPS List" <>, "Arnaud Giersch" <>
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed;; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Wzt8c/ubbz8PXxz4uoZaG7/NdjCmOg7rohikJFDCI1CrNbNRIUJEwsrjQx9AsOygcNFtL+GwiD5R34b5gb34pHMKFvTtVeZgRVbYekXKp5yTbisQ2ycpvW+FneRn8jVYJ8vixIlkzbYaS+Jv9eknDwCEsVHpJSJoVpa9ZD921ig=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PR9Gv9r+AC6EbG9Fy17Sb9dfu2/ZkO7UGqm0NovULBD6f/KFLvpIfbYY+re0jpjjvVVvt2YlrKwWX/v3NEqlsfRhUGwQL58//Fo9MCi96a5guWC6zSocUYfLCsVB4m65/OmLoP03rG4Xqna9HryWLfyOvXwk+LB9hDZhJTS6TKg=
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <> <> <> <> <> <> <>
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);              \
#define __pa(x)                                                 \
        ((unsigned long)(x) - PAGE_OFFSET + PHYS_OFFSET)

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.



<Prev in Thread] Current Thread [Next in Thread>