From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 1 Aug 2012 15:35:05 +1000 From: Paul Mackerras To: "Aneesh Kumar K.V" Subject: Re: [PATCH -V5 13/13] arch/powerpc: Update VSID allocation documentation Message-ID: <20120801053505.GG24014@drongo> References: <1343647339-25576-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1343647339-25576-14-git-send-email-aneesh.kumar@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1343647339-25576-14-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Cc: linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, Jul 30, 2012 at 04:52:19PM +0530, Aneesh Kumar K.V wrote: > From: "Aneesh Kumar K.V" > > This update the proto-VSID and VSID scramble related information > to be more generic by using names instead of current values. Comments below... > - * VSID allocation > + * VSID allocation (256MB segment) > * > - * We first generate a 36-bit "proto-VSID". For kernel addresses this > - * is equal to the ESID, for user addresses it is: > - * (context << 15) | (esid & 0x7fff) > + * We first generate a 38-bit "proto-VSID". For kernel addresses this > + * is equal to the ESID | 1 << 37, for user addresses it is: > + * (context << USER_ESID_BITS) | (esid & (1U << USER_ESID_BITS)) ^^^^^^^^^^^^^^^^^^^^^^ should be ((1U << USER_ESID_BITS) - 1) > * > - * The two forms are distinguishable because the top bit is 0 for user > - * addresses, whereas the top two bits are 1 for kernel addresses. > - * Proto-VSIDs with the top two bits equal to 0b10 are reserved for > - * now. > + * This splits the proto-VSID into the below range > + * 0 - (2^(CONTEXT_BITS + USER_ESID_BITS) - 1) : User proto-VSID range > + * 2^(CONTEXT_BITS + USER_ESID_BITS) - 2^(VSID_BITS) : Kernel proto-VSID range Perhaps point out also that CONTEXT_BITS + USER_ESID_BITS == VSID_BITS - 1, that is, you have assigned half of the space to user processes and half to the kernel. > -/* > - * WARNING - If you change these you must make sure the asm > - * implementations in slb_allocate (slb_low.S), do_stab_bolted > - * (head.S) and ASM_VSID_SCRAMBLE (below) are changed accordingly. > - */ Are you absolutely sure that nothing in the assembly code would need to be changed if someone changed these definitions? Paul.