2009-04-24 06:19:21

by K.Prasad

[permalink] [raw]
Subject: [Patch 09/12] Cleanup HW Breakpoint registers before kexec

From: Alan Stern <[email protected]>

This patch disables Hardware breakpoints before doing a 'kexec' on the machine.

[K.Prasad: Split-out from the bigger patch and minor changes following
re-basing]

Signed-off-by: K.Prasad <[email protected]>
Signed-off-by: Alan Stern <[email protected]>
---
arch/x86/kernel/machine_kexec_32.c | 2 ++
arch/x86/kernel/machine_kexec_64.c | 2 ++
2 files changed, 4 insertions(+)

Index: arch/x86/kernel/machine_kexec_32.c
===================================================================
--- arch/x86/kernel/machine_kexec_32.c.orig 2009-04-01 20:53:43.000000000 +0530
+++ arch/x86/kernel/machine_kexec_32.c 2009-04-01 20:54:46.000000000 +0530
@@ -25,6 +25,7 @@
#include <asm/desc.h>
#include <asm/system.h>
#include <asm/cacheflush.h>
+#include <asm/debugreg.h>

static void set_idt(void *newidt, __u16 limit)
{
@@ -202,6 +203,7 @@

/* Interrupts aren't acceptable while we reboot */
local_irq_disable();
+ hw_breakpoint_disable();

if (image->preserve_context) {
#ifdef CONFIG_X86_IO_APIC
Index: arch/x86/kernel/machine_kexec_64.c
===================================================================
--- arch/x86/kernel/machine_kexec_64.c.orig 2009-04-01 20:53:43.000000000 +0530
+++ arch/x86/kernel/machine_kexec_64.c 2009-04-01 20:54:46.000000000 +0530
@@ -18,6 +18,7 @@
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
#include <asm/mmu_context.h>
+#include <asm/debugreg.h>

static int init_one_level2_page(struct kimage *image, pgd_t *pgd,
unsigned long addr)
@@ -282,6 +283,7 @@

/* Interrupts aren't acceptable while we reboot */
local_irq_disable();
+ hw_breakpoint_disable();

if (image->preserve_context) {
#ifdef CONFIG_X86_IO_APIC