Skip to contentSkip to conversation

Please pull x86 biarch crashdump support and misc devel

GIT PULL Eric W. Biederman 2 participants 7 messages Sep 8, 2010 – Sep 9, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I thought I had x86 biarch crashdump working on x86 but it turns out was wrong. So I have merged crashdump-x86.c and crashdump-x86_64.c to ensure that things will work fine.

There are a few misc cleanups in here to support biarch crashdumps.

There is a kexec bzImage load optimization that allows me to use a 64bit crash kernel in 20M in my setup. Perhaps less. Earlier because of an alighment foulup I needed 32M and the kernel was loaded in the middle of the reserved crashdump region.

There is also a new program vmcore-dmesg. Functionally it is very similar to the makedumpfile's --dmesg mode but it handles all of the crazy multi-arch cases so I only need to keep one binary around to strip the kernel's dmesg out of a core file. Additionally vmcore-dmesg is about half the size of makedumpfile and I can build it against uclibc, which makes it much more usable in my constrained initrd setup.

I would post patches but I know I would fat finger that horribly.

git pull git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/kexec-tools-devel.git

---

commit 0320ba301f1e944fde3977df91180a538e99b9aa

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 23:19:35 2010 -0700

x86 bzImage: Optimize the panic kernel memory layout.

Load the setup sectors above the kernel in the panic case, to avoid wasting memory.

Linux kernels frequently have a severe alignment requirment that can be as much as 16M. The start of the reserved crash kernel region is 16M aligned. The setup sectors are tiny 20k? and when we are not running the real mode code they can live anywhere. Move the setup sectors from lower address than the kernel to higher address than the kernel avoids introducing a bad alignment. Allowing the linux kernel to load lower. Loading the linux kernel lower in memory ensures memory is used more efficiently.

commit 8bd3608a761cc7734f1599945f558cdfc8ee94b3

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 15:00:10 2010 -0700

kexec-tools: Add vmcore-dmesg

vmcore-dmesg is a trivial utility to extract the dmesg from a vmcore. This was written in reaction to problems I was having building makedumpfile, and using makedumpfile for extracting dmesg. makedumpfile does a whole lot of things, uses a whole lot of libraries and which make it hard to compile and a little bit clunky to remember the command line switches.

So I have written the trivial vmcore-dmesg program that reads a vmcore either /proc/vmcore or a saved version vmcore and writes the dmesg to stdout.

There is nothing to vmcore-dmesg and all of the arch dependencies are wrapped up in generating the core file. Which means a vmcore-dmesg should work with core files of all architectures without needing a rebuild.

commit 6d4b8e90bc066e79dbc8a1387fb9e32c7d0f9435

Author: Eric W. Biederman <[email protected]>
Date:   Wed Sep 8 10:52:01 2010 -0700

x86_64: Kill now unused crashdump-x86_64.[ch]

Now we use the i386 crashdump-x86 instead we can kill crashdump-x86_64.

commit ff053cdb05c2d95dafbcbfd4ffc079cad3c56cc8

Author: Eric W. Biederman <[email protected]>
Date:   Wed Sep 8 10:12:09 2010 -0700

x86_64: Use the x86 crashdump

With proper biarch support in crashdump-x86, crashdump-x86_64 is now redudant and we can use crashdump-x86 everywhere. Using crashdump-x86 everywhere results in a little unnecessary i386 logic on x86_64 but is otherwise harmless. Removing the unnecessary duplication between i386 and x86_64 should make the code much easier to maintain going forward.

commit aa0418789d8e89478044511c16a32ed4c45fefb3

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 14:11:54 2010 -0700

x86_64: Use the i386 arch_options_t on x86_64

In preparation for having a single crashdump implementation on i386 and x86_64 start sharing arch_options_t between i386 and x86_64, and don't make arch_options static on x86_64.

i386 and x86_64 have been using identitcal defitions of arch_options for a while this change now reflects that practical reality in the code.

commit 773ff64ab0ed27ca6b33c9866f89291226e86574

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 14:10:21 2010 -0700

i386 crashdump: Preserve credits of x86_64 version

