Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 1098efd

Browse files
FlyGoatchenhuacai
authored andcommitted
LoongArch: Override higher address bits in JUMP_VIRT_ADDR
In JUMP_VIRT_ADDR we are performing an or calculation on address value directly from pcaddi. This will only work if we are currently running from direct 1:1 mapping addresses or firmware's DMW is configured exactly same as kernel. Still, we should not rely on such assumption. Fix by overriding higher bits in address comes from pcaddi, so we can get rid of or operator. Cc: stable@vger.kernel.org Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent beb2800 commit 1098efd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/loongarch/include/asm/stackframe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
.macro JUMP_VIRT_ADDR temp1 temp2
4343
li.d \temp1, CACHE_BASE
4444
pcaddi \temp2, 0
45-
or \temp1, \temp1, \temp2
45+
bstrins.d \temp1, \temp2, (DMW_PABITS - 1), 0
4646
jirl zero, \temp1, 0xc
4747
.endm
4848

0 commit comments

Comments
 (0)