FYI: x86_64 bug when using gdb with vmcore
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): 571350993.1786101266414411140.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com
Quoted 30 lines · ----- "Simon Horman
Quoted 21 lines · Dave Anderson
The
kexec/arch/x86_64/crashdump-x86_64.hfile contains a stalePAGE_OFFSETvalue. In 2.6.27 it was changed from0xffff810000000000ULto0xffff880000000000UL. This is only a problem when using gdb with the vmlinux/vmcore pair, because gdb relies upon thePT_LOADsegment'sp_vaddrvalues in the ELF header to be correct.Anyway, in the RHEL6 kexec-tools, this simple patch was made:
(quoted diff) +1
-1-#define PAGE_OFFSET 0xffff810000000000UL +#define PAGE_OFFSET 0xffff880000000000ULwhich is OK since the RHEL6 version of kexec-tools will only be used with RHEL6 kernels.
But for backwards compatibility, the better way to do it would be to check the utsname of the running kernel, and use the right value.
Quoted 5 lines
But again, this is only required for gdb usage. The crash utility (and makedumpfile) make kernel version checks to determine which
x86_64PAGE_OFFSETvalue is applicable, and don't rely on the ELF headerp_vaddrvalues for the unity-mapped regions.Hi Dave,
Quoted 1 line
Something like this?
Looks good to me -- all except for the second "if" statement/typo below:
Quoted 5 lines
(quoted diff) +5
-0+int arch_init(void) +{ + int kv; + + kv = kernel_version();
Review
Quoted 10 lines
(quoted diff) +10
-0+ if (kv < 0) + return -1; + + if (kv < KERNEL_VERSION(2, 4, 27)) + page_offset = PAGE_OFFSET_PRE_2_6_27; + else + page_offset = PAGE_OFFSET; + + return 0; +}
Thanks,
Dave
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 33 lines · Dave Anderson
Quoted 30 lines · ----- "Simon Horman
Quoted 21 lines · Dave Anderson
The
kexec/arch/x86_64/crashdump-x86_64.hfile contains a stalePAGE_OFFSETvalue. In 2.6.27 it was changed from0xffff810000000000ULto0xffff880000000000UL. This is only a problem when using gdb with the vmlinux/vmcore pair, because gdb relies upon thePT_LOADsegment'sp_vaddrvalues in the ELF header to be correct.Anyway, in the RHEL6 kexec-tools, this simple patch was made:
(quoted diff) +1
-1-#define PAGE_OFFSET 0xffff810000000000UL +#define PAGE_OFFSET 0xffff880000000000ULwhich is OK since the RHEL6 version of kexec-tools will only be used with RHEL6 kernels.
But for backwards compatibility, the better way to do it would be to check the utsname of the running kernel, and use the right value.
Quoted 5 lines
But again, this is only required for gdb usage. The crash utility (and makedumpfile) make kernel version checks to determine which
x86_64PAGE_OFFSETvalue is applicable, and don't rely on the ELF headerp_vaddrvalues for the unity-mapped regions.Hi Dave,
Quoted 3 lines
Quoted 1 line
Something like this?
Looks good to me -- all except for the second "if" statement/typo below:
Thanks, 2.4.27 was a special time for me :-)
I've fixed that up and pushed the commit.
Quoted 10 lines
Quoted 10 lines
(quoted diff) +10
-0+int arch_init(void) +{ + int kv; + + kv = kernel_version(); + if (kv < 0) + return -1; + + if (kv < KERNEL_VERSION(2, 4, 27)) + page_offset = PAGE_OFFSET_PRE_2_6_27;
Quoted 8 lines
Review
Quoted 5 lines
(quoted diff) +5
-0+ else + page_offset = PAGE_OFFSET; + + return 0; +}Thanks,
Dave
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec