[PATCH -V3 11/11] arch/powerpc: Add 64TB support
    Aneesh Kumar K.V 
    aneesh.kumar at linux.vnet.ibm.com
       
    Wed Jul 25 05:50:51 EST 2012
    
    
  
"Aneesh Kumar K.V" <aneesh.kumar at linux.vnet.ibm.com> writes:
......
>  /* Returns the segment size indicator for a user address */
> @@ -534,11 +544,17 @@ static inline int user_segment_size(unsigned long addr)
>  static inline unsigned long get_vsid(unsigned long context, unsigned long ea,
>  				     int ssize)
>  {
> -	if (ssize == MMU_SEGSIZE_256M)
> -		return vsid_scramble((context << USER_ESID_BITS)
> -				     | (ea >> SID_SHIFT), 256M);
> -	return vsid_scramble((context << USER_ESID_BITS_1T)
> -			     | (ea >> SID_SHIFT_1T), 1T);
> +	unsigned long proto_vsid;
> +	if (ssize == MMU_SEGSIZE_256M) {
> +		proto_vsid = ((context << USER_ESID_BITS) |(ea >> SID_SHIFT));
> +		/* truncate this to 37 bits */
> +		proto_vsid &= (1UL << (CONTEXT_BITS + USER_ESID_BITS)) - 1;
> +		return vsid_scramble(proto_vsid, 256M);
> +	}
> +	proto_vsid = ((context << USER_ESID_BITS_1T) | (ea >> SID_SHIFT_1T));
> +	/* truncate this to 25 bits */
> +	proto_vsid &= (1UL << (CONTEXT_BITS + USER_ESID_BITS_1T)) - 1;
> +	return vsid_scramble( proto_vsid, 1T);
>  }
I guess we can drop this hunk and related asm, because context is
guaranteed to be  <= CONTEXT_BITS (via MAX_CONTEXTS )
-aneesh
    
    
More information about the Linuxppc-dev
mailing list