commit 9322014fbfa77b5c744d8fabd3e9adf30b751219

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 13:58:29 2010 -0700

i386 crashdump: Compute page_offset paddr vaddr and size like x86_64.

Make certain we are using the same page_offset, paddr, and vaddr and kernel size that the x86_64 crashdump code is using.

commit 53408ce05fc411a1a5d8aee902ed0172518fc5d8

Author: Eric W. Biederman <[email protected]>
Date:   Wed Sep 8 12:01:14 2010 -0700

kexec elf: Handle 64bit elf executables on 32bit platforms.

- Widen some types. Why did I use unsigned long? I guess this code predates the decision to support biarch.
- Since I have made the types wider fix the statements that print those types out.

commit f79a61460fdb6fda47b3a1b01e1b4771374b7975

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 20:31:03 2010 -0700

kexec elf: Clean up error messages build_mem_phdrs

Don't print uncondintionally print an error message about KCORE_ELF_HEADERS_SIZE being wrong when the elf headers are truncated when build_mem_phdrs fails because there are other reasons we could be truncated (like an actual damaged elf file).

Instead only print an error message when either probe_debug is true or we are skipping the total file size checks for some reason. When we do print an error message limit the message to the fact that we are truncated and how many bytes we have and how many bytes we need. The context of the failure should be able to provide the rest of the information.

For now add a comment in crashdump-x86_64.c to direct people to KCORE_ELF_HEADERS_SIZE so that if someone finds the code things can be adjusted.

commit 4c4ef6506eb29cfad16546f6b8435935432d3251

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 13:34:43 2010 -0700

i386 crashdump: pass acpi info, and generalize hack

- Pass the acpi memap to the kernel.
- Port the fix from x86_64 to not truncate the elf note segment to 16K, to keep large machines happy.

commit d25f82619565f862e2a6104fac505b9c13c8fe4c

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 13:23:55 2010 -0700

i386 crashdump: move crashdump debugging code under #ifdef DEBUG

o Put the debug code under #ifdef DEBUG instead of #if 0.
o Do this to match the x86_64 code.

commit 672991ea2208dd478e8c52982f39a87c64a4c8a5

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 13:12:18 2010 -0700

i386 crashdump: Unify get_crash_memory_ranges.

Build a version of get_crash_memory_ranges that works the same on both x86_64 and x86. Reorder the calls in load_crashdump_segments so we have the architectures low memory limit when we call get_crash_memory_ranges.

commit b73411718dbf452675fa903b2db7ab58c24ef1ba

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 12:53:11 2010 -0700

i386 crashdump: Rename and include the x86_64 constants.

Unify the 32bit and the 64bit crashdump headers. Rename arch specific defintions to arch specific names to be clear. Update users of the renamed constants.

commit 8f211c7519327124bb18d9e362ac9777bf400c67

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 12:43:40 2010 -0700

i386 crashdump: Keep elf_info on the stack.

In preparation for merging crashdump-x86 and crashdump-x86_64 move elf_info onto the stack and start filling it out dynamically as appropriate.

Included in this change is only setting lowmem_limit and get_note_info when we are generating a core file for a 32bit kernel.

commit c8e346688c6358427213d9d6fdb83765e365cccd

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 12:05:40 2010 -0700

crashdump: Move kern_vaddr_start from kexec_info into crash_elf_info

These fields as defined in kexec_info are not biarch safe and beyond that crash_elf_info is the structure for passing this kind of information not kexec_info. So move them in prepartion for properly cleaning up biarch x86 functionality.

commit d9bf000b6260ee4558b2d2eb3af08e09cd1fe794

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 11:42:39 2010 -0700

kexec: Kill arch_init

The function only had one user, the error checking was wrong, and the functions it performed are best done elsewhere so remove the tempation of a problemenatic hook.

commit 3578b1f1437f8d1b569d1e30f6d4e15edd1cce53

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 11:37:21 2010 -0700

x86_64 crashdump: Move calculation of the page offset into crashdump-x86_64.c

Don't calculate page_offfset in arch_init. Performing the work there badly messes up biarch support, so move the work into crashdump_x86_64.

