Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
17723e94
Commit
17723e94
authored
Feb 12, 2003
by
Todd Inglett
Committed by
Anton Blanchard
Feb 12, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ppc64: revised machine check exception handler
parent
0ff2df7e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
42 deletions
+68
-42
arch/ppc64/kernel/traps.c
arch/ppc64/kernel/traps.c
+68
-42
No files found.
arch/ppc64/kernel/traps.c
View file @
17723e94
...
...
@@ -151,30 +151,67 @@ SystemResetException(struct pt_regs *regs)
/* What should we do here? We could issue a shutdown or hard reset. */
}
static
int
power4_handle_mce
(
struct
pt_regs
*
regs
)
/*
* See if we can recover from a machine check exception.
* This is only called on power4 (or above) and only via
* the Firmware Non-Maskable Interrupts (fwnmi) handler
* which provides the error analysis for us.
*
* Return 1 if corrected (or delivered a signal).
* Return 0 if there is nothing we can do.
*/
static
int
recover_mce
(
struct
pt_regs
*
regs
,
struct
rtas_error_log
err
)
{
siginfo_t
info
;
if
(
err
.
disposition
==
DISP_FULLY_RECOVERED
)
{
/* Platform corrected itself */
return
1
;
}
else
if
((
regs
->
msr
&
MSR_RI
)
&&
user_mode
(
regs
)
&&
err
.
severity
==
SEVERITY_ERROR_SYNC
&&
err
.
disposition
==
DISP_NOT_RECOVERED
&&
err
.
target
==
TARGET_MEMORY
&&
err
.
type
==
TYPE_ECC_UNCORR
&&
!
(
current
->
pid
==
0
||
current
->
pid
==
1
))
{
/* Kill off a user process with an ECC error */
info
.
si_signo
=
SIGBUS
;
info
.
si_errno
=
0
;
/* XXX something better for ECC error? */
info
.
si_code
=
BUS_ADRERR
;
info
.
si_addr
=
(
void
*
)
regs
->
nip
;
printk
(
KERN_ERR
"MCE: uncorrectable ecc error for pid %d
\n
"
,
current
->
pid
);
_exception
(
SIGBUS
,
&
info
,
regs
);
return
1
;
}
return
0
;
}
/*
* Handle a machine check.
*
* Note that on Power 4 and beyond Firmware Non-Maskable Interrupts (fwnmi)
* should be present. If so the handler which called us tells us if the
* error was recovered (never true if RI=0).
*
* On hardware prior to Power 4 these exceptions were asynchronous which
* means we can't tell exactly where it occurred and so we can't recover.
*
* Note that the debugger should test RI=0 and warn the user that system
* state has been corrupted.
*/
void
MachineCheckException
(
struct
pt_regs
*
regs
)
{
s
iginfo_t
info
;
s
truct
rtas_error_log
err
,
*
errp
;
if
(
fwnmi_active
)
{
struct
rtas_error_log
*
errhdr
=
FWNMI_get_errinfo
(
regs
);
if
(
errhdr
)
{
/* ToDo: attempt to recover from some errors here */
}
FWNMI_release_errinfo
();
}
if
(
!
user_mode
(
regs
))
{
/* Attempt to recover if the interrupt is recoverable */
if
(
regs
->
msr
&
MSR_RI
)
{
if
((
__is_processor
(
PV_POWER4
)
||
__is_processor
(
PV_POWER4p
))
&&
power4_handle_mce
(
regs
))
errp
=
FWNMI_get_errinfo
(
regs
);
if
(
errp
)
err
=
*
errp
;
FWNMI_release_errinfo
();
/* frees errp */
if
(
errp
&&
recover_mce
(
regs
,
err
))
return
;
}
...
...
@@ -195,17 +232,6 @@ MachineCheckException(struct pt_regs *regs)
bust_spinlocks
(
0
);
spin_unlock_irq
(
&
die_lock
);
panic
(
"Unrecoverable Machine Check"
);
}
/*
* XXX we should check RI bit on exception exit and kill the
* task if it was cleared
*/
info
.
si_signo
=
SIGBUS
;
info
.
si_errno
=
0
;
info
.
si_code
=
BUS_ADRERR
;
info
.
si_addr
=
(
void
*
)
regs
->
nip
;
_exception
(
SIGSEGV
,
&
info
,
regs
);
}
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment