On 11/03/24 10:53, Hari Bathini wrote:
On 01/03/24 12:32 pm, Aditya Gupta wrote:
> Below error is noticed when running crash on vmcore collected from a
> linux-next
> kernel crash (linux-next tag next-20240121):
>
> # crash /boot/vmlinuz-6.8.0-rc5-next-20240221 ./vmcore
> ……
> ……
> For help, type “help”.
> Type "apropos word" to search for commands related to
"word"...
>
> crash: page excluded: kernel virtual address: c00000000219a2c0
> type: “vmlist"
>
> This occured since getting the vmalloc area base address doesn't work in
> crash now, due to 'vmap_area_list' being removed in the linux kernel
> with
> below commit (in linux-next tree):
>
> commit 378eb24a0658dd922b29524e0ce35c6c43f56cba
> mm/vmalloc: remove vmap_area_list
>
> As an alternative, the commit introduced 'VMALLOC_START' in
> vmcoreinfo to
> get base address of vmalloc area, use it to return vmallow start address
> instead of depending on vmap_area_list and vmlist
>
LGTM.
Acked-by: Hari Bathini <hbathini(a)linux.ibm.com>
Thanks for the ack, Hari.
- Aditya Gupta
>
>> Reported-by: Sachin Sant <sachinp(a)linux.ibm.com>
>> Signed-off-by: Aditya Gupta <adityag(a)linux.ibm.com>
>> ---
>> memory.c | 11 ++++++++++-
>> 1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/memory.c b/memory.c
>> index b84e974a3325..b3027bd101cd 100644
>> --- a/memory.c
>> +++ b/memory.c
>> @@ -17220,11 +17220,20 @@ first_vmalloc_address(void)
>> {
>> static ulong vmalloc_start = 0;
>> ulong vm_struct, vmap_area;
>> + char *vmalloc_start_string;
>> if (DUMPFILE() && vmalloc_start)
>> return vmalloc_start;
>> - if (vt->flags & USE_VMAP_AREA) {
>> + /*
>> + * 'vmap_area_list' and 'vmlist' in newer kernels might be
>> empty, prefer
>> + * `VMALLOC_START` if exported in vmcoreinfo
>> + */
>> + vmalloc_start_string =
>> pc->read_vmcoreinfo("NUMBER(VMALLOC_START)");
>> + if (vmalloc_start_string) {
>> + vmalloc_start = stol(vmalloc_start_string, QUIET, NULL);
>> + free(vmalloc_start_string);
>> + } else if (vt->flags & USE_VMAP_AREA) {
>> get_symbol_data("vmap_area_list", sizeof(void *),
&vmap_area);
>> if (!vmap_area)
>> return 0;