Skip to content

Commit

Permalink
hw-breakpoints: cleanup HW Breakpoint registers before kexec
Browse files Browse the repository at this point in the history
This patch disables Hardware breakpoints before doing a 'kexec' on the machine
so that the cpu doesn't keep debug registers values which would be out of
sync for the new image.

Original-patch-by: Alan Stern <[email protected]>
Signed-off-by: K.Prasad <[email protected]>
Reviewed-by: Alan Stern <[email protected]>
Signed-off-by: Frederic Weisbecker <[email protected]>
  • Loading branch information
K.Prasad authored and fweisbec committed Jun 2, 2009
1 parent 72f674d commit 17f557e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/x86/kernel/machine_kexec_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -202,6 +203,7 @@ void machine_kexec(struct kimage *image)

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

if (image->preserve_context) {
#ifdef CONFIG_X86_IO_APIC
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/machine_kexec_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -282,6 +283,7 @@ void machine_kexec(struct kimage *image)

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

if (image->preserve_context) {
#ifdef CONFIG_X86_IO_APIC
Expand Down

0 comments on commit 17f557e

Please sign in to comment.