Skip to content

Commit

Permalink
LoongArch: Override higher address bits in JUMP_VIRT_ADDR
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiaxun Yang authored and Huacai Chen committed Jun 3, 2024
1 parent beb2800 commit 1098efd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/loongarch/include/asm/stackframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
.macro JUMP_VIRT_ADDR temp1 temp2
li.d \temp1, CACHE_BASE
pcaddi \temp2, 0
or \temp1, \temp1, \temp2
bstrins.d \temp1, \temp2, (DMW_PABITS - 1), 0
jirl zero, \temp1, 0xc
.endm

Expand Down

0 comments on commit 1098efd

Please sign in to comment.