riscv: kexec: Cleanup riscv_kexec_relocate
authorSong Shuai <songshuaishuai@tinylab.org>
Thu, 7 Sep 2023 10:33:02 +0000 (18:33 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 20 Sep 2023 09:53:29 +0000 (02:53 -0700)
commit04a6a8eb1375c1c1f3a735c5715854ce8a3f3730
tree3f96edf3ce23760f9b70c370a0761b45e38a396e
parent06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
riscv: kexec: Cleanup riscv_kexec_relocate

For readability and simplicity, cleanup the riscv_kexec_relocate code:

- Re-sort the first 4 `mv` instructions against `riscv_kexec_method()`
- Eliminate registers for debugging (s9,s10,s11) and storing const-value (s5,s6)
- Replace `jalr` with `jr` for no-link jump

I tested this on Qemu virt machine and works as it was.

Signed-off-by: Song Shuai <songshuaishuai@tinylab.org>
Link: https://lore.kernel.org/r/20230907103304.590739-2-songshuaishuai@tinylab.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/kexec_relocate.S