commit 3cab31db10dd74aa148ad20aaa3455723bf45138

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 11:25:30 2010 -0700

kexec: Move kernel_version into the kexec core

I'm not pleased with the hacks that we use kernel_version for but kernel_version itself is reasonable code and might be needed elsewhere, so move kernel_version into the kexec core.

commit ebeb4da62f8b51c63a46349b219a5605ee8d79bd

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 10:41:56 2010 -0700

i386 elf: Correct the probe error string

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw
Quoted 18 lines · [email protected] (Eric W. Biederman) writes:

I thought I had x86 biarch crashdump working on x86 but it turns out was wrong. So I have merged crashdump-x86.c and crashdump-x86_64.c to ensure that things will work fine.

There are a few misc cleanups in here to support biarch crashdumps.

There is a kexec bzImage load optimization that allows me to use a 64bit crash kernel in 20M in my setup. Perhaps less. Earlier because of an alighment foulup I needed 32M and the kernel was loaded in the middle of the reserved crashdump region.

There is also a new program vmcore-dmesg. Functionally it is very similar to the makedumpfile's --dmesg mode but it handles all of the crazy multi-arch cases so I only need to keep one binary around to strip the kernel's dmesg out of a core file. Additionally vmcore-dmesg is about half the size of makedumpfile and I can build it against uclibc, which makes it much more usable in my constrained initrd setup.

Quoted 4 lines

I would post patches but I know I would fat finger that horribly.

git pull git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/kexec-tools-devel.git

And the diffstat

eric@fess:~/projects/kexec/kexec-tools-devel$ git-diff-tree --stat master HEAD
 Makefile.in                          |    8 +-
 kexec/Makefile                       |    3 +-
 kexec/arch/i386/crashdump-x86.c      |  333 +++++++++++++----
 kexec/arch/i386/crashdump-x86.h      |   17 +-
 kexec/arch/i386/kexec-bzImage.c      |    4 +-
 kexec/arch/i386/kexec-elf-x86.c      |    2 +-
 kexec/arch/ia64/crashdump-ia64.c     |    6 +-
 kexec/arch/x86_64/Makefile           |    8 +-
 kexec/arch/x86_64/arch_init.c        |   83 ----
 kexec/arch/x86_64/crashdump-x86_64.c |  684 ----------------------------------
 kexec/arch/x86_64/crashdump-x86_64.h |   28 --
 kexec/arch/x86_64/kexec-elf-x86_64.c |    2 +-
 kexec/arch/x86_64/kexec-x86_64.c     |   11 +-
 kexec/arch_init.c                    |    4 -
 kexec/crashdump-elf.c                |   14 +-
 kexec/crashdump.h                    |    3 +
 kexec/kernel_version.c               |   58 +++
 kexec/kexec-elf.c                    |   14 +-
 kexec/kexec-elf.h                    |   44 ++--
 kexec/kexec.c                        |    2 -
 kexec/kexec.h                        |    9 +-
 vmcore-dmesg/Makefile                |   29 ++
 vmcore-dmesg/vmcore-dmesg.8          |   42 ++
 vmcore-dmesg/vmcore-dmesg.c          |  504 +++++++++++++++++++++++++
 24 files changed, 972 insertions(+), 940 deletions(-)
Quoted 258 lines

---

commit 0320ba301f1e944fde3977df91180a538e99b9aa

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 23:19:35 2010 -0700

x86 bzImage: Optimize the panic kernel memory layout.

Load the setup sectors above the kernel in the panic case, to avoid wasting memory.

Linux kernels frequently have a severe alignment requirment that can be as much as 16M. The start of the reserved crash kernel region is 16M aligned. The setup sectors are tiny 20k? and when we are not running the real mode code they can live anywhere. Move the setup sectors from lower address than the kernel to higher address than the kernel avoids introducing a bad alignment. Allowing the linux kernel to load lower. Loading the linux kernel lower in memory ensures memory is used more efficiently.

commit 8bd3608a761cc7734f1599945f558cdfc8ee94b3

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 15:00:10 2010 -0700

kexec-tools: Add vmcore-dmesg

