Skip to content

Commit 2aac25e

Browse files
Markos Chandrasgregkh
authored andcommitted
MIPS: kernel: cps-vec: Replace "addi" with "addiu"
commit acac410 upstream. The "addi" instruction will trap on overflows which is not something we need in this code, so we replace that with "addiu". Link: http://www.linux-mips.org/archives/linux-mips/2015-01/msg00430.html Cc: Maciej W. Rozycki <macro@linux-mips.org> Cc: Paul Burton <paul.burton@imgtec.com> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6a5f2ac commit 2aac25e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎arch/mips/kernel/cps-vec.S‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ not_nmi:
9999
xori t2, t1, 0x7
100100
beqz t2, 1f
101101
li t3, 32
102-
addi t1, t1, 1
102+
addiu t1, t1, 1
103103
sllv t1, t3, t1
104104
1: /* At this point t1 == I-cache sets per way */
105105
_EXT t2, v0, MIPS_CONF1_IA_SHF, MIPS_CONF1_IA_SZ
106-
addi t2, t2, 1
106+
addiu t2, t2, 1
107107
mul t1, t1, t0
108108
mul t1, t1, t2
109109

@@ -126,11 +126,11 @@ icache_done:
126126
xori t2, t1, 0x7
127127
beqz t2, 1f
128128
li t3, 32
129-
addi t1, t1, 1
129+
addiu t1, t1, 1
130130
sllv t1, t3, t1
131131
1: /* At this point t1 == D-cache sets per way */
132132
_EXT t2, v0, MIPS_CONF1_DA_SHF, MIPS_CONF1_DA_SZ
133-
addi t2, t2, 1
133+
addiu t2, t2, 1
134134
mul t1, t1, t0
135135
mul t1, t1, t2
136136

@@ -250,7 +250,7 @@ LEAF(mips_cps_core_init)
250250
mfc0 t0, CP0_MVPCONF0
251251
srl t0, t0, MVPCONF0_PVPE_SHIFT
252252
andi t0, t0, (MVPCONF0_PVPE >> MVPCONF0_PVPE_SHIFT)
253-
addi t7, t0, 1
253+
addiu t7, t0, 1
254254

255255
/* If there's only 1, we're done */
256256
beqz t0, 2f
@@ -280,7 +280,7 @@ LEAF(mips_cps_core_init)
280280
mttc0 t0, CP0_TCHALT
281281

282282
/* Next VPE */
283-
addi t5, t5, 1
283+
addiu t5, t5, 1
284284
slt t0, t5, t7
285285
bnez t0, 1b
286286
nop
@@ -317,7 +317,7 @@ LEAF(mips_cps_boot_vpes)
317317
mfc0 t1, CP0_MVPCONF0
318318
srl t1, t1, MVPCONF0_PVPE_SHIFT
319319
andi t1, t1, MVPCONF0_PVPE >> MVPCONF0_PVPE_SHIFT
320-
addi t1, t1, 1
320+
addiu t1, t1, 1
321321

322322
/* Calculate a mask for the VPE ID from EBase.CPUNum */
323323
clz t1, t1
@@ -424,7 +424,7 @@ LEAF(mips_cps_boot_vpes)
424424

425425
/* Next VPE */
426426
2: srl t6, t6, 1
427-
addi t5, t5, 1
427+
addiu t5, t5, 1
428428
bnez t6, 1b
429429
nop
430430

0 commit comments

Comments
 (0)