@@ -93,6 +93,17 @@ ENTRY(cpu_v7_dcache_clean_area)
93
93
ret lr
94
94
ENDPROC(cpu_v7_dcache_clean_area)
95
95
96
+ ENTRY(cpu_v7_iciallu_switch_mm)
97
+ mov r3 , # 0
98
+ mcr p15 , 0 , r3 , c7 , c5 , 0 @ ICIALLU
99
+ b cpu_v7_switch_mm
100
+ ENDPROC(cpu_v7_iciallu_switch_mm)
101
+ ENTRY(cpu_v7_bpiall_switch_mm)
102
+ mov r3 , # 0
103
+ mcr p15 , 0 , r3 , c7 , c5 , 6 @ flush BTAC/BTB
104
+ b cpu_v7_switch_mm
105
+ ENDPROC(cpu_v7_bpiall_switch_mm)
106
+
96
107
string cpu_v7_name , "ARMv7 Processor"
97
108
. align
98
109
@@ -158,31 +169,6 @@ ENTRY(cpu_v7_do_resume)
158
169
ENDPROC(cpu_v7_do_resume)
159
170
#endif
160
171
161
- / *
162
- * Cortex - A8
163
- * /
164
- globl_equ cpu_ca8_proc_init , cpu_v7_proc_init
165
- globl_equ cpu_ca8_proc_fin , cpu_v7_proc_fin
166
- globl_equ cpu_ca8_reset , cpu_v7_reset
167
- globl_equ cpu_ca8_do_idle , cpu_v7_do_idle
168
- globl_equ cpu_ca8_dcache_clean_area , cpu_v7_dcache_clean_area
169
- globl_equ cpu_ca8_set_pte_ext , cpu_v7_set_pte_ext
170
- globl_equ cpu_ca8_suspend_size , cpu_v7_suspend_size
171
- #ifdef CONFIG_ARM_CPU_SUSPEND
172
- globl_equ cpu_ca8_do_suspend , cpu_v7_do_suspend
173
- globl_equ cpu_ca8_do_resume , cpu_v7_do_resume
174
- #endif
175
-
176
- / *
177
- * Cortex - A9 processor functions
178
- * /
179
- globl_equ cpu_ca9mp_proc_init , cpu_v7_proc_init
180
- globl_equ cpu_ca9mp_proc_fin , cpu_v7_proc_fin
181
- globl_equ cpu_ca9mp_reset , cpu_v7_reset
182
- globl_equ cpu_ca9mp_do_idle , cpu_v7_do_idle
183
- globl_equ cpu_ca9mp_dcache_clean_area , cpu_v7_dcache_clean_area
184
- globl_equ cpu_ca9mp_switch_mm , cpu_v7_switch_mm
185
- globl_equ cpu_ca9mp_set_pte_ext , cpu_v7_set_pte_ext
186
172
.globl cpu_ca9mp_suspend_size
187
173
. equ cpu_ca9mp_suspend_size , cpu_v7_suspend_size + 4 * 2
188
174
#ifdef CONFIG_ARM_CPU_SUSPEND
@@ -548,10 +534,75 @@ __v7_setup_stack:
548
534
549
535
@ define struct processor (see <asm/proc - fns.h> and proc - macros.S)
550
536
define_processor_functions v7 , dabort=v7_early_abort , pabort=v7_pabort , suspend= 1
537
+
538
+ #ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
539
+ @ generic v7 bpiall on context switch
540
+ globl_equ cpu_v7_bpiall_proc_init , cpu_v7_proc_init
541
+ globl_equ cpu_v7_bpiall_proc_fin , cpu_v7_proc_fin
542
+ globl_equ cpu_v7_bpiall_reset , cpu_v7_reset
543
+ globl_equ cpu_v7_bpiall_do_idle , cpu_v7_do_idle
544
+ globl_equ cpu_v7_bpiall_dcache_clean_area , cpu_v7_dcache_clean_area
545
+ globl_equ cpu_v7_bpiall_set_pte_ext , cpu_v7_set_pte_ext
546
+ globl_equ cpu_v7_bpiall_suspend_size , cpu_v7_suspend_size
547
+ #ifdef CONFIG_ARM_CPU_SUSPEND
548
+ globl_equ cpu_v7_bpiall_do_suspend , cpu_v7_do_suspend
549
+ globl_equ cpu_v7_bpiall_do_resume , cpu_v7_do_resume
550
+ #endif
551
+ define_processor_functions v7_bpiall , dabort=v7_early_abort , pabort=v7_pabort , suspend= 1
552
+
553
+ #define HARDENED_BPIALL_PROCESSOR_FUNCTIONS v7_bpiall_processor_functions
554
+ #else
555
+ #define HARDENED_BPIALL_PROCESSOR_FUNCTIONS v7_processor_functions
556
+ #endif
557
+
551
558
#ifndef CONFIG_ARM_LPAE
559
+ @ Cortex - A8 - always needs bpiall switch_mm implementation
560
+ globl_equ cpu_ca8_proc_init , cpu_v7_proc_init
561
+ globl_equ cpu_ca8_proc_fin , cpu_v7_proc_fin
562
+ globl_equ cpu_ca8_reset , cpu_v7_reset
563
+ globl_equ cpu_ca8_do_idle , cpu_v7_do_idle
564
+ globl_equ cpu_ca8_dcache_clean_area , cpu_v7_dcache_clean_area
565
+ globl_equ cpu_ca8_set_pte_ext , cpu_v7_set_pte_ext
566
+ globl_equ cpu_ca8_switch_mm , cpu_v7_bpiall_switch_mm
567
+ globl_equ cpu_ca8_suspend_size , cpu_v7_suspend_size
568
+ #ifdef CONFIG_ARM_CPU_SUSPEND
569
+ globl_equ cpu_ca8_do_suspend , cpu_v7_do_suspend
570
+ globl_equ cpu_ca8_do_resume , cpu_v7_do_resume
571
+ #endif
552
572
define_processor_functions ca8 , dabort=v7_early_abort , pabort=v7_pabort , suspend= 1
573
+
574
+ @ Cortex - A9 - needs more registers preserved across suspend/resume
575
+ @ and bpiall switch_mm for hardening
576
+ globl_equ cpu_ca9mp_proc_init , cpu_v7_proc_init
577
+ globl_equ cpu_ca9mp_proc_fin , cpu_v7_proc_fin
578
+ globl_equ cpu_ca9mp_reset , cpu_v7_reset
579
+ globl_equ cpu_ca9mp_do_idle , cpu_v7_do_idle
580
+ globl_equ cpu_ca9mp_dcache_clean_area , cpu_v7_dcache_clean_area
581
+ #ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
582
+ globl_equ cpu_ca9mp_switch_mm , cpu_v7_bpiall_switch_mm
583
+ #else
584
+ globl_equ cpu_ca9mp_switch_mm , cpu_v7_switch_mm
585
+ #endif
586
+ globl_equ cpu_ca9mp_set_pte_ext , cpu_v7_set_pte_ext
553
587
define_processor_functions ca9mp , dabort=v7_early_abort , pabort=v7_pabort , suspend= 1
554
588
#endif
589
+
590
+ @ Cortex - A15 - needs iciallu switch_mm for hardening
591
+ globl_equ cpu_ca15_proc_init , cpu_v7_proc_init
592
+ globl_equ cpu_ca15_proc_fin , cpu_v7_proc_fin
593
+ globl_equ cpu_ca15_reset , cpu_v7_reset
594
+ globl_equ cpu_ca15_do_idle , cpu_v7_do_idle
595
+ globl_equ cpu_ca15_dcache_clean_area , cpu_v7_dcache_clean_area
596
+ #ifdef CONFIG_HARDEN_BRANCH_PREDICTOR
597
+ globl_equ cpu_ca15_switch_mm , cpu_v7_iciallu_switch_mm
598
+ #else
599
+ globl_equ cpu_ca15_switch_mm , cpu_v7_switch_mm
600
+ #endif
601
+ globl_equ cpu_ca15_set_pte_ext , cpu_v7_set_pte_ext
602
+ globl_equ cpu_ca15_suspend_size , cpu_v7_suspend_size
603
+ globl_equ cpu_ca15_do_suspend , cpu_v7_do_suspend
604
+ globl_equ cpu_ca15_do_resume , cpu_v7_do_resume
605
+ define_processor_functions ca15 , dabort=v7_early_abort , pabort=v7_pabort , suspend= 1
555
606
#ifdef CONFIG_CPU_PJ4B
556
607
define_processor_functions pj4b , dabort=v7_early_abort , pabort=v7_pabort , suspend= 1
557
608
#endif
@@ -658,7 +709,7 @@ __v7_ca7mp_proc_info:
658
709
__v7_ca12mp_proc_info:
659
710
.long 0x410fc0d0
660
711
.long 0xff0ffff0
661
- __v7_proc __v7_ca12mp_proc_info , __v7_ca12mp_setup
712
+ __v7_proc __v7_ca12mp_proc_info , __v7_ca12mp_setup , proc_fns = HARDENED_BPIALL_PROCESSOR_FUNCTIONS
662
713
.size __v7_ca12mp_proc_info , . - __v7_ca12mp_proc_info
663
714
664
715
/ *
@@ -668,7 +719,7 @@ __v7_ca12mp_proc_info:
668
719
__v7_ca15mp_proc_info:
669
720
.long 0x410fc0f0
670
721
.long 0xff0ffff0
671
- __v7_proc __v7_ca15mp_proc_info , __v7_ca15mp_setup
722
+ __v7_proc __v7_ca15mp_proc_info , __v7_ca15mp_setup , proc_fns = ca15_processor_functions
672
723
.size __v7_ca15mp_proc_info , . - __v7_ca15mp_proc_info
673
724
674
725
/ *
@@ -678,7 +729,7 @@ __v7_ca15mp_proc_info:
678
729
__v7_b15mp_proc_info:
679
730
.long 0x420f00f0
680
731
.long 0xff0ffff0
681
- __v7_proc __v7_b15mp_proc_info , __v7_b15mp_setup , cache_fns = b15_cache_fns
732
+ __v7_proc __v7_b15mp_proc_info , __v7_b15mp_setup , proc_fns = ca15_processor_functions , cache_fns = b15_cache_fns
682
733
.size __v7_b15mp_proc_info , . - __v7_b15mp_proc_info
683
734
684
735
/ *
@@ -688,9 +739,25 @@ __v7_b15mp_proc_info:
688
739
__v7_ca17mp_proc_info:
689
740
.long 0x410fc0e0
690
741
.long 0xff0ffff0
691
- __v7_proc __v7_ca17mp_proc_info , __v7_ca17mp_setup
742
+ __v7_proc __v7_ca17mp_proc_info , __v7_ca17mp_setup , proc_fns = HARDENED_BPIALL_PROCESSOR_FUNCTIONS
692
743
.size __v7_ca17mp_proc_info , . - __v7_ca17mp_proc_info
693
744
745
+ / * ARM Ltd. Cortex A73 processor * /
746
+ .type __v7_ca73_proc_info , #object
747
+ __v7_ca73_proc_info:
748
+ .long 0x410fd090
749
+ .long 0xff0ffff0
750
+ __v7_proc __v7_ca73_proc_info , __v7_setup , proc_fns = HARDENED_BPIALL_PROCESSOR_FUNCTIONS
751
+ .size __v7_ca73_proc_info , . - __v7_ca73_proc_info
752
+
753
+ / * ARM Ltd. Cortex A75 processor * /
754
+ .type __v7_ca75_proc_info , #object
755
+ __v7_ca75_proc_info:
756
+ .long 0x410fd0a0
757
+ .long 0xff0ffff0
758
+ __v7_proc __v7_ca75_proc_info , __v7_setup , proc_fns = HARDENED_BPIALL_PROCESSOR_FUNCTIONS
759
+ .size __v7_ca75_proc_info , . - __v7_ca75_proc_info
760
+
694
761
/ *
695
762
* Qualcomm Inc . Krait processors.
696
763
* /
0 commit comments