File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- BINS =armstub.bin armstub7.bin armstub8-32.bin armstub8-32-gic.bin armstub8.bin armstub8-gic.bin armstub8-gic-highperi.bin
1+ BINS =armstub.bin armstub7.bin armstub8-32.bin armstub8-32-gic.bin armstub8.bin armstub8-gic.bin armstub8-gic-highperi.bin armstub8-gic-spectrev4.bin
22
33CC8? =aarch64-linux-gnu-gcc
44LD8? =aarch64-linux-gnu-ld
@@ -26,6 +26,9 @@ clean :
2626% 8-gic-highperi.o : % 8.S
2727 $(CC8 ) -DGIC=1 -DHIGH_PERI=1 -DBCM2711=1 -c $< -o $@
2828
29+ % 8-gic-spectrev4.o : % 8.S
30+ $(CC8 ) -DGIC=1 -DSPECTRE_V4=1 -DBCM2711=1 -c $< -o $@
31+
2932% 8-32.o : % 7.S
3033 $(CC7 ) -DBCM2710=1 -c $< -o $@
3134
@@ -41,6 +44,9 @@ clean :
4144% 8-gic-highperi.elf : % 8-gic-highperi.o
4245 $(LD8 ) --section-start=.text=0 $< -o $@
4346
47+ % 8-gic-spectrev4.elf : % 8-gic-spectrev4.o
48+ $(LD8 ) --section-start=.text=0 $< -o $@
49+
4450% 8.elf : % 8.o
4551 $(LD8 ) --section-start=.text=0 $< -o $@
4652
@@ -53,6 +59,9 @@ clean :
5359% 8-gic-highperi.tmp : % 8-gic-highperi.elf
5460 $(OBJCOPY8 ) $< -O binary $@
5561
62+ % 8-gic-spectrev4.tmp : % 8-gic-spectrev4.elf
63+ $(OBJCOPY8 ) $< -O binary $@
64+
5665% 8.tmp : % 8.elf
5766 $(OBJCOPY8 ) $< -O binary $@
5867
Original file line number Diff line number Diff line change 6868#define ACTLR_VAL \
6969 (BIT( 0 ) | BIT( 1 ) | BIT( 4 ) | BIT( 5 ) | BIT( 6 ))
7070
71+ #define CPUACTLR_EL1 S3_1_C15_C2_0
72+ #define CPUACTLR_EL1_DLPS BIT( 55 )
73+
7174#define CPUECTLR_EL1 S3_1_C15_C2_1
7275#define CPUECTLR_EL1_SMPEN BIT( 6 )
7376
@@ -130,6 +133,12 @@ _start:
130133 mov x0 , #CPUECTLR_EL1_SMPEN
131134 msr CPUECTLR_EL1 , x0
132135
136+ #ifdef SPECTRE_V4
137+ / * mitigate Spectre v4 * /
138+ mov x0 , #CPUACTLR_EL1_DLPS
139+ msr CPUACTLR_EL1 , x0
140+ #endif
141+
133142#ifdef GIC
134143 bl setup_gic
135144#endif
You can’t perform that action at this time.
0 commit comments