Mailing List Archive

[PATCH v3 09/11] x86/xen/enlighten: Add init and crash kexec/kdump hooks
Add init and crash kexec/kdump hooks.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
---
arch/x86/xen/enlighten.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 138e566..5025bba 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -31,6 +31,7 @@
#include <linux/pci.h>
#include <linux/gfp.h>
#include <linux/memblock.h>
+#include <linux/kexec.h>

#include <xen/xen.h>
#include <xen/events.h>
@@ -1276,6 +1277,12 @@ static void xen_machine_power_off(void)

static void xen_crash_shutdown(struct pt_regs *regs)
{
+#ifdef CONFIG_KEXEC_FIRMWARE
+ if (kexec_crash_image) {
+ crash_save_cpu(regs, safe_smp_processor_id());
+ return;
+ }
+#endif
xen_reboot(SHUTDOWN_crash);
}

@@ -1353,6 +1360,10 @@ asmlinkage void __init xen_start_kernel(void)

xen_init_mmu_ops();

+#ifdef CONFIG_KEXEC_FIRMWARE
+ kexec_use_firmware = true;
+#endif
+
/* Prevent unwanted bits from being set in PTEs. */
__supported_pte_mask &= ~_PAGE_GLOBAL;
#if 0
--
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Re: [PATCH v3 09/11] x86/xen/enlighten: Add init and crash kexec/kdump hooks [ In reply to ]
On 12/26/2012 06:18 PM, Daniel Kiper wrote:
> Add init and crash kexec/kdump hooks.
>
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
> ---
> arch/x86/xen/enlighten.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)

On the general issue of hooks:

Hooks need their pre- and postsemantics extremely ewell documented, let
they end up being an impossible roadblock to development.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel