diff options
Diffstat (limited to 'arch/powerpc/kernel/exceptions-64s.S')
-rw-r--r-- | arch/powerpc/kernel/exceptions-64s.S | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 87ef8f5ee5bc..200afa5bcfb7 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -1452,20 +1452,36 @@ do_ste_alloc: | |||
1452 | _GLOBAL(do_stab_bolted) | 1452 | _GLOBAL(do_stab_bolted) |
1453 | stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */ | 1453 | stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */ |
1454 | std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */ | 1454 | std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */ |
1455 | mfspr r11,SPRN_DAR /* ea */ | ||
1455 | 1456 | ||
1457 | /* | ||
1458 | * check for bad kernel/user address | ||
1459 | * (ea & ~REGION_MASK) >= PGTABLE_RANGE | ||
1460 | */ | ||
1461 | rldicr. r9,r11,4,(63 - 46 - 4) | ||
1462 | li r9,0 /* VSID = 0 for bad address */ | ||
1463 | bne- 0f | ||
1464 | |||
1465 | /* | ||
1466 | * Calculate VSID: | ||
1467 | * This is the kernel vsid, we take the top for context from | ||
1468 | * the range. context = (MAX_USER_CONTEXT) + ((ea >> 60) - 0xc) + 1 | ||
1469 | * Here we know that (ea >> 60) == 0xc | ||
1470 | */ | ||
1471 | lis r9,(MAX_USER_CONTEXT + 1)@ha | ||
1472 | addi r9,r9,(MAX_USER_CONTEXT + 1)@l | ||
1473 | |||
1474 | srdi r10,r11,SID_SHIFT | ||
1475 | rldimi r10,r9,ESID_BITS,0 /* proto vsid */ | ||
1476 | ASM_VSID_SCRAMBLE(r10, r9, 256M) | ||
1477 | rldic r9,r10,12,16 /* r9 = vsid << 12 */ | ||
1478 | |||
1479 | 0: | ||
1456 | /* Hash to the primary group */ | 1480 | /* Hash to the primary group */ |
1457 | ld r10,PACASTABVIRT(r13) | 1481 | ld r10,PACASTABVIRT(r13) |
1458 | mfspr r11,SPRN_DAR | 1482 | srdi r11,r11,SID_SHIFT |
1459 | srdi r11,r11,28 | ||
1460 | rldimi r10,r11,7,52 /* r10 = first ste of the group */ | 1483 | rldimi r10,r11,7,52 /* r10 = first ste of the group */ |
1461 | 1484 | ||
1462 | /* Calculate VSID */ | ||
1463 | /* This is a kernel address, so protovsid = ESID | 1 << 37 */ | ||
1464 | li r9,0x1 | ||
1465 | rldimi r11,r9,(CONTEXT_BITS + USER_ESID_BITS),0 | ||
1466 | ASM_VSID_SCRAMBLE(r11, r9, 256M) | ||
1467 | rldic r9,r11,12,16 /* r9 = vsid << 12 */ | ||
1468 | |||
1469 | /* Search the primary group for a free entry */ | 1485 | /* Search the primary group for a free entry */ |
1470 | 1: ld r11,0(r10) /* Test valid bit of the current ste */ | 1486 | 1: ld r11,0(r10) /* Test valid bit of the current ste */ |
1471 | andi. r11,r11,0x80 | 1487 | andi. r11,r11,0x80 |