2011-03-31 14:29:37

by Cliff Wickman

[permalink] [raw]
Subject: [PATCH v3] x86: UV kdump reboot fix

From: Cliff Wickman <[email protected]>

After a crash dump on an SGI Altix UV system the crash kernel fails to
cause a reboot. EFI mode is disabled in the kdump kernel, so only the
reboot_type of BOOT_ACPI works.

> The clean solution would be to add the reboot_type setting to an UV specific
> initialization function. That way only UV is affected and there's no extra
> kludge either, as reboot_type is already global. [Ingo]
(this is too simple -- sometimes I can't see the forest for the trees!)

Diffed against 2.6.38-rc8 (current tip tree)

Signed-off-by: Cliff Wickman <[email protected]>

arch/x86/kernel/apic/x2apic_uv_x.c | 9 +++++++++
1 file changed, 9 insertions(+)

Index: linux.trees.git/arch/x86/kernel/apic/x2apic_uv_x.c
===================================================================
--- linux.trees.git.orig/arch/x86/kernel/apic/x2apic_uv_x.c
+++ linux.trees.git/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -23,6 +23,7 @@
#include <linux/io.h>
#include <linux/pci.h>
#include <linux/kdebug.h>
+#include <linux/crash_dump.h>

#include <asm/uv/uv_mmrs.h>
#include <asm/uv/uv_hub.h>
@@ -34,6 +35,7 @@
#include <asm/ipi.h>
#include <asm/smp.h>
#include <asm/x86_init.h>
+#include <asm/emergency-restart.h>

DEFINE_PER_CPU(int, x2apic_extra_bits);

@@ -810,4 +812,11 @@ void __init uv_system_init(void)

/* register Legacy VGA I/O redirection handler */
pci_register_set_vga_state(uv_set_vga_state);
+
+ /*
+ * for a kdump kernel the reset must be BOOT_ACPI, not BOOT_EFI, as
+ * EFI is not enabled in the kdump kernel.
+ */
+ if (is_kdump_kernel())
+ reboot_type = BOOT_ACPI;
}


2011-03-31 15:58:07

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH v3] x86: UV kdump reboot fix


* Cliff Wickman <[email protected]> wrote:

> Diffed against 2.6.38-rc8 (current tip tree)

It does not apply here:

patching file arch/x86/kernel/apic/x2apic_uv_x.c
Hunk #1 FAILED at 23.
Hunk #2 succeeded at 35 (offset 1 line).
Hunk #3 succeeded at 812 (offset 1 line).
1 out of 3 hunks FAILED -- rejects in file arch/x86/kernel/apic/x2apic_uv_x.c

But yeah, the patch looks good now.

One minor nit, please watch out for the proper capitalization of sentences:

> +
> + /*
> + * for a kdump kernel the reset must be BOOT_ACPI, not BOOT_EFI, as
> + * EFI is not enabled in the kdump kernel.
> + */
> + if (is_kdump_kernel())
> + reboot_type = BOOT_ACPI;

Thanks,

Ingo

2011-03-31 20:07:19

by Cliff Wickman

[permalink] [raw]
Subject: [tip:x86/urgent] x86, UV: Fix kdump reboot

Commit-ID: 818987e9a19c52240ba9b1c20f28f047eef76072
Gitweb: http://git.kernel.org/tip/818987e9a19c52240ba9b1c20f28f047eef76072
Author: Cliff Wickman <[email protected]>
AuthorDate: Thu, 31 Mar 2011 09:32:02 -0500
Committer: Ingo Molnar <[email protected]>
CommitDate: Thu, 31 Mar 2011 18:44:03 +0200

x86, UV: Fix kdump reboot

After a crash dump on an SGI Altix UV system the crash kernel
fails to cause a reboot. EFI mode is disabled in the kdump
kernel, so only the reboot_type of BOOT_ACPI works.

Signed-off-by: Cliff Wickman <[email protected]>
Cc: [email protected]
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/kernel/apic/x2apic_uv_x.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index d2cf39b..33b10a0 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -24,6 +24,7 @@
#include <linux/pci.h>
#include <linux/kdebug.h>
#include <linux/delay.h>
+#include <linux/crash_dump.h>

#include <asm/uv/uv_mmrs.h>
#include <asm/uv/uv_hub.h>
@@ -35,6 +36,7 @@
#include <asm/ipi.h>
#include <asm/smp.h>
#include <asm/x86_init.h>
+#include <asm/emergency-restart.h>

DEFINE_PER_CPU(int, x2apic_extra_bits);

@@ -811,4 +813,11 @@ void __init uv_system_init(void)

/* register Legacy VGA I/O redirection handler */
pci_register_set_vga_state(uv_set_vga_state);
+
+ /*
+ * For a kdump kernel the reset must be BOOT_ACPI, not BOOT_EFI, as
+ * EFI is not enabled in the kdump kernel.
+ */
+ if (is_kdump_kernel())
+ reboot_type = BOOT_ACPI;
}

2011-04-02 20:48:02

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: [PATCH v3] x86: UV kdump reboot fix

On Thu, 31 Mar 2011 09:32:02 CDT, Cliff Wickman said:
> From: Cliff Wickman <[email protected]>
>
> After a crash dump on an SGI Altix UV system the crash kernel fails to
> cause a reboot. EFI mode is disabled in the kdump kernel, so only the
> reboot_type of BOOT_ACPI works.

> + /*
> + * for a kdump kernel the reset must be BOOT_ACPI, not BOOT_EFI, as
> + * EFI is not enabled in the kdump kernel.
> + */
> + if (is_kdump_kernel())
> + reboot_type = BOOT_ACPI;
> }

What happens if some bozo builds their own kdump kernel that has EFI enabled?


Attachments:
(No filename) (227.00 B)

2011-04-03 00:01:59

by Russ Anderson

[permalink] [raw]
Subject: Re: [PATCH v3] x86: UV kdump reboot fix

On Sat, Apr 02, 2011 at 04:47:37PM -0400, [email protected] wrote:
> On Thu, 31 Mar 2011 09:32:02 CDT, Cliff Wickman said:
> > From: Cliff Wickman <[email protected]>
> >
> > After a crash dump on an SGI Altix UV system the crash kernel fails to
> > cause a reboot. EFI mode is disabled in the kdump kernel, so only the
> > reboot_type of BOOT_ACPI works.
>
> > + /*
> > + * for a kdump kernel the reset must be BOOT_ACPI, not BOOT_EFI, as
> > + * EFI is not enabled in the kdump kernel.
> > + */
> > + if (is_kdump_kernel())
> > + reboot_type = BOOT_ACPI;
> > }
>
> What happens if some bozo builds their own kdump kernel that has EFI enabled?

kdump can use the same EFI enabled kernel currently running on the
system. When kexec starts the kdump kernel it indicates that
EFI is not enabled so the kernel does not use EFI.

So what would happen is the bozo built kdump kernel would
work just fine.

There are a lot of detailed discussions of EFI & kdump if you want
to know the details.
http://lkml.org/lkml/2010/7/27/315

--
Russ Anderson, OS RAS/Partitioning Project Lead
SGI - Silicon Graphics Inc [email protected]