Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292751
b: refs/heads/master
c: af104e3
h: refs/heads/master
i:
  292749: 16a4c78
  292747: 47d7755
  292743: 6c3215d
  292735: 878d44e
v: v3
  • Loading branch information
Tony Luck committed Jan 3, 2012
1 parent 49c38e6 commit 5ba3dbd
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85f92694affa7dba7f1978666a69552b5dfc628e
refs/heads/master: af104e394e17e328df85c25a9e21448539725b67
43 changes: 43 additions & 0 deletions trunk/arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,49 @@ static void mce_clear_state(unsigned long *toclear)
}
}

/*
* Need to save faulting physical address associated with a process
* in the machine check handler some place where we can grab it back
* later in mce_notify_process()
*/
#define MCE_INFO_MAX 16

struct mce_info {
atomic_t inuse;
struct task_struct *t;
__u64 paddr;
} mce_info[MCE_INFO_MAX];

static void mce_save_info(__u64 addr)
{
struct mce_info *mi;

for (mi = mce_info; mi < &mce_info[MCE_INFO_MAX]; mi++) {
if (atomic_cmpxchg(&mi->inuse, 0, 1) == 0) {
mi->t = current;
mi->paddr = addr;
return;
}
}

mce_panic("Too many concurrent recoverable errors", NULL, NULL);
}

static struct mce_info *mce_find_info(void)
{
struct mce_info *mi;

for (mi = mce_info; mi < &mce_info[MCE_INFO_MAX]; mi++)
if (atomic_read(&mi->inuse) && mi->t == current)
return mi;
return NULL;
}

static void mce_clear_info(struct mce_info *mi)
{
atomic_set(&mi->inuse, 0);
}

/*
* The actual machine check handler. This only handles real
* exceptions when something got corrupted coming in through int 18.
Expand Down

0 comments on commit 5ba3dbd

Please sign in to comment.