diff options
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 207 |
1 files changed, 117 insertions, 90 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 645c7f10fb28..71b1fe58e9e4 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -35,9 +35,7 @@ | |||
35 | #include <asm/thread_info.h> | 35 | #include <asm/thread_info.h> |
36 | #include <asm/firmware.h> | 36 | #include <asm/firmware.h> |
37 | 37 | ||
38 | #ifdef CONFIG_PPC_ISERIES | ||
39 | #define DO_SOFT_DISABLE | 38 | #define DO_SOFT_DISABLE |
40 | #endif | ||
41 | 39 | ||
42 | /* | 40 | /* |
43 | * We layout physical memory as follows: | 41 | * We layout physical memory as follows: |
@@ -74,13 +72,11 @@ | |||
74 | .text | 72 | .text |
75 | .globl _stext | 73 | .globl _stext |
76 | _stext: | 74 | _stext: |
77 | #ifdef CONFIG_PPC_MULTIPLATFORM | ||
78 | _GLOBAL(__start) | 75 | _GLOBAL(__start) |
79 | /* NOP this out unconditionally */ | 76 | /* NOP this out unconditionally */ |
80 | BEGIN_FTR_SECTION | 77 | BEGIN_FTR_SECTION |
81 | b .__start_initialization_multiplatform | 78 | b .__start_initialization_multiplatform |
82 | END_FTR_SECTION(0, 1) | 79 | END_FTR_SECTION(0, 1) |
83 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | ||
84 | 80 | ||
85 | /* Catch branch to 0 in real mode */ | 81 | /* Catch branch to 0 in real mode */ |
86 | trap | 82 | trap |
@@ -308,7 +304,9 @@ exception_marker: | |||
308 | std r9,_LINK(r1); \ | 304 | std r9,_LINK(r1); \ |
309 | mfctr r10; /* save CTR in stackframe */ \ | 305 | mfctr r10; /* save CTR in stackframe */ \ |
310 | std r10,_CTR(r1); \ | 306 | std r10,_CTR(r1); \ |
307 | lbz r10,PACASOFTIRQEN(r13); \ | ||
311 | mfspr r11,SPRN_XER; /* save XER in stackframe */ \ | 308 | mfspr r11,SPRN_XER; /* save XER in stackframe */ \ |
309 | std r10,SOFTE(r1); \ | ||
312 | std r11,_XER(r1); \ | 310 | std r11,_XER(r1); \ |
313 | li r9,(n)+1; \ | 311 | li r9,(n)+1; \ |
314 | std r9,_TRAP(r1); /* set trap number */ \ | 312 | std r9,_TRAP(r1); /* set trap number */ \ |
@@ -343,6 +341,34 @@ label##_pSeries: \ | |||
343 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) | 341 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) |
344 | 342 | ||
345 | 343 | ||
344 | #define MASKABLE_EXCEPTION_PSERIES(n, label) \ | ||
345 | . = n; \ | ||
346 | .globl label##_pSeries; \ | ||
347 | label##_pSeries: \ | ||
348 | HMT_MEDIUM; \ | ||
349 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ | ||
350 | mfspr r13,SPRN_SPRG3; /* get paca address into r13 */ \ | ||
351 | std r9,PACA_EXGEN+EX_R9(r13); /* save r9, r10 */ \ | ||
352 | std r10,PACA_EXGEN+EX_R10(r13); \ | ||
353 | lbz r10,PACASOFTIRQEN(r13); \ | ||
354 | mfcr r9; \ | ||
355 | cmpwi r10,0; \ | ||
356 | beq masked_interrupt; \ | ||
357 | mfspr r10,SPRN_SPRG1; \ | ||
358 | std r10,PACA_EXGEN+EX_R13(r13); \ | ||
359 | std r11,PACA_EXGEN+EX_R11(r13); \ | ||
360 | std r12,PACA_EXGEN+EX_R12(r13); \ | ||
361 | clrrdi r12,r13,32; /* get high part of &label */ \ | ||
362 | mfmsr r10; \ | ||
363 | mfspr r11,SPRN_SRR0; /* save SRR0 */ \ | ||
364 | LOAD_HANDLER(r12,label##_common) \ | ||
365 | ori r10,r10,MSR_IR|MSR_DR|MSR_RI; \ | ||
366 | mtspr SPRN_SRR0,r12; \ | ||
367 | mfspr r12,SPRN_SRR1; /* and SRR1 */ \ | ||
368 | mtspr SPRN_SRR1,r10; \ | ||
369 | rfid; \ | ||
370 | b . /* prevent speculative execution */ | ||
371 | |||
346 | #define STD_EXCEPTION_ISERIES(n, label, area) \ | 372 | #define STD_EXCEPTION_ISERIES(n, label, area) \ |
347 | .globl label##_iSeries; \ | 373 | .globl label##_iSeries; \ |
348 | label##_iSeries: \ | 374 | label##_iSeries: \ |
@@ -358,40 +384,32 @@ label##_iSeries: \ | |||
358 | HMT_MEDIUM; \ | 384 | HMT_MEDIUM; \ |
359 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ | 385 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ |
360 | EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \ | 386 | EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \ |
361 | lbz r10,PACAPROCENABLED(r13); \ | 387 | lbz r10,PACASOFTIRQEN(r13); \ |
362 | cmpwi 0,r10,0; \ | 388 | cmpwi 0,r10,0; \ |
363 | beq- label##_iSeries_masked; \ | 389 | beq- label##_iSeries_masked; \ |
364 | EXCEPTION_PROLOG_ISERIES_2; \ | 390 | EXCEPTION_PROLOG_ISERIES_2; \ |
365 | b label##_common; \ | 391 | b label##_common; \ |
366 | 392 | ||
367 | #ifdef DO_SOFT_DISABLE | 393 | #ifdef CONFIG_PPC_ISERIES |
368 | #define DISABLE_INTS \ | 394 | #define DISABLE_INTS \ |
369 | BEGIN_FW_FTR_SECTION; \ | ||
370 | lbz r10,PACAPROCENABLED(r13); \ | ||
371 | li r11,0; \ | 395 | li r11,0; \ |
372 | std r10,SOFTE(r1); \ | 396 | stb r11,PACASOFTIRQEN(r13); \ |
397 | BEGIN_FW_FTR_SECTION; \ | ||
398 | stb r11,PACAHARDIRQEN(r13); \ | ||
399 | END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \ | ||
400 | BEGIN_FW_FTR_SECTION; \ | ||
373 | mfmsr r10; \ | 401 | mfmsr r10; \ |
374 | stb r11,PACAPROCENABLED(r13); \ | ||
375 | ori r10,r10,MSR_EE; \ | 402 | ori r10,r10,MSR_EE; \ |
376 | mtmsrd r10,1; \ | 403 | mtmsrd r10,1; \ |
377 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | 404 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) |
378 | 405 | ||
379 | #define ENABLE_INTS \ | 406 | #else |
380 | BEGIN_FW_FTR_SECTION; \ | 407 | #define DISABLE_INTS \ |
381 | lbz r10,PACAPROCENABLED(r13); \ | 408 | li r11,0; \ |
382 | mfmsr r11; \ | 409 | stb r11,PACASOFTIRQEN(r13); \ |
383 | std r10,SOFTE(r1); \ | 410 | stb r11,PACAHARDIRQEN(r13) |
384 | ori r11,r11,MSR_EE; \ | ||
385 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES); \ | ||
386 | BEGIN_FW_FTR_SECTION; \ | ||
387 | ld r12,_MSR(r1); \ | ||
388 | mfmsr r11; \ | ||
389 | rlwimi r11,r12,0,MSR_EE; \ | ||
390 | END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \ | ||
391 | mtmsrd r11,1 | ||
392 | 411 | ||
393 | #else /* hard enable/disable interrupts */ | 412 | #endif /* CONFIG_PPC_ISERIES */ |
394 | #define DISABLE_INTS | ||
395 | 413 | ||
396 | #define ENABLE_INTS \ | 414 | #define ENABLE_INTS \ |
397 | ld r12,_MSR(r1); \ | 415 | ld r12,_MSR(r1); \ |
@@ -399,8 +417,6 @@ END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \ | |||
399 | rlwimi r11,r12,0,MSR_EE; \ | 417 | rlwimi r11,r12,0,MSR_EE; \ |
400 | mtmsrd r11,1 | 418 | mtmsrd r11,1 |
401 | 419 | ||
402 | #endif | ||
403 | |||
404 | #define STD_EXCEPTION_COMMON(trap, label, hdlr) \ | 420 | #define STD_EXCEPTION_COMMON(trap, label, hdlr) \ |
405 | .align 7; \ | 421 | .align 7; \ |
406 | .globl label##_common; \ | 422 | .globl label##_common; \ |
@@ -487,7 +503,7 @@ BEGIN_FTR_SECTION | |||
487 | rlwimi r13,r12,16,0x20 | 503 | rlwimi r13,r12,16,0x20 |
488 | mfcr r12 | 504 | mfcr r12 |
489 | cmpwi r13,0x2c | 505 | cmpwi r13,0x2c |
490 | beq .do_stab_bolted_pSeries | 506 | beq do_stab_bolted_pSeries |
491 | mtcrf 0x80,r12 | 507 | mtcrf 0x80,r12 |
492 | mfspr r12,SPRN_SPRG2 | 508 | mfspr r12,SPRN_SPRG2 |
493 | END_FTR_SECTION_IFCLR(CPU_FTR_SLB) | 509 | END_FTR_SECTION_IFCLR(CPU_FTR_SLB) |
@@ -541,11 +557,11 @@ instruction_access_slb_pSeries: | |||
541 | mfspr r12,SPRN_SRR1 /* and SRR1 */ | 557 | mfspr r12,SPRN_SRR1 /* and SRR1 */ |
542 | b .slb_miss_realmode /* Rel. branch works in real mode */ | 558 | b .slb_miss_realmode /* Rel. branch works in real mode */ |
543 | 559 | ||
544 | STD_EXCEPTION_PSERIES(0x500, hardware_interrupt) | 560 | MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt) |
545 | STD_EXCEPTION_PSERIES(0x600, alignment) | 561 | STD_EXCEPTION_PSERIES(0x600, alignment) |
546 | STD_EXCEPTION_PSERIES(0x700, program_check) | 562 | STD_EXCEPTION_PSERIES(0x700, program_check) |
547 | STD_EXCEPTION_PSERIES(0x800, fp_unavailable) | 563 | STD_EXCEPTION_PSERIES(0x800, fp_unavailable) |
548 | STD_EXCEPTION_PSERIES(0x900, decrementer) | 564 | MASKABLE_EXCEPTION_PSERIES(0x900, decrementer) |
549 | STD_EXCEPTION_PSERIES(0xa00, trap_0a) | 565 | STD_EXCEPTION_PSERIES(0xa00, trap_0a) |
550 | STD_EXCEPTION_PSERIES(0xb00, trap_0b) | 566 | STD_EXCEPTION_PSERIES(0xb00, trap_0b) |
551 | 567 | ||
@@ -597,10 +613,27 @@ system_call_pSeries: | |||
597 | /*** pSeries interrupt support ***/ | 613 | /*** pSeries interrupt support ***/ |
598 | 614 | ||
599 | /* moved from 0xf00 */ | 615 | /* moved from 0xf00 */ |
600 | STD_EXCEPTION_PSERIES(., performance_monitor) | 616 | MASKABLE_EXCEPTION_PSERIES(., performance_monitor) |
617 | |||
618 | /* | ||
619 | * An interrupt came in while soft-disabled; clear EE in SRR1, | ||
620 | * clear paca->hard_enabled and return. | ||
621 | */ | ||
622 | masked_interrupt: | ||
623 | stb r10,PACAHARDIRQEN(r13) | ||
624 | mtcrf 0x80,r9 | ||
625 | ld r9,PACA_EXGEN+EX_R9(r13) | ||
626 | mfspr r10,SPRN_SRR1 | ||
627 | rldicl r10,r10,48,1 /* clear MSR_EE */ | ||
628 | rotldi r10,r10,16 | ||
629 | mtspr SPRN_SRR1,r10 | ||
630 | ld r10,PACA_EXGEN+EX_R10(r13) | ||
631 | mfspr r13,SPRN_SPRG1 | ||
632 | rfid | ||
633 | b . | ||
601 | 634 | ||
602 | .align 7 | 635 | .align 7 |
603 | _GLOBAL(do_stab_bolted_pSeries) | 636 | do_stab_bolted_pSeries: |
604 | mtcrf 0x80,r12 | 637 | mtcrf 0x80,r12 |
605 | mfspr r12,SPRN_SPRG2 | 638 | mfspr r12,SPRN_SPRG2 |
606 | EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) | 639 | EXCEPTION_PROLOG_PSERIES(PACA_EXSLB, .do_stab_bolted) |
@@ -792,7 +825,7 @@ system_reset_iSeries: | |||
792 | 825 | ||
793 | cmpwi 0,r23,0 | 826 | cmpwi 0,r23,0 |
794 | beq iSeries_secondary_smp_loop /* Loop until told to go */ | 827 | beq iSeries_secondary_smp_loop /* Loop until told to go */ |
795 | bne .__secondary_start /* Loop until told to go */ | 828 | bne __secondary_start /* Loop until told to go */ |
796 | iSeries_secondary_smp_loop: | 829 | iSeries_secondary_smp_loop: |
797 | /* Let the Hypervisor know we are alive */ | 830 | /* Let the Hypervisor know we are alive */ |
798 | /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */ | 831 | /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */ |
@@ -813,7 +846,6 @@ iSeries_secondary_smp_loop: | |||
813 | b 1b /* If SMP not configured, secondaries | 846 | b 1b /* If SMP not configured, secondaries |
814 | * loop forever */ | 847 | * loop forever */ |
815 | 848 | ||
816 | .globl decrementer_iSeries_masked | ||
817 | decrementer_iSeries_masked: | 849 | decrementer_iSeries_masked: |
818 | /* We may not have a valid TOC pointer in here. */ | 850 | /* We may not have a valid TOC pointer in here. */ |
819 | li r11,1 | 851 | li r11,1 |
@@ -824,7 +856,6 @@ decrementer_iSeries_masked: | |||
824 | mtspr SPRN_DEC,r12 | 856 | mtspr SPRN_DEC,r12 |
825 | /* fall through */ | 857 | /* fall through */ |
826 | 858 | ||
827 | .globl hardware_interrupt_iSeries_masked | ||
828 | hardware_interrupt_iSeries_masked: | 859 | hardware_interrupt_iSeries_masked: |
829 | mtcrf 0x80,r9 /* Restore regs */ | 860 | mtcrf 0x80,r9 /* Restore regs */ |
830 | ld r12,PACALPPACAPTR(r13) | 861 | ld r12,PACALPPACAPTR(r13) |
@@ -926,10 +957,18 @@ bad_stack: | |||
926 | * any task or sent any task a signal, you should use | 957 | * any task or sent any task a signal, you should use |
927 | * ret_from_except or ret_from_except_lite instead of this. | 958 | * ret_from_except or ret_from_except_lite instead of this. |
928 | */ | 959 | */ |
960 | fast_exc_return_irq: /* restores irq state too */ | ||
961 | ld r3,SOFTE(r1) | ||
962 | ld r12,_MSR(r1) | ||
963 | stb r3,PACASOFTIRQEN(r13) /* restore paca->soft_enabled */ | ||
964 | rldicl r4,r12,49,63 /* get MSR_EE to LSB */ | ||
965 | stb r4,PACAHARDIRQEN(r13) /* restore paca->hard_enabled */ | ||
966 | b 1f | ||
967 | |||
929 | .globl fast_exception_return | 968 | .globl fast_exception_return |
930 | fast_exception_return: | 969 | fast_exception_return: |
931 | ld r12,_MSR(r1) | 970 | ld r12,_MSR(r1) |
932 | ld r11,_NIP(r1) | 971 | 1: ld r11,_NIP(r1) |
933 | andi. r3,r12,MSR_RI /* check if RI is set */ | 972 | andi. r3,r12,MSR_RI /* check if RI is set */ |
934 | beq- unrecov_fer | 973 | beq- unrecov_fer |
935 | 974 | ||
@@ -952,7 +991,8 @@ fast_exception_return: | |||
952 | REST_8GPRS(2, r1) | 991 | REST_8GPRS(2, r1) |
953 | 992 | ||
954 | mfmsr r10 | 993 | mfmsr r10 |
955 | clrrdi r10,r10,2 /* clear RI (LE is 0 already) */ | 994 | rldicl r10,r10,48,1 /* clear EE */ |
995 | rldicr r10,r10,16,61 /* clear RI (LE is 0 already) */ | ||
956 | mtmsrd r10,1 | 996 | mtmsrd r10,1 |
957 | 997 | ||
958 | mtspr SPRN_SRR1,r12 | 998 | mtspr SPRN_SRR1,r12 |
@@ -1046,7 +1086,7 @@ slb_miss_fault: | |||
1046 | li r5,0 | 1086 | li r5,0 |
1047 | std r4,_DAR(r1) | 1087 | std r4,_DAR(r1) |
1048 | std r5,_DSISR(r1) | 1088 | std r5,_DSISR(r1) |
1049 | b .handle_page_fault | 1089 | b handle_page_fault |
1050 | 1090 | ||
1051 | unrecov_user_slb: | 1091 | unrecov_user_slb: |
1052 | EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN) | 1092 | EXCEPTION_PROLOG_COMMON(0x4200, PACA_EXGEN) |
@@ -1174,12 +1214,13 @@ program_check_common: | |||
1174 | .globl fp_unavailable_common | 1214 | .globl fp_unavailable_common |
1175 | fp_unavailable_common: | 1215 | fp_unavailable_common: |
1176 | EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN) | 1216 | EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN) |
1177 | bne .load_up_fpu /* if from user, just load it up */ | 1217 | bne 1f /* if from user, just load it up */ |
1178 | bl .save_nvgprs | 1218 | bl .save_nvgprs |
1179 | addi r3,r1,STACK_FRAME_OVERHEAD | 1219 | addi r3,r1,STACK_FRAME_OVERHEAD |
1180 | ENABLE_INTS | 1220 | ENABLE_INTS |
1181 | bl .kernel_fp_unavailable_exception | 1221 | bl .kernel_fp_unavailable_exception |
1182 | BUG_OPCODE | 1222 | BUG_OPCODE |
1223 | 1: b .load_up_fpu | ||
1183 | 1224 | ||
1184 | .align 7 | 1225 | .align 7 |
1185 | .globl altivec_unavailable_common | 1226 | .globl altivec_unavailable_common |
@@ -1279,10 +1320,10 @@ _GLOBAL(do_hash_page) | |||
1279 | std r4,_DSISR(r1) | 1320 | std r4,_DSISR(r1) |
1280 | 1321 | ||
1281 | andis. r0,r4,0xa450 /* weird error? */ | 1322 | andis. r0,r4,0xa450 /* weird error? */ |
1282 | bne- .handle_page_fault /* if not, try to insert a HPTE */ | 1323 | bne- handle_page_fault /* if not, try to insert a HPTE */ |
1283 | BEGIN_FTR_SECTION | 1324 | BEGIN_FTR_SECTION |
1284 | andis. r0,r4,0x0020 /* Is it a segment table fault? */ | 1325 | andis. r0,r4,0x0020 /* Is it a segment table fault? */ |
1285 | bne- .do_ste_alloc /* If so handle it */ | 1326 | bne- do_ste_alloc /* If so handle it */ |
1286 | END_FTR_SECTION_IFCLR(CPU_FTR_SLB) | 1327 | END_FTR_SECTION_IFCLR(CPU_FTR_SLB) |
1287 | 1328 | ||
1288 | /* | 1329 | /* |
@@ -1324,7 +1365,17 @@ BEGIN_FW_FTR_SECTION | |||
1324 | * because ret_from_except_lite will check for and handle pending | 1365 | * because ret_from_except_lite will check for and handle pending |
1325 | * interrupts if necessary. | 1366 | * interrupts if necessary. |
1326 | */ | 1367 | */ |
1327 | beq .ret_from_except_lite | 1368 | beq 13f |
1369 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | ||
1370 | #endif | ||
1371 | BEGIN_FW_FTR_SECTION | ||
1372 | /* | ||
1373 | * Here we have interrupts hard-disabled, so it is sufficient | ||
1374 | * to restore paca->{soft,hard}_enable and get out. | ||
1375 | */ | ||
1376 | beq fast_exc_return_irq /* Return from exception on success */ | ||
1377 | END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES) | ||
1378 | |||
1328 | /* For a hash failure, we don't bother re-enabling interrupts */ | 1379 | /* For a hash failure, we don't bother re-enabling interrupts */ |
1329 | ble- 12f | 1380 | ble- 12f |
1330 | 1381 | ||
@@ -1336,24 +1387,16 @@ BEGIN_FW_FTR_SECTION | |||
1336 | ld r3,SOFTE(r1) | 1387 | ld r3,SOFTE(r1) |
1337 | bl .local_irq_restore | 1388 | bl .local_irq_restore |
1338 | b 11f | 1389 | b 11f |
1339 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | ||
1340 | #endif | ||
1341 | BEGIN_FW_FTR_SECTION | ||
1342 | beq fast_exception_return /* Return from exception on success */ | ||
1343 | ble- 12f /* Failure return from hash_page */ | ||
1344 | |||
1345 | /* fall through */ | ||
1346 | END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES) | ||
1347 | 1390 | ||
1348 | /* Here we have a page fault that hash_page can't handle. */ | 1391 | /* Here we have a page fault that hash_page can't handle. */ |
1349 | _GLOBAL(handle_page_fault) | 1392 | handle_page_fault: |
1350 | ENABLE_INTS | 1393 | ENABLE_INTS |
1351 | 11: ld r4,_DAR(r1) | 1394 | 11: ld r4,_DAR(r1) |
1352 | ld r5,_DSISR(r1) | 1395 | ld r5,_DSISR(r1) |
1353 | addi r3,r1,STACK_FRAME_OVERHEAD | 1396 | addi r3,r1,STACK_FRAME_OVERHEAD |
1354 | bl .do_page_fault | 1397 | bl .do_page_fault |
1355 | cmpdi r3,0 | 1398 | cmpdi r3,0 |
1356 | beq+ .ret_from_except_lite | 1399 | beq+ 13f |
1357 | bl .save_nvgprs | 1400 | bl .save_nvgprs |
1358 | mr r5,r3 | 1401 | mr r5,r3 |
1359 | addi r3,r1,STACK_FRAME_OVERHEAD | 1402 | addi r3,r1,STACK_FRAME_OVERHEAD |
@@ -1361,6 +1404,8 @@ _GLOBAL(handle_page_fault) | |||
1361 | bl .bad_page_fault | 1404 | bl .bad_page_fault |
1362 | b .ret_from_except | 1405 | b .ret_from_except |
1363 | 1406 | ||
1407 | 13: b .ret_from_except_lite | ||
1408 | |||
1364 | /* We have a page fault that hash_page could handle but HV refused | 1409 | /* We have a page fault that hash_page could handle but HV refused |
1365 | * the PTE insertion | 1410 | * the PTE insertion |
1366 | */ | 1411 | */ |
@@ -1371,11 +1416,11 @@ _GLOBAL(handle_page_fault) | |||
1371 | b .ret_from_except | 1416 | b .ret_from_except |
1372 | 1417 | ||
1373 | /* here we have a segment miss */ | 1418 | /* here we have a segment miss */ |
1374 | _GLOBAL(do_ste_alloc) | 1419 | do_ste_alloc: |
1375 | bl .ste_allocate /* try to insert stab entry */ | 1420 | bl .ste_allocate /* try to insert stab entry */ |
1376 | cmpdi r3,0 | 1421 | cmpdi r3,0 |
1377 | beq+ fast_exception_return | 1422 | bne- handle_page_fault |
1378 | b .handle_page_fault | 1423 | b fast_exception_return |
1379 | 1424 | ||
1380 | /* | 1425 | /* |
1381 | * r13 points to the PACA, r9 contains the saved CR, | 1426 | * r13 points to the PACA, r9 contains the saved CR, |
@@ -1557,7 +1602,7 @@ _GLOBAL(generic_secondary_smp_init) | |||
1557 | ld r1,PACAEMERGSP(r13) | 1602 | ld r1,PACAEMERGSP(r13) |
1558 | subi r1,r1,STACK_FRAME_OVERHEAD | 1603 | subi r1,r1,STACK_FRAME_OVERHEAD |
1559 | 1604 | ||
1560 | b .__secondary_start | 1605 | b __secondary_start |
1561 | #endif | 1606 | #endif |
1562 | 1607 | ||
1563 | #ifdef CONFIG_PPC_ISERIES | 1608 | #ifdef CONFIG_PPC_ISERIES |
@@ -1580,11 +1625,6 @@ _STATIC(__start_initialization_iSeries) | |||
1580 | li r0,0 | 1625 | li r0,0 |
1581 | stdu r0,-STACK_FRAME_OVERHEAD(r1) | 1626 | stdu r0,-STACK_FRAME_OVERHEAD(r1) |
1582 | 1627 | ||
1583 | LOAD_REG_IMMEDIATE(r3,cpu_specs) | ||
1584 | LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) | ||
1585 | li r5,0 | ||
1586 | bl .identify_cpu | ||
1587 | |||
1588 | LOAD_REG_IMMEDIATE(r2,__toc_start) | 1628 | LOAD_REG_IMMEDIATE(r2,__toc_start) |
1589 | addi r2,r2,0x4000 | 1629 | addi r2,r2,0x4000 |
1590 | addi r2,r2,0x4000 | 1630 | addi r2,r2,0x4000 |
@@ -1597,7 +1637,6 @@ _STATIC(__start_initialization_iSeries) | |||
1597 | b .start_here_common | 1637 | b .start_here_common |
1598 | #endif /* CONFIG_PPC_ISERIES */ | 1638 | #endif /* CONFIG_PPC_ISERIES */ |
1599 | 1639 | ||
1600 | #ifdef CONFIG_PPC_MULTIPLATFORM | ||
1601 | 1640 | ||
1602 | _STATIC(__mmu_off) | 1641 | _STATIC(__mmu_off) |
1603 | mfmsr r3 | 1642 | mfmsr r3 |
@@ -1623,13 +1662,11 @@ _STATIC(__mmu_off) | |||
1623 | * | 1662 | * |
1624 | */ | 1663 | */ |
1625 | _GLOBAL(__start_initialization_multiplatform) | 1664 | _GLOBAL(__start_initialization_multiplatform) |
1626 | #ifdef CONFIG_PPC_MULTIPLATFORM | ||
1627 | /* | 1665 | /* |
1628 | * Are we booted from a PROM Of-type client-interface ? | 1666 | * Are we booted from a PROM Of-type client-interface ? |
1629 | */ | 1667 | */ |
1630 | cmpldi cr0,r5,0 | 1668 | cmpldi cr0,r5,0 |
1631 | bne .__boot_from_prom /* yes -> prom */ | 1669 | bne .__boot_from_prom /* yes -> prom */ |
1632 | #endif | ||
1633 | 1670 | ||
1634 | /* Save parameters */ | 1671 | /* Save parameters */ |
1635 | mr r31,r3 | 1672 | mr r31,r3 |
@@ -1646,6 +1683,8 @@ _GLOBAL(__start_initialization_multiplatform) | |||
1646 | cmpwi r0,0x3c /* 970FX */ | 1683 | cmpwi r0,0x3c /* 970FX */ |
1647 | beq 1f | 1684 | beq 1f |
1648 | cmpwi r0,0x44 /* 970MP */ | 1685 | cmpwi r0,0x44 /* 970MP */ |
1686 | beq 1f | ||
1687 | cmpwi r0,0x45 /* 970GX */ | ||
1649 | bne 2f | 1688 | bne 2f |
1650 | 1: bl .__cpu_preinit_ppc970 | 1689 | 1: bl .__cpu_preinit_ppc970 |
1651 | 2: | 1690 | 2: |
@@ -1656,7 +1695,6 @@ _GLOBAL(__start_initialization_multiplatform) | |||
1656 | bl .__mmu_off | 1695 | bl .__mmu_off |
1657 | b .__after_prom_start | 1696 | b .__after_prom_start |
1658 | 1697 | ||
1659 | #ifdef CONFIG_PPC_MULTIPLATFORM | ||
1660 | _STATIC(__boot_from_prom) | 1698 | _STATIC(__boot_from_prom) |
1661 | /* Save parameters */ | 1699 | /* Save parameters */ |
1662 | mr r31,r3 | 1700 | mr r31,r3 |
@@ -1696,7 +1734,6 @@ _STATIC(__boot_from_prom) | |||
1696 | bl .prom_init | 1734 | bl .prom_init |
1697 | /* We never return */ | 1735 | /* We never return */ |
1698 | trap | 1736 | trap |
1699 | #endif | ||
1700 | 1737 | ||
1701 | /* | 1738 | /* |
1702 | * At this point, r3 contains the physical address we are running at, | 1739 | * At this point, r3 contains the physical address we are running at, |
@@ -1752,8 +1789,6 @@ _STATIC(__after_prom_start) | |||
1752 | bl .copy_and_flush /* copy the rest */ | 1789 | bl .copy_and_flush /* copy the rest */ |
1753 | b .start_here_multiplatform | 1790 | b .start_here_multiplatform |
1754 | 1791 | ||
1755 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | ||
1756 | |||
1757 | /* | 1792 | /* |
1758 | * Copy routine used to copy the kernel to start at physical address 0 | 1793 | * Copy routine used to copy the kernel to start at physical address 0 |
1759 | * and flush and invalidate the caches as needed. | 1794 | * and flush and invalidate the caches as needed. |
@@ -1836,7 +1871,7 @@ _GLOBAL(pmac_secondary_start) | |||
1836 | ld r1,PACAEMERGSP(r13) | 1871 | ld r1,PACAEMERGSP(r13) |
1837 | subi r1,r1,STACK_FRAME_OVERHEAD | 1872 | subi r1,r1,STACK_FRAME_OVERHEAD |
1838 | 1873 | ||
1839 | b .__secondary_start | 1874 | b __secondary_start |
1840 | 1875 | ||
1841 | #endif /* CONFIG_PPC_PMAC */ | 1876 | #endif /* CONFIG_PPC_PMAC */ |
1842 | 1877 | ||
@@ -1853,7 +1888,7 @@ _GLOBAL(pmac_secondary_start) | |||
1853 | * r13 = paca virtual address | 1888 | * r13 = paca virtual address |
1854 | * SPRG3 = paca virtual address | 1889 | * SPRG3 = paca virtual address |
1855 | */ | 1890 | */ |
1856 | _GLOBAL(__secondary_start) | 1891 | __secondary_start: |
1857 | /* Set thread priority to MEDIUM */ | 1892 | /* Set thread priority to MEDIUM */ |
1858 | HMT_MEDIUM | 1893 | HMT_MEDIUM |
1859 | 1894 | ||
@@ -1877,11 +1912,16 @@ _GLOBAL(__secondary_start) | |||
1877 | /* enable MMU and jump to start_secondary */ | 1912 | /* enable MMU and jump to start_secondary */ |
1878 | LOAD_REG_ADDR(r3, .start_secondary_prolog) | 1913 | LOAD_REG_ADDR(r3, .start_secondary_prolog) |
1879 | LOAD_REG_IMMEDIATE(r4, MSR_KERNEL) | 1914 | LOAD_REG_IMMEDIATE(r4, MSR_KERNEL) |
1880 | #ifdef DO_SOFT_DISABLE | 1915 | #ifdef CONFIG_PPC_ISERIES |
1881 | BEGIN_FW_FTR_SECTION | 1916 | BEGIN_FW_FTR_SECTION |
1882 | ori r4,r4,MSR_EE | 1917 | ori r4,r4,MSR_EE |
1883 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | 1918 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) |
1884 | #endif | 1919 | #endif |
1920 | BEGIN_FW_FTR_SECTION | ||
1921 | stb r7,PACASOFTIRQEN(r13) | ||
1922 | stb r7,PACAHARDIRQEN(r13) | ||
1923 | END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES) | ||
1924 | |||
1885 | mtspr SPRN_SRR0,r3 | 1925 | mtspr SPRN_SRR0,r3 |
1886 | mtspr SPRN_SRR1,r4 | 1926 | mtspr SPRN_SRR1,r4 |
1887 | rfid | 1927 | rfid |
@@ -1913,7 +1953,6 @@ _GLOBAL(enable_64b_mode) | |||
1913 | isync | 1953 | isync |
1914 | blr | 1954 | blr |
1915 | 1955 | ||
1916 | #ifdef CONFIG_PPC_MULTIPLATFORM | ||
1917 | /* | 1956 | /* |
1918 | * This is where the main kernel code starts. | 1957 | * This is where the main kernel code starts. |
1919 | */ | 1958 | */ |
@@ -1964,13 +2003,6 @@ _STATIC(start_here_multiplatform) | |||
1964 | addi r2,r2,0x4000 | 2003 | addi r2,r2,0x4000 |
1965 | add r2,r2,r26 | 2004 | add r2,r2,r26 |
1966 | 2005 | ||
1967 | LOAD_REG_IMMEDIATE(r3, cpu_specs) | ||
1968 | add r3,r3,r26 | ||
1969 | LOAD_REG_IMMEDIATE(r4,cur_cpu_spec) | ||
1970 | add r4,r4,r26 | ||
1971 | mr r5,r26 | ||
1972 | bl .identify_cpu | ||
1973 | |||
1974 | /* Do very early kernel initializations, including initial hash table, | 2006 | /* Do very early kernel initializations, including initial hash table, |
1975 | * stab and slb setup before we turn on relocation. */ | 2007 | * stab and slb setup before we turn on relocation. */ |
1976 | 2008 | ||
@@ -1984,7 +2016,6 @@ _STATIC(start_here_multiplatform) | |||
1984 | mtspr SPRN_SRR1,r4 | 2016 | mtspr SPRN_SRR1,r4 |
1985 | rfid | 2017 | rfid |
1986 | b . /* prevent speculative execution */ | 2018 | b . /* prevent speculative execution */ |
1987 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | ||
1988 | 2019 | ||
1989 | /* This is where all platforms converge execution */ | 2020 | /* This is where all platforms converge execution */ |
1990 | _STATIC(start_here_common) | 2021 | _STATIC(start_here_common) |
@@ -2000,13 +2031,6 @@ _STATIC(start_here_common) | |||
2000 | li r0,0 | 2031 | li r0,0 |
2001 | stdu r0,-STACK_FRAME_OVERHEAD(r1) | 2032 | stdu r0,-STACK_FRAME_OVERHEAD(r1) |
2002 | 2033 | ||
2003 | /* Apply the CPUs-specific fixups (nop out sections not relevant | ||
2004 | * to this CPU | ||
2005 | */ | ||
2006 | li r3,0 | ||
2007 | bl .do_cpu_ftr_fixups | ||
2008 | bl .do_fw_ftr_fixups | ||
2009 | |||
2010 | /* ptr to current */ | 2034 | /* ptr to current */ |
2011 | LOAD_REG_IMMEDIATE(r4, init_task) | 2035 | LOAD_REG_IMMEDIATE(r4, init_task) |
2012 | std r4,PACACURRENT(r13) | 2036 | std r4,PACACURRENT(r13) |
@@ -2019,15 +2043,18 @@ _STATIC(start_here_common) | |||
2019 | 2043 | ||
2020 | /* Load up the kernel context */ | 2044 | /* Load up the kernel context */ |
2021 | 5: | 2045 | 5: |
2022 | #ifdef DO_SOFT_DISABLE | ||
2023 | BEGIN_FW_FTR_SECTION | ||
2024 | li r5,0 | 2046 | li r5,0 |
2025 | stb r5,PACAPROCENABLED(r13) /* Soft Disabled */ | 2047 | stb r5,PACASOFTIRQEN(r13) /* Soft Disabled */ |
2048 | #ifdef CONFIG_PPC_ISERIES | ||
2049 | BEGIN_FW_FTR_SECTION | ||
2026 | mfmsr r5 | 2050 | mfmsr r5 |
2027 | ori r5,r5,MSR_EE /* Hard Enabled */ | 2051 | ori r5,r5,MSR_EE /* Hard Enabled */ |
2028 | mtmsrd r5 | 2052 | mtmsrd r5 |
2029 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | 2053 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) |
2030 | #endif | 2054 | #endif |
2055 | BEGIN_FW_FTR_SECTION | ||
2056 | stb r5,PACAHARDIRQEN(r13) | ||
2057 | END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES) | ||
2031 | 2058 | ||
2032 | bl .start_kernel | 2059 | bl .start_kernel |
2033 | 2060 | ||