* [PATCH] arm64/crashdump-arm64: align 'Kernel code' with '_stext'
@ 2021-05-19 3:16 Pingfan Liu
2021-05-23 7:56 ` Simon Horman
0 siblings, 1 reply; 3+ messages in thread
From: Pingfan Liu @ 2021-05-19 3:16 UTC (permalink / raw)
To: kexec
Since kernel commit e2a073dde921 ("arm64: omit [_text, _stext) from
permanent kernel mapping"), the physical address of 'Kernel code' in
/proc/iomem is mapped from _text, instead, from _stext.
Change the code to cope with this kernel change.
Signed-off-by: Pingfan Liu <piliu@redhat.com>
---
kexec/arch/arm64/crashdump-arm64.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
index 38d1a0f..1da663e 100644
--- a/kexec/arch/arm64/crashdump-arm64.c
+++ b/kexec/arch/arm64/crashdump-arm64.c
@@ -148,7 +148,11 @@ static int crash_get_memory_ranges(void)
* For additional kernel code/data segment.
* kern_paddr_start/kern_size are determined in iomem_range_callback
*/
- elf_info.kern_vaddr_start = get_kernel_sym("_text");
+ /* Refer to kernel:
+ * kernel_code.start = __pa_symbol(_stext);
+ * which is exported through /proc/iomem as "Kernel code"
+ */
+ elf_info.kern_vaddr_start = get_kernel_sym("_stext");
if (!elf_info.kern_vaddr_start)
elf_info.kern_vaddr_start = UINT64_MAX;
--
2.29.2
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64/crashdump-arm64: align 'Kernel code' with '_stext'
2021-05-19 3:16 [PATCH] arm64/crashdump-arm64: align 'Kernel code' with '_stext' Pingfan Liu
@ 2021-05-23 7:56 ` Simon Horman
2021-05-24 8:07 ` piliu
0 siblings, 1 reply; 3+ messages in thread
From: Simon Horman @ 2021-05-23 7:56 UTC (permalink / raw)
To: Pingfan Liu; +Cc: kexec
On Wed, May 19, 2021 at 11:16:21AM +0800, Pingfan Liu wrote:
> Since kernel commit e2a073dde921 ("arm64: omit [_text, _stext) from
> permanent kernel mapping"), the physical address of 'Kernel code' in
> /proc/iomem is mapped from _text, instead, from _stext.
>
> Change the code to cope with this kernel change.
>
> Signed-off-by: Pingfan Liu <piliu@redhat.com>
Thanks, will kexec still work with older kernels with this change in place?
> ---
> kexec/arch/arm64/crashdump-arm64.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
> index 38d1a0f..1da663e 100644
> --- a/kexec/arch/arm64/crashdump-arm64.c
> +++ b/kexec/arch/arm64/crashdump-arm64.c
> @@ -148,7 +148,11 @@ static int crash_get_memory_ranges(void)
> * For additional kernel code/data segment.
> * kern_paddr_start/kern_size are determined in iomem_range_callback
> */
> - elf_info.kern_vaddr_start = get_kernel_sym("_text");
> + /* Refer to kernel:
> + * kernel_code.start = __pa_symbol(_stext);
> + * which is exported through /proc/iomem as "Kernel code"
> + */
> + elf_info.kern_vaddr_start = get_kernel_sym("_stext");
> if (!elf_info.kern_vaddr_start)
> elf_info.kern_vaddr_start = UINT64_MAX;
>
> --
> 2.29.2
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] arm64/crashdump-arm64: align 'Kernel code' with '_stext'
2021-05-23 7:56 ` Simon Horman
@ 2021-05-24 8:07 ` piliu
0 siblings, 0 replies; 3+ messages in thread
From: piliu @ 2021-05-24 8:07 UTC (permalink / raw)
To: Simon Horman; +Cc: kexec
On 5/23/21 3:56 PM, Simon Horman wrote:
> On Wed, May 19, 2021 at 11:16:21AM +0800, Pingfan Liu wrote:
>> Since kernel commit e2a073dde921 ("arm64: omit [_text, _stext) from
>> permanent kernel mapping"), the physical address of 'Kernel code' in
>> /proc/iomem is mapped from _text, instead, from _stext.
>>
>> Change the code to cope with this kernel change.
>>
>> Signed-off-by: Pingfan Liu <piliu@redhat.com>
>
> Thanks, will kexec still work with older kernels with this change in place?
>
Oops, it will. Let me try to bring up another idea to tackle it.
Thanks,
Pingfan
>> ---
>> kexec/arch/arm64/crashdump-arm64.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/kexec/arch/arm64/crashdump-arm64.c b/kexec/arch/arm64/crashdump-arm64.c
>> index 38d1a0f..1da663e 100644
>> --- a/kexec/arch/arm64/crashdump-arm64.c
>> +++ b/kexec/arch/arm64/crashdump-arm64.c
>> @@ -148,7 +148,11 @@ static int crash_get_memory_ranges(void)
>> * For additional kernel code/data segment.
>> * kern_paddr_start/kern_size are determined in iomem_range_callback
>> */
>> - elf_info.kern_vaddr_start = get_kernel_sym("_text");
>> + /* Refer to kernel:
>> + * kernel_code.start = __pa_symbol(_stext);
>> + * which is exported through /proc/iomem as "Kernel code"
>> + */
>> + elf_info.kern_vaddr_start = get_kernel_sym("_stext");
>> if (!elf_info.kern_vaddr_start)
>> elf_info.kern_vaddr_start = UINT64_MAX;
>>
>> --
>> 2.29.2
>>
>>
>> _______________________________________________
>> kexec mailing list
>> kexec@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/kexec
>>
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-24 8:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 3:16 [PATCH] arm64/crashdump-arm64: align 'Kernel code' with '_stext' Pingfan Liu
2021-05-23 7:56 ` Simon Horman
2021-05-24 8:07 ` piliu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.