@@ -354,14 +354,13 @@ _ENTRY(ITLBMiss_cmp)
354
354
#if defined(ITLB_MISS_KERNEL) || defined(CONFIG_HUGETLB_PAGE)
355
355
mtcr r12
356
356
#endif
357
- /* Load the MI_TWC with the attributes for this "segment." */
358
- mtspr SPRN_MI_TWC, r11 /* Set segment attributes */
359
357
360
358
#ifdef CONFIG_SWAP
361
- rlwinm r11, r10, 32 -5 , _PAGE_PRESENT
362
- and r11, r11, r10
363
- rlwimi r10, r11, 0 , _PAGE_PRESENT
359
+ rlwinm r11, r10, 31 , _PAGE_ACCESSED >> 1
364
360
#endif
361
+ /* Load the MI_TWC with the attributes for this "segment." */
362
+ mtspr SPRN_MI_TWC, r11 /* Set segment attributes */
363
+
365
364
li r11, RPN_PATTERN | 0x200
366
365
/* The Linux PTE won't go exactly into the MMU TLB.
367
366
* Software indicator bits 20 and 23 must be clear.
@@ -472,22 +471,14 @@ _ENTRY(DTLBMiss_jmp)
472
471
* above.
473
472
*/
474
473
rlwimi r11, r10, 0 , _PAGE_GUARDED
475
- mtspr SPRN_MD_TWC, r11
476
-
477
- /* Both _PAGE_ACCESSED and _PAGE_PRESENT has to be set.
478
- * We also need to know if the insn is a load/store, so:
479
- * Clear _PAGE_PRESENT and load that which will
480
- * trap into DTLB Error with store bit set accordinly.
481
- */
482
- /* PRESENT=0x1, ACCESSED=0x20
483
- * r11 = ((r10 & PRESENT) & ((r10 & ACCESSED) >> 5));
484
- * r10 = (r10 & ~PRESENT) | r11;
485
- */
486
474
#ifdef CONFIG_SWAP
487
- rlwinm r11, r10, 32 -5 , _PAGE_PRESENT
488
- and r11, r11, r10
489
- rlwimi r10, r11, 0 , _PAGE_PRESENT
475
+ /* _PAGE_ACCESSED has to be set. We use second APG bit for that, 0
476
+ * on that bit will represent a Non Access group
477
+ */
478
+ rlwinm r11, r10, 31 , _PAGE_ACCESSED >> 1
490
479
#endif
480
+ mtspr SPRN_MD_TWC, r11
481
+
491
482
/* The Linux PTE won't go exactly into the MMU TLB.
492
483
* Software indicator bits 24, 25, 26, and 27 must be
493
484
* set. All other Linux PTE bits control the behavior
@@ -647,8 +638,8 @@ InstructionBreakpoint:
647
638
*/
648
639
DTLBMissIMMR:
649
640
mtcr r12
650
- /* Set 512k byte guarded page and mark it valid */
651
- li r10, MD_PS512K | MD_GUARDED | MD_SVALID
641
+ /* Set 512k byte guarded page and mark it valid and accessed */
642
+ li r10, MD_PS512K | MD_GUARDED | MD_SVALID | M_APG2
652
643
mtspr SPRN_MD_TWC, r10
653
644
mfspr r10, SPRN_IMMR /* Get current IMMR */
654
645
rlwinm r10, r10, 0 , 0xfff80000 /* Get 512 kbytes boundary */
@@ -666,8 +657,8 @@ _ENTRY(dtlb_miss_exit_2)
666
657
667
658
DTLBMissLinear:
668
659
mtcr r12
669
- /* Set 8M byte page and mark it valid */
670
- li r11, MD_PS8MEG | MD_SVALID
660
+ /* Set 8M byte page and mark it valid and accessed */
661
+ li r11, MD_PS8MEG | MD_SVALID | M_APG2
671
662
mtspr SPRN_MD_TWC, r11
672
663
rlwinm r10, r10, 0 , 0x0f800000 /* 8xx supports max 256Mb RAM */
673
664
ori r10, r10, 0xf0 | MD_SPS16K | _PAGE_PRIVILEGED | _PAGE_DIRTY | \
@@ -685,8 +676,8 @@ _ENTRY(dtlb_miss_exit_3)
685
676
#ifndef CONFIG_PIN_TLB_TEXT
686
677
ITLBMissLinear:
687
678
mtcr r12
688
- /* Set 8M byte page and mark it valid */
689
- li r11, MI_PS8MEG | MI_SVALID
679
+ /* Set 8M byte page and mark it valid,accessed */
680
+ li r11, MI_PS8MEG | MI_SVALID | M_APG2
690
681
mtspr SPRN_MI_TWC, r11
691
682
rlwinm r10, r10, 0 , 0x0f800000 /* 8xx supports max 256Mb RAM */
692
683
ori r10, r10, 0xf0 | MI_SPS16K | _PAGE_PRIVILEGED | _PAGE_DIRTY | \
@@ -969,7 +960,7 @@ initial_mmu:
969
960
ori r8, r8, MI_EVALID /* Mark it valid */
970
961
mtspr SPRN_MI_EPN, r8
971
962
li r8, MI_PS8MEG /* Set 8M byte page */
972
- ori r8, r8, MI_SVALID /* Make it valid */
963
+ ori r8, r8, MI_SVALID | M_APG2 /* Make it valid, APG 2 */
973
964
mtspr SPRN_MI_TWC, r8
974
965
li r8, MI_BOOTINIT /* Create RPN for address 0 */
975
966
mtspr SPRN_MI_RPN, r8 /* Store TLB entry */
@@ -996,7 +987,7 @@ initial_mmu:
996
987
ori r8, r8, MD_EVALID /* Mark it valid */
997
988
mtspr SPRN_MD_EPN, r8
998
989
li r8, MD_PS512K | MD_GUARDED /* Set 512k byte page */
999
- ori r8, r8, MD_SVALID /* Make it valid */
990
+ ori r8, r8, MD_SVALID | M_APG2 /* Make it valid and accessed */
1000
991
mtspr SPRN_MD_TWC, r8
1001
992
mr r8, r9 /* Create paddr for TLB */
1002
993
ori r8, r8, MI_BOOTINIT|0x2 /* Inhibit cache -- Cort */
0 commit comments