[PATCH -V3 11/11] arch/powerpc: Add 64TB support

Aneesh Kumar K.V aneesh.kumar at linux.vnet.ibm.com
Mon Jul 23 18:49:32 EST 2012


Paul Mackerras <paulus at samba.org> writes:

> On Mon, Jul 09, 2012 at 06:43:41PM +0530, Aneesh Kumar K.V wrote:
>> From: "Aneesh Kumar K.V" <aneesh.kumar at linux.vnet.ibm.com>
>> 
>> Increase max addressable range to 64TB. This is not tested on
>> real hardware yet.
>> 
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>
>> ---
>>  arch/powerpc/include/asm/mmu-hash64.h        |    8 ++++----
>>  arch/powerpc/include/asm/pgtable-ppc64-4k.h  |    2 +-
>>  arch/powerpc/include/asm/pgtable-ppc64-64k.h |    2 +-
>>  arch/powerpc/include/asm/processor.h         |    4 ++--
>>  arch/powerpc/include/asm/sparsemem.h         |    4 ++--
>>  5 files changed, 10 insertions(+), 10 deletions(-)
>> 
>> diff --git a/arch/powerpc/include/asm/mmu-hash64.h b/arch/powerpc/include/asm/mmu-hash64.h
>> index aa0d560..a227ba7 100644
>> --- a/arch/powerpc/include/asm/mmu-hash64.h
>> +++ b/arch/powerpc/include/asm/mmu-hash64.h
>> @@ -374,16 +374,16 @@ extern void slb_set_size(u16 size);
>>   */
>>  
>>  #define VSID_MULTIPLIER_256M	ASM_CONST(200730139)	/* 28-bit prime */
>> -#define VSID_BITS_256M		36
>> +#define VSID_BITS_256M		38
>>  #define VSID_MODULUS_256M	((1UL<<VSID_BITS_256M)-1)
>
> With these settings, the multiplication in ASM_VSID_SCRAMBLE could
> overflow, leading to incorrect results (which would cause occasional
> corruption of user processes under heavy load).  You will need to
> reduce the multiplier to be less than 2^26, and it will need to be
> co-prime with 2^38 - 1.  (Probably, the same value as we use in the 1T
> case would be OK.)

I ended up using the same value as VSID_MULTIPLIER_1T. 


(gdb) p/d 1ull << 38
$1 = 274877906944
(gdb) p/d 274877906943/12538073
$2 = 21923
(gdb) p/d 12538073ll*21923
$5 = 274872174379



More information about the Linuxppc-dev mailing list