aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2016-09-16 02:42:06 -0400
committerScott Wood <oss@buserror.net>2016-09-25 03:38:57 -0400
commit73a532061c65f4e15a3aa7d75fde81203749562b (patch)
treecfd5b2838ddfb79b9dcfaf75c26c3ca01ceb91ac
parentd1b9f81456d27dd44c0e7193a8a24ec0bfeda98b (diff)
powerpc/8xx: Move additional DTLBMiss handlers out of exception area
When all options are activated, there is not enough space for the DTLBMiss handlers that handles IMMR area and linear RAM pages in the exception area once we have added hugepage handling. So lets move them after .0x2000 Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Scott Wood <oss@buserror.net>
-rw-r--r--arch/powerpc/kernel/head_8xx.S84
1 files changed, 42 insertions, 42 deletions
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 451e78929f16..f674dfae1e95 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -380,26 +380,6 @@ InstructionTLBMiss:
380 EXCEPTION_EPILOG_0 380 EXCEPTION_EPILOG_0
381 rfi 381 rfi
382 382
383/*
384 * Bottom part of DataStoreTLBMiss handler for IMMR area
385 * not enough space in the DataStoreTLBMiss area
386 */
387DTLBMissIMMR:
388 mtcr r10
389 /* Set 512k byte guarded page and mark it valid */
390 li r10, MD_PS512K | MD_GUARDED | MD_SVALID
391 MTSPR_CPU6(SPRN_MD_TWC, r10, r11)
392 mfspr r10, SPRN_IMMR /* Get current IMMR */
393 rlwinm r10, r10, 0, 0xfff80000 /* Get 512 kbytes boundary */
394 ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY | \
395 _PAGE_PRESENT | _PAGE_NO_CACHE
396 MTSPR_CPU6(SPRN_MD_RPN, r10, r11) /* Update TLB entry */
397
398 li r11, RPN_PATTERN
399 mtspr SPRN_DAR, r11 /* Tag DAR */
400 EXCEPTION_EPILOG_0
401 rfi
402
403 . = 0x1200 383 . = 0x1200
404DataStoreTLBMiss: 384DataStoreTLBMiss:
405 EXCEPTION_PROLOG_0 385 EXCEPTION_PROLOG_0
@@ -418,7 +398,7 @@ DataStoreTLBMiss:
418_ENTRY(DTLBMiss_jmp) 398_ENTRY(DTLBMiss_jmp)
419 beq- DTLBMissIMMR 399 beq- DTLBMissIMMR
420#endif 400#endif
421 bge- cr7, 4f 401 bge- cr7, DTLBMissLinear
422 402
423 mfspr r11, SPRN_M_TW /* Get level 1 table */ 403 mfspr r11, SPRN_M_TW /* Get level 1 table */
4243: 4043:
@@ -485,27 +465,6 @@ _ENTRY(DTLBMiss_jmp)
485 EXCEPTION_EPILOG_0 465 EXCEPTION_EPILOG_0
486 rfi 466 rfi
487 467
4884:
489_ENTRY(DTLBMiss_cmp)
490 cmpli cr0, r11, (PAGE_OFFSET + 0x1800000)@h
491 lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha
492 bge- 3b
493
494 mtcr r10
495 /* Set 8M byte page and mark it valid */
496 li r10, MD_PS8MEG | MD_SVALID
497 MTSPR_CPU6(SPRN_MD_TWC, r10, r11)
498 mfspr r10, SPRN_MD_EPN
499 rlwinm r10, r10, 0, 0x0f800000 /* 8xx supports max 256Mb RAM */
500 ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY | \
501 _PAGE_PRESENT
502 MTSPR_CPU6(SPRN_MD_RPN, r10, r11) /* Update TLB entry */
503
504 li r11, RPN_PATTERN
505 mtspr SPRN_DAR, r11 /* Tag DAR */
506 EXCEPTION_EPILOG_0
507 rfi
508
509 468
510/* This is an instruction TLB error on the MPC8xx. This could be due 469/* This is an instruction TLB error on the MPC8xx. This could be due
511 * to many reasons, such as executing guarded memory or illegal instruction 470 * to many reasons, such as executing guarded memory or illegal instruction
@@ -567,6 +526,47 @@ DARFixed:/* Return from dcbx instruction bug workaround */
567 526
568 . = 0x2000 527 . = 0x2000
569 528
529/*
530 * Bottom part of DataStoreTLBMiss handlers for IMMR area and linear RAM.
531 * not enough space in the DataStoreTLBMiss area.
532 */
533DTLBMissIMMR:
534 mtcr r10
535 /* Set 512k byte guarded page and mark it valid */
536 li r10, MD_PS512K | MD_GUARDED | MD_SVALID
537 MTSPR_CPU6(SPRN_MD_TWC, r10, r11)
538 mfspr r10, SPRN_IMMR /* Get current IMMR */
539 rlwinm r10, r10, 0, 0xfff80000 /* Get 512 kbytes boundary */
540 ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY | \
541 _PAGE_PRESENT | _PAGE_NO_CACHE
542 MTSPR_CPU6(SPRN_MD_RPN, r10, r11) /* Update TLB entry */
543
544 li r11, RPN_PATTERN
545 mtspr SPRN_DAR, r11 /* Tag DAR */
546 EXCEPTION_EPILOG_0
547 rfi
548
549DTLBMissLinear:
550_ENTRY(DTLBMiss_cmp)
551 cmpli cr0, r11, (PAGE_OFFSET + 0x1800000)@h
552 lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha
553 bge- 3b
554
555 mtcr r10
556 /* Set 8M byte page and mark it valid */
557 li r10, MD_PS8MEG | MD_SVALID
558 MTSPR_CPU6(SPRN_MD_TWC, r10, r11)
559 mfspr r10, SPRN_MD_EPN
560 rlwinm r10, r10, 0, 0x0f800000 /* 8xx supports max 256Mb RAM */
561 ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_SHARED | _PAGE_DIRTY | \
562 _PAGE_PRESENT
563 MTSPR_CPU6(SPRN_MD_RPN, r10, r11) /* Update TLB entry */
564
565 li r11, RPN_PATTERN
566 mtspr SPRN_DAR, r11 /* Tag DAR */
567 EXCEPTION_EPILOG_0
568 rfi
569
570/* This is the procedure to calculate the data EA for buggy dcbx,dcbi instructions 570/* This is the procedure to calculate the data EA for buggy dcbx,dcbi instructions
571 * by decoding the registers used by the dcbx instruction and adding them. 571 * by decoding the registers used by the dcbx instruction and adding them.
572 * DAR is set to the calculated address. 572 * DAR is set to the calculated address.