2024-02-26 04:07:44

by Seongsu Park

[permalink] [raw]
Subject: [PATCH] arm64: head: Remove the instructions that get the virtual offset in __relocate_kernel

Since relative references have been used in RELA and RELR tables,
there has been no need to know their start va and end va.
Therefore, the instructions to get virtual offset in __relocate_kernel
should be removed.

Co-developed-by: Leem ChaeHoon <[email protected]>
Signed-off-by: Leem ChaeHoon <[email protected]>
Co-developed-by: Hyongwu Kim <[email protected]>
Signed-off-by: Hyongwu Kim <[email protected]>
Co-developed-by: Gyeonggeon Choi <[email protected]>
Signed-off-by: Gyeonggeon Choi <[email protected]>
Co-developed-by: Soomin Cho <[email protected]>
Signed-off-by: Soomin Cho <[email protected]>
Co-developed-by: Daero Lee <[email protected]>
Signed-off-by: Daero Lee <[email protected]>
Co-developed-by: kmasta <[email protected]>
Signed-off-by: kmasta <[email protected]>
Signed-off-by: Seongsu Park <[email protected]>
---
arch/arm64/kernel/head.S | 2 --
1 file changed, 2 deletions(-)

diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index cab7f91949d8..90db196f7c19 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -787,8 +787,6 @@ SYM_FUNC_START_LOCAL(__relocate_kernel)
*/
adr_l x9, __rela_start
adr_l x10, __rela_end
- mov_q x11, KIMAGE_VADDR // default virtual offset
- add x11, x11, x23 // actual virtual offset

0: cmp x9, x10
b.hs 1f
--
2.34.1



2024-02-28 18:02:51

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH] arm64: head: Remove the instructions that get the virtual offset in __relocate_kernel

On Mon, Feb 26, 2024 at 01:02:24PM +0900, Seongsu Park wrote:
> diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
> index cab7f91949d8..90db196f7c19 100644
> --- a/arch/arm64/kernel/head.S
> +++ b/arch/arm64/kernel/head.S
> @@ -787,8 +787,6 @@ SYM_FUNC_START_LOCAL(__relocate_kernel)
> */
> adr_l x9, __rela_start
> adr_l x10, __rela_end
> - mov_q x11, KIMAGE_VADDR // default virtual offset
> - add x11, x11, x23 // actual virtual offset
>
> 0: cmp x9, x10
> b.hs 1f

This code has been removed by commit 734958ef0b54 ("arm64: head: move
relocation handling to C code") in linux-next, so the patch is no longer
needed.

Thanks.

--
Catalin