vmcore-dmesg is a trivial utility to extract the dmesg from a vmcore. This was written in reaction to problems I was having building makedumpfile, and using makedumpfile for extracting dmesg. makedumpfile does a whole lot of things, uses a whole lot of libraries and which make it hard to compile and a little bit clunky to remember the command line switches.

So I have written the trivial vmcore-dmesg program that reads a vmcore either /proc/vmcore or a saved version vmcore and writes the dmesg to stdout.

There is nothing to vmcore-dmesg and all of the arch dependencies are wrapped up in generating the core file. Which means a vmcore-dmesg should work with core files of all architectures without needing a rebuild.

commit 6d4b8e90bc066e79dbc8a1387fb9e32c7d0f9435

Author: Eric W. Biederman <[email protected]>
Date:   Wed Sep 8 10:52:01 2010 -0700

x86_64: Kill now unused crashdump-x86_64.[ch]

Now we use the i386 crashdump-x86 instead we can kill crashdump-x86_64.

commit ff053cdb05c2d95dafbcbfd4ffc079cad3c56cc8

Author: Eric W. Biederman <[email protected]>
Date:   Wed Sep 8 10:12:09 2010 -0700

x86_64: Use the x86 crashdump

With proper biarch support in crashdump-x86, crashdump-x86_64 is now redudant and we can use crashdump-x86 everywhere. Using crashdump-x86 everywhere results in a little unnecessary i386 logic on x86_64 but is otherwise harmless. Removing the unnecessary duplication between i386 and x86_64 should make the code much easier to maintain going forward.

commit aa0418789d8e89478044511c16a32ed4c45fefb3

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 14:11:54 2010 -0700

x86_64: Use the i386 arch_options_t on x86_64

In preparation for having a single crashdump implementation on i386 and x86_64 start sharing arch_options_t between i386 and x86_64, and don't make arch_options static on x86_64.

i386 and x86_64 have been using identitcal defitions of arch_options for a while this change now reflects that practical reality in the code.

commit 773ff64ab0ed27ca6b33c9866f89291226e86574

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 14:10:21 2010 -0700

i386 crashdump: Preserve credits of x86_64 version

commit 9322014fbfa77b5c744d8fabd3e9adf30b751219

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 13:58:29 2010 -0700

i386 crashdump: Compute page_offset paddr vaddr and size like x86_64.

Make certain we are using the same page_offset, paddr, and vaddr and kernel size that the x86_64 crashdump code is using.

commit 53408ce05fc411a1a5d8aee902ed0172518fc5d8

Author: Eric W. Biederman <[email protected]>
Date:   Wed Sep 8 12:01:14 2010 -0700

kexec elf: Handle 64bit elf executables on 32bit platforms.

- Widen some types. Why did I use unsigned long? I guess this code predates the decision to support biarch.
- Since I have made the types wider fix the statements that print those types out.

commit f79a61460fdb6fda47b3a1b01e1b4771374b7975

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 20:31:03 2010 -0700

kexec elf: Clean up error messages build_mem_phdrs

Don't print uncondintionally print an error message about KCORE_ELF_HEADERS_SIZE being wrong when the elf headers are truncated when build_mem_phdrs fails because there are other reasons we could be truncated (like an actual damaged elf file).

Instead only print an error message when either probe_debug is true or we are skipping the total file size checks for some reason. When we do print an error message limit the message to the fact that we are truncated and how many bytes we have and how many bytes we need. The context of the failure should be able to provide the rest of the information.

For now add a comment in crashdump-x86_64.c to direct people to KCORE_ELF_HEADERS_SIZE so that if someone finds the code things can be adjusted.

commit 4c4ef6506eb29cfad16546f6b8435935432d3251

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 13:34:43 2010 -0700

i386 crashdump: pass acpi info, and generalize hack

- Pass the acpi memap to the kernel.
- Port the fix from x86_64 to not truncate the elf note segment to 16K, to keep large machines happy.

commit d25f82619565f862e2a6104fac505b9c13c8fe4c

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 13:23:55 2010 -0700

i386 crashdump: move crashdump debugging code under #ifdef DEBUG

