123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- struct tsb_ldquad_phys_patch_entry {
- unsigned int addr;
- unsigned int sun4u_insn;
- unsigned int sun4v_insn;
- };
- extern struct tsb_ldquad_phys_patch_entry __tsb_ldquad_phys_patch,
- __tsb_ldquad_phys_patch_end;
- struct tsb_phys_patch_entry {
- unsigned int addr;
- unsigned int insn;
- };
- extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end;
- 661: ldda [TSB] ASI_NUCLEUS_QUAD_LDD, REG; \
- .section .tsb_ldquad_phys_patch, "ax"; \
- .word 661b; \
- ldda [TSB] ASI_QUAD_LDD_PHYS, REG; \
- ldda [TSB] ASI_QUAD_LDD_PHYS_4V, REG; \
- .previous
- 661: lduwa [TSB] ASI_N, REG; \
- .section .tsb_phys_patch, "ax"; \
- .word 661b; \
- lduwa [TSB] ASI_PHYS_USE_EC, REG; \
- .previous
- 661: ldxa [TSB] ASI_N, REG; \
- .section .tsb_phys_patch, "ax"; \
- .word 661b; \
- ldxa [TSB] ASI_PHYS_USE_EC, REG; \
- .previous
- 661: casa [TSB] ASI_N, REG1, REG2; \
- .section .tsb_phys_patch, "ax"; \
- .word 661b; \
- casa [TSB] ASI_PHYS_USE_EC, REG1, REG2; \
- .previous
- 661: casxa [TSB] ASI_N, REG1, REG2; \
- .section .tsb_phys_patch, "ax"; \
- .word 661b; \
- casxa [TSB] ASI_PHYS_USE_EC, REG1, REG2; \
- .previous
- 661: stxa VAL, [ADDR] ASI_N; \
- .section .tsb_phys_patch, "ax"; \
- .word 661b; \
- stxa VAL, [ADDR] ASI_PHYS_USE_EC; \
- .previous
- 99: TSB_LOAD_TAG_HIGH(TSB, REG1); \
- sethi %hi(TSB_TAG_LOCK_HIGH), REG2;\
- andcc REG1, REG2, %g0; \
- bne,pn %icc, 99b; \
- nop; \
- TSB_CAS_TAG_HIGH(TSB, REG1, REG2); \
- cmp REG1, REG2; \
- bne,pn %icc, 99b; \
- nop; \
- add TSB, 0x8, TSB; \
- TSB_STORE(TSB, TTE); \
- sub TSB, 0x8, TSB; \
- TSB_STORE(TSB, TAG);
-
- sethi %hi(swapper_pg_dir), REG1; \
- or REG1, %lo(swapper_pg_dir), REG1; \
- sllx VADDR, 64 - (PGDIR_SHIFT + PGDIR_BITS), REG2; \
- srlx REG2, 64 - PAGE_SHIFT, REG2; \
- andn REG2, 0x7, REG2; \
- ldx [REG1 + REG2], REG1; \
- brz,pn REG1, FAIL_LABEL; \
- sllx VADDR, 64 - (PUD_SHIFT + PUD_BITS), REG2; \
- srlx REG2, 64 - PAGE_SHIFT, REG2; \
- andn REG2, 0x7, REG2; \
- ldxa [REG1 + REG2] ASI_PHYS_USE_EC, REG1; \
- brz,pn REG1, FAIL_LABEL; \
- sethi %uhi(_PAGE_PUD_HUGE), REG2; \
- brz,pn REG1, FAIL_LABEL; \
- sllx REG2, 32, REG2; \
- andcc REG1, REG2, %g0; \
- sethi %hi(0xf8000000), REG2; \
- bne,pt %xcc, 697f; \
- sllx REG2, 1, REG2; \
- sllx VADDR, 64 - (PMD_SHIFT + PMD_BITS), REG2; \
- srlx REG2, 64 - PAGE_SHIFT, REG2; \
- andn REG2, 0x7, REG2; \
- ldxa [REG1 + REG2] ASI_PHYS_USE_EC, REG1; \
- sethi %uhi(_PAGE_PMD_HUGE), REG2; \
- brz,pn REG1, FAIL_LABEL; \
- sllx REG2, 32, REG2; \
- andcc REG1, REG2, %g0; \
- be,pn %xcc, 698f; \
- sethi %hi(0x400000), REG2; \
- 697: brgez,pn REG1, FAIL_LABEL; \
- andn REG1, REG2, REG1; \
- and VADDR, REG2, REG2; \
- ba,pt %xcc, 699f; \
- or REG1, REG2, REG1; \
- 698: sllx VADDR, 64 - PMD_SHIFT, REG2; \
- srlx REG2, 64 - PAGE_SHIFT, REG2; \
- andn REG2, 0x7, REG2; \
- ldxa [REG1 + REG2] ASI_PHYS_USE_EC, REG1; \
- brgez,pn REG1, FAIL_LABEL; \
- nop; \
- 699:
-
- brz,pn REG1, FAIL_LABEL; \
- sethi %uhi(_PAGE_PMD_HUGE), REG2; \
- sllx REG2, 32, REG2; \
- andcc REG1, REG2, %g0; \
- be,pt %xcc, 700f; \
- sethi %hi(4 * 1024 * 1024), REG2; \
- brgez,pn REG1, FAIL_LABEL; \
- andn REG1, REG2, REG1; \
- and VADDR, REG2, REG2; \
- brlz,pt REG1, PTE_LABEL; \
- or REG1, REG2, REG1; \
- 700:
- brz,pn REG1, FAIL_LABEL; \
- nop;
-
- sllx VADDR, 64 - (PGDIR_SHIFT + PGDIR_BITS), REG2; \
- srlx REG2, 64 - PAGE_SHIFT, REG2; \
- andn REG2, 0x7, REG2; \
- ldxa [PHYS_PGD + REG2] ASI_PHYS_USE_EC, REG1; \
- brz,pn REG1, FAIL_LABEL; \
- sllx VADDR, 64 - (PUD_SHIFT + PUD_BITS), REG2; \
- srlx REG2, 64 - PAGE_SHIFT, REG2; \
- andn REG2, 0x7, REG2; \
- ldxa [REG1 + REG2] ASI_PHYS_USE_EC, REG1; \
- brz,pn REG1, FAIL_LABEL; \
- sllx VADDR, 64 - (PMD_SHIFT + PMD_BITS), REG2; \
- srlx REG2, 64 - PAGE_SHIFT, REG2; \
- andn REG2, 0x7, REG2; \
- ldxa [REG1 + REG2] ASI_PHYS_USE_EC, REG1; \
- USER_PGTABLE_CHECK_PMD_HUGE(VADDR, REG1, REG2, FAIL_LABEL, 800f) \
- sllx VADDR, 64 - PMD_SHIFT, REG2; \
- srlx REG2, 64 - PAGE_SHIFT, REG2; \
- andn REG2, 0x7, REG2; \
- add REG1, REG2, REG1; \
- ldxa [REG1] ASI_PHYS_USE_EC, REG1; \
- brgez,pn REG1, FAIL_LABEL; \
- nop; \
- 800:
- sethi %hi(prom_trans), REG1; \
- or REG1, %lo(prom_trans), REG1; \
- 97: ldx [REG1 + 0x00], REG2; \
- brz,pn REG2, FAIL_LABEL; \
- nop; \
- ldx [REG1 + 0x08], REG3; \
- add REG2, REG3, REG3; \
- cmp REG2, VADDR; \
- bgu,pt %xcc, 98f; \
- cmp VADDR, REG3; \
- bgeu,pt %xcc, 98f; \
- ldx [REG1 + 0x10], REG3; \
- sub VADDR, REG2, REG2; \
- ba,pt %xcc, 99f; \
- add REG3, REG2, REG1; \
- 98: ba,pt %xcc, 97b; \
- add REG1, (3 * 8), REG1; \
- 99:
-
- (KERNEL_TSB_SIZE_BYTES / 16)
-
- 661: sethi %uhi(swapper_tsb), REG1; \
- sethi %hi(swapper_tsb), REG2; \
- or REG1, %ulo(swapper_tsb), REG1; \
- or REG2, %lo(swapper_tsb), REG2; \
- .section .swapper_tsb_phys_patch, "ax"; \
- .word 661b; \
- .previous; \
- sllx REG1, 32, REG1; \
- or REG1, REG2, REG1; \
- srlx VADDR, PAGE_SHIFT, REG2; \
- and REG2, (KERNEL_TSB_NENTRIES - 1), REG2; \
- sllx REG2, 4, REG2; \
- add REG1, REG2, REG2; \
- TSB_LOAD_QUAD(REG2, REG3); \
- cmp REG3, TAG; \
- be,a,pt %xcc, OK_LABEL; \
- mov REG4, REG1;
-
- 661: sethi %uhi(swapper_4m_tsb), REG1; \
- sethi %hi(swapper_4m_tsb), REG2; \
- or REG1, %ulo(swapper_4m_tsb), REG1; \
- or REG2, %lo(swapper_4m_tsb), REG2; \
- .section .swapper_4m_tsb_phys_patch, "ax"; \
- .word 661b; \
- .previous; \
- sllx REG1, 32, REG1; \
- or REG1, REG2, REG1; \
- and TAG, (KERNEL_TSB4M_NENTRIES - 1), REG2; \
- sllx REG2, 4, REG2; \
- add REG1, REG2, REG2; \
- TSB_LOAD_QUAD(REG2, REG3); \
- cmp REG3, TAG; \
- be,a,pt %xcc, OK_LABEL; \
- mov REG4, REG1;
|