aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2016-09-21 03:43:28 -0400
committerMichael Ellerman <mpe@ellerman.id.au>2016-10-03 22:06:55 -0400
commitbe642c3457e75983be6f1f4bddcc77c9e2ed4650 (patch)
treef5b3ae3ec58a2375aa28c19d8bd4219a2f948524
parentda2bc4644c75d992427c45c5ade3bdf18ca1b52d (diff)
powerpc/64s: Consolidate exception handler alignment
Move exception handler alignment directives into the head-64.h macros, beause they will no longer work in-place after the next patch. This slightly changes functions that have alignments applied and therefore code generation, which is why it was not done initially (see earlier patch). Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/include/asm/head-64.h1
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S36
2 files changed, 1 insertions, 36 deletions
diff --git a/arch/powerpc/include/asm/head-64.h b/arch/powerpc/include/asm/head-64.h
index 358c25c80c62..613f743e91aa 100644
--- a/arch/powerpc/include/asm/head-64.h
+++ b/arch/powerpc/include/asm/head-64.h
@@ -18,6 +18,7 @@ exc_virt_##start##_##name:
18#define EXC_VIRT_END(name, start, end) 18#define EXC_VIRT_END(name, start, end)
19 19
20#define EXC_COMMON_BEGIN(name) \ 20#define EXC_COMMON_BEGIN(name) \
21 .align 7; \
21 .global name; \ 22 .global name; \
22name: 23name:
23 24
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 52d22891f6a4..d398e8716ef8 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -366,7 +366,6 @@ EXC_REAL_NONE(0x1800, 0x1900)
366/*** Out of line interrupts support ***/ 366/*** Out of line interrupts support ***/
367 367
368 /* moved from 0x200 */ 368 /* moved from 0x200 */
369 .align 7;
370TRAMP_REAL_BEGIN(machine_check_powernv_early) 369TRAMP_REAL_BEGIN(machine_check_powernv_early)
371BEGIN_FTR_SECTION 370BEGIN_FTR_SECTION
372 EXCEPTION_PROLOG_1(PACA_EXMC, NOTEST, 0x200) 371 EXCEPTION_PROLOG_1(PACA_EXMC, NOTEST, 0x200)
@@ -535,7 +534,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
535 b . 534 b .
536#endif 535#endif
537 536
538 .align 7
539 /* moved from 0xe00 */ 537 /* moved from 0xe00 */
540__TRAMP_REAL_REAL_OOL_HV(h_data_storage, 0xe00) 538__TRAMP_REAL_REAL_OOL_HV(h_data_storage, 0xe00)
541TRAMP_KVM_HV_SKIP(PACA_EXGEN, 0xe00) 539TRAMP_KVM_HV_SKIP(PACA_EXGEN, 0xe00)
@@ -652,7 +650,6 @@ ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE)
652/* 650/*
653 * Vectors for the FWNMI option. Share common code. 651 * Vectors for the FWNMI option. Share common code.
654 */ 652 */
655 .align 7
656TRAMP_REAL_BEGIN(system_reset_fwnmi) 653TRAMP_REAL_BEGIN(system_reset_fwnmi)
657 SET_SCRATCH0(r13) /* save r13 */ 654 SET_SCRATCH0(r13) /* save r13 */
658 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common, EXC_STD, 655 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common, EXC_STD,
@@ -695,46 +692,30 @@ TRAMP_REAL_BEGIN(kvmppc_skip_Hinterrupt)
695 692
696/*** Common interrupt handlers ***/ 693/*** Common interrupt handlers ***/
697 694
698 .align 7;
699EXC_COMMON(system_reset_common, 0x100, system_reset_exception) 695EXC_COMMON(system_reset_common, 0x100, system_reset_exception)
700 .align 7;
701EXC_COMMON_ASYNC(hardware_interrupt_common, 0x500, do_IRQ) 696EXC_COMMON_ASYNC(hardware_interrupt_common, 0x500, do_IRQ)
702 .align 7;
703EXC_COMMON_ASYNC(decrementer_common, 0x900, timer_interrupt) 697EXC_COMMON_ASYNC(decrementer_common, 0x900, timer_interrupt)
704 .align 7;
705EXC_COMMON(hdecrementer_common, 0x980, hdec_interrupt) 698EXC_COMMON(hdecrementer_common, 0x980, hdec_interrupt)
706 699
707 .align 7;
708#ifdef CONFIG_PPC_DOORBELL 700#ifdef CONFIG_PPC_DOORBELL
709EXC_COMMON_ASYNC(doorbell_super_common, 0xa00, doorbell_exception) 701EXC_COMMON_ASYNC(doorbell_super_common, 0xa00, doorbell_exception)
710#else 702#else
711EXC_COMMON_ASYNC(doorbell_super_common, 0xa00, unknown_exception) 703EXC_COMMON_ASYNC(doorbell_super_common, 0xa00, unknown_exception)
712#endif 704#endif
713 .align 7;
714EXC_COMMON(trap_0b_common, 0xb00, unknown_exception) 705EXC_COMMON(trap_0b_common, 0xb00, unknown_exception)
715 .align 7;
716EXC_COMMON(single_step_common, 0xd00, single_step_exception) 706EXC_COMMON(single_step_common, 0xd00, single_step_exception)
717 .align 7;
718EXC_COMMON(trap_0e_common, 0xe00, unknown_exception) 707EXC_COMMON(trap_0e_common, 0xe00, unknown_exception)
719 .align 7;
720EXC_COMMON(emulation_assist_common, 0xe40, emulation_assist_interrupt) 708EXC_COMMON(emulation_assist_common, 0xe40, emulation_assist_interrupt)
721 .align 7;
722EXC_COMMON_ASYNC(hmi_exception_common, 0xe60, handle_hmi_exception) 709EXC_COMMON_ASYNC(hmi_exception_common, 0xe60, handle_hmi_exception)
723 .align 7;
724#ifdef CONFIG_PPC_DOORBELL 710#ifdef CONFIG_PPC_DOORBELL
725EXC_COMMON_ASYNC(h_doorbell_common, 0xe80, doorbell_exception) 711EXC_COMMON_ASYNC(h_doorbell_common, 0xe80, doorbell_exception)
726#else 712#else
727EXC_COMMON_ASYNC(h_doorbell_common, 0xe80, unknown_exception) 713EXC_COMMON_ASYNC(h_doorbell_common, 0xe80, unknown_exception)
728#endif 714#endif
729 .align 7;
730EXC_COMMON_ASYNC(h_virt_irq_common, 0xea0, do_IRQ) 715EXC_COMMON_ASYNC(h_virt_irq_common, 0xea0, do_IRQ)
731 .align 7;
732EXC_COMMON_ASYNC(performance_monitor_common, 0xf00, performance_monitor_exception) 716EXC_COMMON_ASYNC(performance_monitor_common, 0xf00, performance_monitor_exception)
733 .align 7;
734EXC_COMMON(instruction_breakpoint_common, 0x1300, instruction_breakpoint_exception) 717EXC_COMMON(instruction_breakpoint_common, 0x1300, instruction_breakpoint_exception)
735 .align 7;
736EXC_COMMON_HV(denorm_common, 0x1500, unknown_exception) 718EXC_COMMON_HV(denorm_common, 0x1500, unknown_exception)
737 .align 7;
738#ifdef CONFIG_ALTIVEC 719#ifdef CONFIG_ALTIVEC
739EXC_COMMON(altivec_assist_common, 0x1700, altivec_assist_exception) 720EXC_COMMON(altivec_assist_common, 0x1700, altivec_assist_exception)
740#else 721#else
@@ -889,7 +870,6 @@ TRAMP_REAL_BEGIN(ppc64_runlatch_on_trampoline)
889 * SRR0 and SRR1 are saved in r11 and r12, 870 * SRR0 and SRR1 are saved in r11 and r12,
890 * r9 - r13 are saved in paca->exgen. 871 * r9 - r13 are saved in paca->exgen.
891 */ 872 */
892 .align 7
893EXC_COMMON_BEGIN(data_access_common) 873EXC_COMMON_BEGIN(data_access_common)
894 mfspr r10,SPRN_DAR 874 mfspr r10,SPRN_DAR
895 std r10,PACA_EXGEN+EX_DAR(r13) 875 std r10,PACA_EXGEN+EX_DAR(r13)
@@ -909,7 +889,6 @@ MMU_FTR_SECTION_ELSE
909 b handle_page_fault 889 b handle_page_fault
910ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX) 890ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
911 891
912 .align 7
913EXC_COMMON_BEGIN(h_data_storage_common) 892EXC_COMMON_BEGIN(h_data_storage_common)
914 mfspr r10,SPRN_HDAR 893 mfspr r10,SPRN_HDAR
915 std r10,PACA_EXGEN+EX_DAR(r13) 894 std r10,PACA_EXGEN+EX_DAR(r13)
@@ -922,7 +901,6 @@ EXC_COMMON_BEGIN(h_data_storage_common)
922 bl unknown_exception 901 bl unknown_exception
923 b ret_from_except 902 b ret_from_except
924 903
925 .align 7
926EXC_COMMON_BEGIN(instruction_access_common) 904EXC_COMMON_BEGIN(instruction_access_common)
927 EXCEPTION_PROLOG_COMMON(0x400, PACA_EXGEN) 905 EXCEPTION_PROLOG_COMMON(0x400, PACA_EXGEN)
928 RECONCILE_IRQ_STATE(r10, r11) 906 RECONCILE_IRQ_STATE(r10, r11)
@@ -938,14 +916,12 @@ MMU_FTR_SECTION_ELSE
938 b handle_page_fault 916 b handle_page_fault
939ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX) 917ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
940 918
941 .align 7
942EXC_COMMON(h_instr_storage_common, 0xe20, unknown_exception) 919EXC_COMMON(h_instr_storage_common, 0xe20, unknown_exception)
943 920
944 /* 921 /*
945 * Machine check is different because we use a different 922 * Machine check is different because we use a different
946 * save area: PACA_EXMC instead of PACA_EXGEN. 923 * save area: PACA_EXMC instead of PACA_EXGEN.
947 */ 924 */
948 .align 7
949EXC_COMMON_BEGIN(machine_check_common) 925EXC_COMMON_BEGIN(machine_check_common)
950 mfspr r10,SPRN_DAR 926 mfspr r10,SPRN_DAR
951 std r10,PACA_EXMC+EX_DAR(r13) 927 std r10,PACA_EXMC+EX_DAR(r13)
@@ -966,7 +942,6 @@ EXC_COMMON_BEGIN(machine_check_common)
966 bl machine_check_exception 942 bl machine_check_exception
967 b ret_from_except 943 b ret_from_except
968 944
969 .align 7
970EXC_COMMON_BEGIN(alignment_common) 945EXC_COMMON_BEGIN(alignment_common)
971 mfspr r10,SPRN_DAR 946 mfspr r10,SPRN_DAR
972 std r10,PACA_EXGEN+EX_DAR(r13) 947 std r10,PACA_EXGEN+EX_DAR(r13)
@@ -983,7 +958,6 @@ EXC_COMMON_BEGIN(alignment_common)
983 bl alignment_exception 958 bl alignment_exception
984 b ret_from_except 959 b ret_from_except
985 960
986 .align 7
987EXC_COMMON_BEGIN(program_check_common) 961EXC_COMMON_BEGIN(program_check_common)
988 EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN) 962 EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
989 bl save_nvgprs 963 bl save_nvgprs
@@ -992,7 +966,6 @@ EXC_COMMON_BEGIN(program_check_common)
992 bl program_check_exception 966 bl program_check_exception
993 b ret_from_except 967 b ret_from_except
994 968
995 .align 7
996EXC_COMMON_BEGIN(fp_unavailable_common) 969EXC_COMMON_BEGIN(fp_unavailable_common)
997 EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN) 970 EXCEPTION_PROLOG_COMMON(0x800, PACA_EXGEN)
998 bne 1f /* if from user, just load it up */ 971 bne 1f /* if from user, just load it up */
@@ -1022,7 +995,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_TM)
1022 b ret_from_except 995 b ret_from_except
1023#endif 996#endif
1024 997
1025 .align 7
1026EXC_COMMON_BEGIN(altivec_unavailable_common) 998EXC_COMMON_BEGIN(altivec_unavailable_common)
1027 EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN) 999 EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN)
1028#ifdef CONFIG_ALTIVEC 1000#ifdef CONFIG_ALTIVEC
@@ -1056,7 +1028,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
1056 bl altivec_unavailable_exception 1028 bl altivec_unavailable_exception
1057 b ret_from_except 1029 b ret_from_except
1058 1030
1059 .align 7
1060EXC_COMMON_BEGIN(vsx_unavailable_common) 1031EXC_COMMON_BEGIN(vsx_unavailable_common)
1061 EXCEPTION_PROLOG_COMMON(0xf40, PACA_EXGEN) 1032 EXCEPTION_PROLOG_COMMON(0xf40, PACA_EXGEN)
1062#ifdef CONFIG_VSX 1033#ifdef CONFIG_VSX
@@ -1125,22 +1096,16 @@ fwnmi_data_area:
1125 . = 0x8000 1096 . = 0x8000
1126#endif /* defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */ 1097#endif /* defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */
1127 1098
1128 .align 7;
1129EXC_COMMON(facility_unavailable_common, 0xf60, facility_unavailable_exception) 1099EXC_COMMON(facility_unavailable_common, 0xf60, facility_unavailable_exception)
1130 .align 7;
1131EXC_COMMON(h_facility_unavailable_common, 0xf80, facility_unavailable_exception) 1100EXC_COMMON(h_facility_unavailable_common, 0xf80, facility_unavailable_exception)
1132 1101
1133#ifdef CONFIG_CBE_RAS 1102#ifdef CONFIG_CBE_RAS
1134 .align 7;
1135EXC_COMMON(cbe_system_error_common, 0x1200, cbe_system_error_exception) 1103EXC_COMMON(cbe_system_error_common, 0x1200, cbe_system_error_exception)
1136 .align 7;
1137EXC_COMMON(cbe_maintenance_common, 0x1600, cbe_maintenance_exception) 1104EXC_COMMON(cbe_maintenance_common, 0x1600, cbe_maintenance_exception)
1138 .align 7;
1139EXC_COMMON(cbe_thermal_common, 0x1800, cbe_thermal_exception) 1105EXC_COMMON(cbe_thermal_common, 0x1800, cbe_thermal_exception)
1140#endif /* CONFIG_CBE_RAS */ 1106#endif /* CONFIG_CBE_RAS */
1141 1107
1142 1108
1143 .align 7;
1144EXC_COMMON_BEGIN(hmi_exception_early) 1109EXC_COMMON_BEGIN(hmi_exception_early)
1145 EXCEPTION_PROLOG_1(PACA_EXGEN, KVMTEST_HV, 0xe60) 1110 EXCEPTION_PROLOG_1(PACA_EXGEN, KVMTEST_HV, 0xe60)
1146 mr r10,r1 /* Save r1 */ 1111 mr r10,r1 /* Save r1 */
@@ -1226,7 +1191,6 @@ hmi_exception_after_realmode:
1226 * Handle machine check early in real mode. We come here with 1191 * Handle machine check early in real mode. We come here with
1227 * ME=1, MMU (IR=0 and DR=0) off and using MC emergency stack. 1192 * ME=1, MMU (IR=0 and DR=0) off and using MC emergency stack.
1228 */ 1193 */
1229 .align 7
1230EXC_COMMON_BEGIN(machine_check_handle_early) 1194EXC_COMMON_BEGIN(machine_check_handle_early)
1231 std r0,GPR0(r1) /* Save r0 */ 1195 std r0,GPR0(r1) /* Save r0 */
1232 EXCEPTION_PROLOG_COMMON_3(0x200) 1196 EXCEPTION_PROLOG_COMMON_3(0x200)