o Put the debug code under #ifdef DEBUG instead of #if 0.
o Do this to match the x86_64 code.

commit 672991ea2208dd478e8c52982f39a87c64a4c8a5

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 13:12:18 2010 -0700

i386 crashdump: Unify get_crash_memory_ranges.

Build a version of get_crash_memory_ranges that works the same on both x86_64 and x86. Reorder the calls in load_crashdump_segments so we have the architectures low memory limit when we call get_crash_memory_ranges.

commit b73411718dbf452675fa903b2db7ab58c24ef1ba

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 12:53:11 2010 -0700

i386 crashdump: Rename and include the x86_64 constants.

Unify the 32bit and the 64bit crashdump headers. Rename arch specific defintions to arch specific names to be clear. Update users of the renamed constants.

commit 8f211c7519327124bb18d9e362ac9777bf400c67

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 12:43:40 2010 -0700

i386 crashdump: Keep elf_info on the stack.

In preparation for merging crashdump-x86 and crashdump-x86_64 move elf_info onto the stack and start filling it out dynamically as appropriate.

Included in this change is only setting lowmem_limit and get_note_info when we are generating a core file for a 32bit kernel.

commit c8e346688c6358427213d9d6fdb83765e365cccd

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 12:05:40 2010 -0700

crashdump: Move kern_vaddr_start from kexec_info into crash_elf_info

These fields as defined in kexec_info are not biarch safe and beyond that crash_elf_info is the structure for passing this kind of information not kexec_info. So move them in prepartion for properly cleaning up biarch x86 functionality.

commit d9bf000b6260ee4558b2d2eb3af08e09cd1fe794

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 11:42:39 2010 -0700

kexec: Kill arch_init

The function only had one user, the error checking was wrong, and the functions it performed are best done elsewhere so remove the tempation of a problemenatic hook.

commit 3578b1f1437f8d1b569d1e30f6d4e15edd1cce53

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 11:37:21 2010 -0700

x86_64 crashdump: Move calculation of the page offset into crashdump-x86_64.c

Don't calculate page_offfset in arch_init. Performing the work there badly messes up biarch support, so move the work into crashdump_x86_64.

commit 3cab31db10dd74aa148ad20aaa3455723bf45138

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 11:25:30 2010 -0700

kexec: Move kernel_version into the kexec core

I'm not pleased with the hacks that we use kernel_version for but kernel_version itself is reasonable code and might be needed elsewhere, so move kernel_version into the kexec core.

Quoted 7 lines

commit ebeb4da62f8b51c63a46349b219a5605ee8d79bd

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 10:41:56 2010 -0700

i386 elf: Correct the probe error string

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
In reply to Eric W. Biederman
Quoted 19 lines · Eric W. Biederman

I thought I had x86 biarch crashdump working on x86 but it turns out was wrong. So I have merged crashdump-x86.c and crashdump-x86_64.c to ensure that things will work fine.

There are a few misc cleanups in here to support biarch crashdumps.

There is a kexec bzImage load optimization that allows me to use a 64bit crash kernel in 20M in my setup. Perhaps less. Earlier because of an alighment foulup I needed 32M and the kernel was loaded in the middle of the reserved crashdump region.

There is also a new program vmcore-dmesg. Functionally it is very similar to the makedumpfile's --dmesg mode but it handles all of the crazy multi-arch cases so I only need to keep one binary around to strip the kernel's dmesg out of a core file. Additionally vmcore-dmesg is about half the size of makedumpfile and I can build it against uclibc, which makes it much more usable in my constrained initrd setup.

Quoted 3 lines

I would post patches but I know I would fat finger that horribly.

git pull git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/kexec-tools-devel.git

A git pull request is fine.
Actually, with this many patches, its significantly easier for me too.

Quoted 1 line

---

[ snip ]

Quoted 4 lines

commit c8e346688c6358427213d9d6fdb83765e365cccd

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 12:05:40 2010 -0700
Quoted 8 lines

crashdump: Move kern_vaddr_start from kexec_info into crash_elf_info

These fields as defined in kexec_info are not biarch safe and beyond that crash_elf_info is the structure for passing this kind of information not kexec_info. So move them in prepartion for properly cleaning up biarch x86 functionality.

There appears to be a typo in the following hunk of this patch. I can fix this if you prefer.

kexec/arch/ia64/crashdump-ia64.c +2 -3
index 6b64271..5653e6e 100644
@@ -246,11 +246,11 @@ int load_crashdump_segments(struct kexec_info *info, struct mem_ehdr *ehdr,
 				continue;
 			if (kernel_code_start >= mstart &&
 			    kernel_code_start < mend) {
-				info->kern_vaddr_start = mstart + LOAD_OFFSET;
+				elf_info.kern_vaddr_start = mstart + LOAD_OFFSET;
 				break;
 			}
 		}
-		info->kern_size = kernel_code_end - kernel_code_start + 1;
+		elf_info->kern_size = kernel_code_end - kernel_code_start + 1;
 
-------> elf_info->kern_size should be elf_info.kern_size ?
 

if (crash_create_elf64_headers(info, &elf_info,
crash_memory_range, nr_ranges, &tmp, &sz, EFI_PAGE_SIZE) < 0)

Which results in the following build error:

$ make
ia64-unknown-linux-gnu-gcc -Wall -Wextra -O2 -fomit-frame-pointer -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -I/home/horms/local/opt/crosstool/ia64/gcc-3.4.5-glibc-2.3.6/ia64-unknown-linux-gnu/include -I./include -I./util_lib/include -Iinclude/ -I./kexec/arch/ia64/libfdt -I./kexec/arch/ia64/include  -c -MD -o kexec/arch/ia64/crashdump-ia64.o
kexec/arch/ia64/crashdump-ia64.c
kexec/arch/ia64/crashdump-ia64.c: In function `load_crashdump_segments':
kexec/arch/ia64/crashdump-ia64.c:253: error: invalid type argument of `->'
Quoted 5 lines

commit d9bf000b6260ee4558b2d2eb3af08e09cd1fe794

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 11:42:39 2010 -0700
Quoted 7 lines

kexec: Kill arch_init

The function only had one user, the error checking was wrong, and the functions it performed are best done elsewhere so remove the tempation of a problemenatic hook.

[ snip ]

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw
Quoted 20 lines · Simon Horman
Quoted 19 lines · Eric W. Biederman

I thought I had x86 biarch crashdump working on x86 but it turns out was wrong. So I have merged crashdump-x86.c and crashdump-x86_64.c to ensure that things will work fine.

There are a few misc cleanups in here to support biarch crashdumps.

There is a kexec bzImage load optimization that allows me to use a 64bit crash kernel in 20M in my setup. Perhaps less. Earlier because of an alighment foulup I needed 32M and the kernel was loaded in the middle of the reserved crashdump region.

There is also a new program vmcore-dmesg. Functionally it is very similar to the makedumpfile's --dmesg mode but it handles all of the crazy multi-arch cases so I only need to keep one binary around to strip the kernel's dmesg out of a core file. Additionally vmcore-dmesg is about half the size of makedumpfile and I can build it against uclibc, which makes it much more usable in my constrained initrd setup.

Quoted 6 lines
Quoted 3 lines

I would post patches but I know I would fat finger that horribly.

git pull git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/kexec-tools-devel.git

A git pull request is fine.
Actually, with this many patches, its significantly easier for me too.

Definitely on a good day I would post the patches for review but still send you a pull request.

Quoted 15 lines
Quoted 1 line

---

[ snip ]

Quoted 11 lines

commit c8e346688c6358427213d9d6fdb83765e365cccd

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 12:05:40 2010 -0700

crashdump: Move kern_vaddr_start from kexec_info into crash_elf_info

These fields as defined in kexec_info are not biarch safe and beyond that crash_elf_info is the structure for passing this kind of information not kexec_info. So move them in prepartion for properly cleaning up biarch x86 functionality.

Quoted 4 lines
Quoted 1 line

There appears to be a typo in the following hunk of this patch. I can fix this if you prefer.

