- make /proc/vmcore accesable on x86_64
Subsystems (2)
RFC PATCH 1/1 - make /proc/vmcore accesable on x86_64
hi,
I was playing around with preserve context feature on x86_64 and was not able to get the /proc/vmcore in the kexec-ed kernel until I aplied attached patch.
I'm not at all sure this is right fix ;) but it seems that /proc/vmcore is not loaded since the machine field in the elf header is wrong.
If the x86_64 arch returns 0 (KEXEC_ARCH_DEFAULT) then following condition in load_crashdump_segments function will fill 386 as the machine for the vmcore elf header..
...
if ((info->kexec_flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_X86_64)
{
elf_info.machine = EM_X86_64;
} else {
elf_info.machine = EM_386;
elf_info.lowmem_limit = X86_MAXMEM;
elf_info.get_note_info = get_crash_notes;
}...
ending with kexec-ed kernel failing check for the machine, and disabling vmcore interface...
I'm guessing that the reason is the load_crashdump_segments function being shared among 32 and 64 bits.. but again, not sure ;)
My goal is to share data within the host and kexec-ed kernel, so I'd like to use the /proc/vmcore for that.. any other ideas are welcome :)
thanks,
jirka
---
kexec/arch/i386/crashdump-x86.c +2 -0
@@ -691,6 +691,8 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,struct memory_range *mem_range, *memmap_p;struct crash_elf_info elf_info; +memset (&elf_info,0x0 ,sizeof (elf_info)); +/* Constant parts of the elf_info */ elf_info.data =ELFDATA2LSB ; elf_info.backup_src_start =BACKUP_SRC_START ;
kexec/arch/x86_64/kexec-x86_64.c +1 -4
@@ -134,10 +134,7 @@ int arch_process_options(int argc, char **argv) }const struct arch_map_entry arches[] = { -/* For compatibility with older patches -* use KEXEC_ARCH_DEFAULT instead of KEXEC_ARCH_X86_64 here. -*/ - {"x86_64" ,KEXEC_ARCH_DEFAULT }, + {"x86_64" ,KEXEC_ARCH_X86_64 }, {NULL ,0 }, };
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 31 lines · Jiri Olsa
hi,
I was playing around with preserve context feature on
x86_64and was not able to get the/proc/vmcorein the kexec-ed kernel until I aplied attached patch.I'm not at all sure this is right fix ;) but it seems that
/proc/vmcoreis not loaded since the machine field in the elf header is wrong.If the
x86_64arch returns 0 (KEXEC_ARCH_DEFAULT) then following condition inload_crashdump_segmentsfunction will fill 386 as the machine for the vmcore elf header.....
if ((info->kexec_flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_X86_64) { elf_info.machine = EM_X86_64; } else { elf_info.machine = EM_386; elf_info.lowmem_limit = X86_MAXMEM; elf_info.get_note_info = get_crash_notes; }...
ending with kexec-ed kernel failing check for the machine, and disabling vmcore interface...
Quoted 7 lines
I'm guessing that the reason is the
load_crashdump_segmentsfunction being shared among 32 and 64 bits.. but again, not sure ;)My goal is to share data within the host and kexec-ed kernel, so I'd like to use the
/proc/vmcorefor that.. any other ideas are welcome :)
This approach seems reasonable to me.
I'll push it if a I don't hear any objections
in the near future.
Quoted 25 lines
thanks,
jirka
---kexec/arch/i386/crashdump-x86.c +2
-0@@ -691,6 +691,8 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,struct memory_range *mem_range, *memmap_p;struct crash_elf_info elf_info; +memset (&elf_info,0x0 ,sizeof (elf_info)); +/* Constant parts of the elf_info */ elf_info.data =ELFDATA2LSB ; elf_info.backup_src_start =BACKUP_SRC_START ;kexec/arch/x86_64/kexec-x86_64.c +0
-0@@ -134,10 +134,7 @@ int arch_process_options(int argc, char **argv) }
kexec/arch/x86_64/kexec-x86_64.c int arch_process_options(int argc, char **argv) · line 140
Quoted 10 lines
kexec/arch/x86_64/kexec-x86_64.c +1
-4const struct arch_map_entry arches[] = { -/* For compatibility with older patches -* use KEXEC_ARCH_DEFAULT instead of KEXEC_ARCH_X86_64 here. -*/ - {"x86_64" ,KEXEC_ARCH_DEFAULT }, + {"x86_64" ,KEXEC_ARCH_X86_64 }, {NULL ,0 }, };
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 36 lines · Simon Horman
Quoted 35 lines · Jiri Olsa
hi,
I was playing around with preserve context feature on
x86_64and was not able to get the/proc/vmcorein the kexec-ed kernel until I aplied attached patch.I'm not at all sure this is right fix ;) but it seems that
/proc/vmcoreis not loaded since the machine field in the elf header is wrong.If the
x86_64arch returns 0 (KEXEC_ARCH_DEFAULT) then following condition inload_crashdump_segmentsfunction will fill 386 as the machine for the vmcore elf header.....
if ((info->kexec_flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_X86_64) { elf_info.machine = EM_X86_64; } else { elf_info.machine = EM_386; elf_info.lowmem_limit = X86_MAXMEM; elf_info.get_note_info = get_crash_notes; }...
ending with kexec-ed kernel failing check for the machine, and disabling vmcore interface...
I'm guessing that the reason is the
load_crashdump_segmentsfunction being shared among 32 and 64 bits.. but again, not sure ;)
Quoted 7 lines
Quoted 3 lines
My goal is to share data within the host and kexec-ed kernel, so I'd like to use the
/proc/vmcorefor that.. any other ideas are welcome :)This approach seems reasonable to me.
I'll push it if a I don't hear any objections
in the near future.
Hi Jiru,
could you please submit this as a formal patch with a signed-off-by line?
Quoted 23 lines
Quoted 23 lines
thanks,
jirka
---kexec/arch/i386/crashdump-x86.c +2
-0@@ -691,6 +691,8 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,struct memory_range *mem_range, *memmap_p;struct crash_elf_info elf_info; +memset (&elf_info,0x0 ,sizeof (elf_info)); +/* Constant parts of the elf_info */ elf_info.data =ELFDATA2LSB ; elf_info.backup_src_start =BACKUP_SRC_START ;kexec/arch/x86_64/kexec-x86_64.c +0
-0@@ -134,10 +134,7 @@ int arch_process_options(int argc, char **argv) }
Quoted 16 lines
kexec/arch/x86_64/kexec-x86_64.c int arch_process_options(int argc, char **argv) · line 140
Quoted 10 lines
kexec/arch/x86_64/kexec-x86_64.c +1
-4const struct arch_map_entry arches[] = { -/* For compatibility with older patches -* use KEXEC_ARCH_DEFAULT instead of KEXEC_ARCH_X86_64 here. -*/ - {"x86_64" ,KEXEC_ARCH_DEFAULT }, + {"x86_64" ,KEXEC_ARCH_X86_64 }, {NULL ,0 }, };_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
PATCH 1/1 - make /proc/vmcore accesable on x86_64
Quoted 2 lines · Simon Horman
Quoted 1 line · Simon Horman
On Tue, Oct 19, 2010 at 05:06:30PM +0200, Jiri Olsa wrote:
SNIP
Quoted 11 lines
Quoted 7 lines
Quoted 3 lines
My goal is to share data within the host and kexec-ed kernel, so I'd like to use the
/proc/vmcorefor that.. any other ideas are welcome :)This approach seems reasonable to me.
I'll push it if a I don't hear any objections
in the near future.Hi Jiru,
could you please submit this as a formal patch with a signed-off-by line?
sure, it's attached
thanks,
jirka
---
hi,
I was playing around with preserve context feature on x86_64 and was not able to get the /proc/vmcore in the kexec-ed kernel until I aplied attached patch.
If the x86_64 arch returns 0 (KEXEC_ARCH_DEFAULT) then following condition in load_crashdump_segments function will fill 386 as the machine for the vmcore elf header..
...
if ((info->kexec_flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_X86_64)
{
elf_info.machine = EM_X86_64;
} else {
elf_info.machine = EM_386;
elf_info.lowmem_limit = X86_MAXMEM;
elf_info.get_note_info = get_crash_notes;
}...
ending with kexec-ed kernel failing check for the machine, and disabling vmcore interface.
wbr,
jirka
---
kexec/arch/i386/crashdump-x86.c +2 -0
@@ -691,6 +691,8 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,struct memory_range *mem_range, *memmap_p;struct crash_elf_info elf_info; +memset (&elf_info,0x0 ,sizeof (elf_info)); +/* Constant parts of the elf_info */ elf_info.data =ELFDATA2LSB ; elf_info.backup_src_start =BACKUP_SRC_START ;
kexec/arch/x86_64/kexec-x86_64.c +1 -4
@@ -134,10 +134,7 @@ int arch_process_options(int argc, char **argv) }const struct arch_map_entry arches[] = { -/* For compatibility with older patches -* use KEXEC_ARCH_DEFAULT instead of KEXEC_ARCH_X86_64 here. -*/ - {"x86_64" ,KEXEC_ARCH_DEFAULT }, + {"x86_64" ,KEXEC_ARCH_X86_64 }, {NULL ,0 }, };
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Simon Horman
AppliedQuoted 14 lines · Jiri Olsa
Quoted 2 lines · Simon Horman
Quoted 1 line · Simon Horman
On Tue, Oct 19, 2010 at 05:06:30PM +0200, Jiri Olsa wrote:
SNIP
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
My goal is to share data within the host and kexec-ed kernel, so I'd like to use the
/proc/vmcorefor that.. any other ideas are welcome :)This approach seems reasonable to me.
I'll push it if a I don't hear any objections
in the near future.
Quoted 5 lines
Quoted 3 lines
Hi Jiru,
could you please submit this as a formal patch with a signed-off-by line?
sure, it's attached
Thanks, applied.
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec