linux-mips
[Top] [All Lists]

Re: [PATCH 4/16] TO_PHYS_MASK for loongson2

To: tiansm@lemote.com
Subject: Re: [PATCH 4/16] TO_PHYS_MASK for loongson2
From: Ralf Baechle <ralf@linux-mips.org>
Date: Wed, 18 Apr 2007 13:02:40 +0100
Cc: linux-mips@linux-mips.org, Fuxin Zhang <zhangfx@lemote.com>
In-reply-to: <11766507661133-git-send-email-tiansm@lemote.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <11766507651736-git-send-email-tiansm@lemote.com> <11766507661317-git-send-email-tiansm@lemote.com> <11766507661726-git-send-email-tiansm@lemote.com> <11766507662638-git-send-email-tiansm@lemote.com> <11766507661133-git-send-email-tiansm@lemote.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.2i
On Sun, Apr 15, 2007 at 11:25:53PM +0800, tiansm@lemote.com wrote:

> diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
> index 964c5ed..a4d9a07 100644
> --- a/include/asm-mips/addrspace.h
> +++ b/include/asm-mips/addrspace.h
> @@ -145,7 +145,7 @@
>  #define TO_PHYS_MASK _CONST64_(0x000000ffffffffff)   /* 2^^40 - 1 */
>  #endif
>  
> -#if defined (CONFIG_CPU_R10000)
> +#if defined (CONFIG_CPU_R10000) || defined (CONFIG_CPU_LOONGSON2)
>  #define TO_PHYS_MASK _CONST64_(0x000000ffffffffff)   /* 2^^40 - 1 */
>  #endif

How about we define TO_PHYS_MASK to 2^57-1 for all processors instead?

The use of TO_PHYS_MASK is to strip of the high bits of of a XKPHYS kernel
virtual address.  Allowing for the top 2 region and 3 cache mode bits that
would leave 59 bits.  If we also allow for the macro to be used for
stripping off the 2 R10000 "uncached attribute" bits we would be down to
57 bits.  Not sure if that would be useful - but we got gobs of address
space to burn and adding yet another #ifdef for every new 64-bit processor
or even variant to addrspace.h isn't really the way to go.

  Ralf

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