@@ -355,10 +355,10 @@ extern void slb_set_size(u16 size);
*
* For user processes max context id is limited to ((1ul << 19) - 6)
* for kernel space, we use the top 4 context ids to map address as below
- * 0x7fffb - [ 0xc000000000000000 - 0xcfffffffffffffff ]
- * 0x7fffc - [ 0xd000000000000000 - 0xdfffffffffffffff ]
- * 0x7fffd - [ 0xe000000000000000 - 0xefffffffffffffff ]
- * 0x7fffe - [ 0xf000000000000000 - 0xffffffffffffffff ]
+ * 0x7fffc - [ 0xc000000000000000 - 0xcfffffffffffffff ]
+ * 0x7fffd - [ 0xd000000000000000 - 0xdfffffffffffffff ]
+ * 0x7fffe - [ 0xe000000000000000 - 0xefffffffffffffff ]
+ * 0x7ffff - [ 0xf000000000000000 - 0xffffffffffffffff ]
*
* The proto-VSIDs are then scrambled into real VSIDs with the
* multiplicative hash:
@@ -561,10 +561,10 @@ static inline unsigned long get_vsid(unsigned long context, unsigned long ea,
* This is only valid for addresses >= PAGE_OFFSET
*
* For kernel space, we use the top 4 context ids to map address as below
- * 0x7fffb - [ 0xc000000000000000 - 0xcfffffffffffffff ]
- * 0x7fffc - [ 0xd000000000000000 - 0xdfffffffffffffff ]
- * 0x7fffd - [ 0xe000000000000000 - 0xefffffffffffffff ]
- * 0x7fffe - [ 0xf000000000000000 - 0xffffffffffffffff ]
+ * 0x7fffc - [ 0xc000000000000000 - 0xcfffffffffffffff ]
+ * 0x7fffd - [ 0xd000000000000000 - 0xdfffffffffffffff ]
+ * 0x7fffe - [ 0xe000000000000000 - 0xefffffffffffffff ]
+ * 0x7ffff - [ 0xf000000000000000 - 0xffffffffffffffff ]
*/
static inline unsigned long get_kernel_vsid(unsigned long ea, int ssize)
{
@@ -574,7 +574,7 @@ static inline unsigned long get_kernel_vsid(unsigned long ea, int ssize)
* kernel take the top 4 context from the available range
*/
c_index = ((ea >> 60) - 0xc);
- context = (MAX_CONTEXT - 4) + c_index;
+ context = (MAX_CONTEXT - 3) + c_index;
#ifdef CONFIG_DEBUG_VM
/*
* Drop the c_index related bits from ea, so we get
@@ -1273,10 +1273,10 @@ _GLOBAL(do_stab_bolted)
/*
* Calculate VSID:
* This is the kernel vsid, we take the top for context from
- * the range. context = (MAX_CONTEXT - 4) + ((ea >> 60) - 0xc)
+ * the range. context = (MAX_CONTEXT - 3) + ((ea >> 60) - 0xc)
*/
srdi r9,r11,60
- subi r9,r9,(0xc + 4 + 1)
+ subi r9,r9,(0xc + 3 + 1)
lis r10,8
add r9,r9,r10 /* context */
@@ -48,6 +48,7 @@ again:
return err;
if (index > (MAX_CONTEXT - 4)) {
+ /* Top 4 context id values are used for kernel */
spin_lock(&mmu_context_lock);
ida_remove(&mmu_context_ida, index);
spin_unlock(&mmu_context_lock);
@@ -56,10 +56,10 @@ _GLOBAL(slb_allocate_realmode)
_GLOBAL(slb_miss_kernel_load_linear)
li r11,0
/*
- * context = (MAX_CONTEXT - 4) + ((ea >> 60) - 0xc)
+ * context = (MAX_CONTEXT - 3) + ((ea >> 60) - 0xc)
*/
srdi r9,r3,60
- subi r9,r9,(0xc + 4 + 1)
+ subi r9,r9,(0xc + 3 + 1)
lis r10, 8
add r9,r9,r10
srdi r10,r3,SID_SHIFT /* get esid */
@@ -99,10 +99,10 @@ _GLOBAL(slb_miss_kernel_load_vmemmap)
li r11,0
6:
/*
- * context = (MAX_CONTEXT - 4) + ((ea >> 60) - 0xc)
+ * context = (MAX_CONTEXT - 3) + ((ea >> 60) - 0xc)
*/
srdi r9,r3,60
- subi r9,r9,(0xc + 4 + 1)
+ subi r9,r9,(0xc + 3 + 1)
lis r10,8
add r9,r9,r10
srdi r10,r3,28 /* FIXME!! doing it twice */