If you could add a commit that fixes this that would be great. I have an ia64 compiler around somewhere but not handy :(

Quoted 7 lines
kexec/arch/ia64/crashdump-ia64.c +0 -0
index 6b64271..5653e6e 100644
@@ -246,11 +246,11 @@ int load_crashdump_segments(struct kexec_info *info, struct mem_ehdr *ehdr,
 				continue;
 			if (kernel_code_start >= mstart &&

kexec/arch/ia64/crashdump-ia64.c int load_crashdump_segments(struct kexec_info *info, struct mem_ehdr *ehdr, · line 255

Quoted 10 lines
kexec/arch/ia64/crashdump-ia64.c +2 -3
 			    kernel_code_start < mend) {
-				info->kern_vaddr_start = mstart + LOAD_OFFSET;
+				elf_info.kern_vaddr_start = mstart + LOAD_OFFSET;
 				break;
 			}
 		}
-		info->kern_size = kernel_code_end - kernel_code_start + 1;
+		elf_info->kern_size = kernel_code_end - kernel_code_start + 1;
 
-------> elf_info->kern_size should be elf_info.kern_size ?

Yes.

Quoted 20 lines
kexec/arch/ia64/crashdump-ia64.c +0 -0
 		if (crash_create_elf64_headers(info, &elf_info,
 					       crash_memory_range, nr_ranges,
 					       &tmp, &sz, EFI_PAGE_SIZE) < 0)

Which results in the following build error:

$ make
ia64-unknown-linux-gnu-gcc -Wall -Wextra -O2 -fomit-frame-pointer -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -I/home/horms/local/opt/crosstool/ia64/gcc-3.4.5-glibc-2.3.6/ia64-unknown-linux-gnu/include -I./include -I./util_lib/include -Iinclude/ -I./kexec/arch/ia64/libfdt -I./kexec/arch/ia64/include  -c -MD -o kexec/arch/ia64/crashdump-ia64.o
kexec/arch/ia64/crashdump-ia64.c
kexec/arch/ia64/crashdump-ia64.c: In function `load_crashdump_segments':
kexec/arch/ia64/crashdump-ia64.c:253: error: invalid type argument of `->'
Quoted 7 lines

commit d9bf000b6260ee4558b2d2eb3af08e09cd1fe794

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 11:42:39 2010 -0700

kexec: Kill arch_init

Quoted 7 lines
Quoted 5 lines

The function only had one user, the error checking was wrong, and the functions it performed are best done elsewhere so remove the tempation of a problemenatic hook.

[ snip ]

Thanks,
Eric

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#4 lore raw
Quoted 24 lines · Eric W. Biederman
Quoted 22 lines · Simon Horman
Quoted 21 lines · Eric W. Biederman

I thought I had x86 biarch crashdump working on x86 but it turns out was wrong. So I have merged crashdump-x86.c and crashdump-x86_64.c to ensure that things will work fine.

There are a few misc cleanups in here to support biarch crashdumps.

There is a kexec bzImage load optimization that allows me to use a 64bit crash kernel in 20M in my setup. Perhaps less. Earlier because of an alighment foulup I needed 32M and the kernel was loaded in the middle of the reserved crashdump region.

There is also a new program vmcore-dmesg. Functionally it is very similar to the makedumpfile's --dmesg mode but it handles all of the crazy multi-arch cases so I only need to keep one binary around to strip the kernel's dmesg out of a core file. Additionally vmcore-dmesg is about half the size of makedumpfile and I can build it against uclibc, which makes it much more usable in my constrained initrd setup.

I would post patches but I know I would fat finger that horribly.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

git pull git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/kexec-tools-devel.git

A git pull request is fine.
Actually, with this many patches, its significantly easier for me too.

Definitely on a good day I would post the patches for review but still send you a pull request.

Understood, some days email is against me too!

Quoted 15 lines
Quoted 15 lines
Quoted 1 line

---

[ snip ]

Quoted 11 lines

commit c8e346688c6358427213d9d6fdb83765e365cccd

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 12:05:40 2010 -0700

crashdump: Move kern_vaddr_start from kexec_info into crash_elf_info

These fields as defined in kexec_info are not biarch safe and beyond that crash_elf_info is the structure for passing this kind of information not kexec_info. So move them in prepartion for properly cleaning up biarch x86 functionality.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

There appears to be a typo in the following hunk of this patch. I can fix this if you prefer.

If you could add a commit that fixes this that would be great. I have an ia64 compiler around somewhere but not handy :(

I'd rather edit the patch to avoid breaking bisection. Is that ok with you?

Quoted 45 lines
Quoted 9 lines
kexec/arch/ia64/crashdump-ia64.c +0 -0
index 6b64271..5653e6e 100644
@@ -246,11 +246,11 @@ int load_crashdump_segments(struct kexec_info *info, struct mem_ehdr *ehdr,
 				continue;
 			if (kernel_code_start >= mstart &&

kexec/arch/ia64/crashdump-ia64.c int load_crashdump_segments(struct kexec_info *info, struct mem_ehdr *ehdr, · line 255

Quoted 10 lines
kexec/arch/ia64/crashdump-ia64.c +2 -3
 			    kernel_code_start < mend) {
-				info->kern_vaddr_start = mstart + LOAD_OFFSET;
+				elf_info.kern_vaddr_start = mstart + LOAD_OFFSET;
 				break;
 			}
 		}
-		info->kern_size = kernel_code_end - kernel_code_start + 1;
+		elf_info->kern_size = kernel_code_end - kernel_code_start + 1;
 
-------> elf_info->kern_size should be elf_info.kern_size ?

Yes.

Quoted 24 lines
kexec/arch/ia64/crashdump-ia64.c +0 -0
 		if (crash_create_elf64_headers(info, &elf_info,
 					       crash_memory_range, nr_ranges,
 					       &tmp, &sz, EFI_PAGE_SIZE) < 0)

Which results in the following build error:

$ make
ia64-unknown-linux-gnu-gcc -Wall -Wextra -O2 -fomit-frame-pointer -pipe -fno-strict-aliasing -Wall -Wstrict-prototypes -I/home/horms/local/opt/crosstool/ia64/gcc-3.4.5-glibc-2.3.6/ia64-unknown-linux-gnu/include -I./include -I./util_lib/include -Iinclude/ -I./kexec/arch/ia64/libfdt -I./kexec/arch/ia64/include  -c -MD -o kexec/arch/ia64/crashdump-ia64.o
kexec/arch/ia64/crashdump-ia64.c
kexec/arch/ia64/crashdump-ia64.c: In function `load_crashdump_segments':
kexec/arch/ia64/crashdump-ia64.c:253: error: invalid type argument of `->'
Quoted 11 lines

commit d9bf000b6260ee4558b2d2eb3af08e09cd1fe794

Author: Eric W. Biederman <[email protected]>
Date:   Tue Sep 7 11:42:39 2010 -0700

kexec: Kill arch_init

The function only had one user, the error checking was wrong, and the functions it performed are best done elsewhere so remove the tempation of a problemenatic hook.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

[ snip ]

Thanks,
Eric

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#5 lore raw
Quoted 2 lines · Simon Horman

I'd rather edit the patch to avoid breaking bisection. Is that ok with you?

No real problem, and my patchset is just intrusive enough someone might care and try and bisect a problem.

In general I wouldn't fix that patch (after I had made it public) and would simply send a correcting patch because it can quickly become confusing, which patch should go where when.

Here I don't think there is any danger of confusion so I don't think that changing history that has only been on my devel branch is worth worrying about.

Eric

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#6 lore raw
Quoted 8 lines · Eric W. Biederman
Quoted 2 lines · Simon Horman

I'd rather edit the patch to avoid breaking bisection. Is that ok with you?

No real problem, and my patchset is just intrusive enough someone might care and try and bisect a problem.

Quoted 7 lines

In general I wouldn't fix that patch (after I had made it public) and would simply send a correcting patch because it can quickly become confusing, which patch should go where when.

Here I don't think there is any danger of confusion so I don't think that changing history that has only been on my devel branch is worth worrying about.

Agreed. I've made the change and pushed the result.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec