mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-05-02 21:33:58 +00:00
powerpc/mce: Hookup ierror (instruction) UE errors
Hookup instruction errors (UE) for memory offling via memory_failure() in a manner similar to load/store errors (derror). Since we have access to the NIP, the conversion is a one step process in this case. Signed-off-by: Balbir Singh <bsingharora@gmail.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
ba41e1e1cc
commit
01eaac2b05
1 changed files with 19 additions and 3 deletions
|
@ -488,7 +488,8 @@ static int mce_find_instr_ea_and_pfn(struct pt_regs *regs, uint64_t *addr,
|
||||||
|
|
||||||
static int mce_handle_ierror(struct pt_regs *regs,
|
static int mce_handle_ierror(struct pt_regs *regs,
|
||||||
const struct mce_ierror_table table[],
|
const struct mce_ierror_table table[],
|
||||||
struct mce_error_info *mce_err, uint64_t *addr)
|
struct mce_error_info *mce_err, uint64_t *addr,
|
||||||
|
uint64_t *phys_addr)
|
||||||
{
|
{
|
||||||
uint64_t srr1 = regs->msr;
|
uint64_t srr1 = regs->msr;
|
||||||
int handled = 0;
|
int handled = 0;
|
||||||
|
@ -540,8 +541,22 @@ static int mce_handle_ierror(struct pt_regs *regs,
|
||||||
}
|
}
|
||||||
mce_err->severity = table[i].severity;
|
mce_err->severity = table[i].severity;
|
||||||
mce_err->initiator = table[i].initiator;
|
mce_err->initiator = table[i].initiator;
|
||||||
if (table[i].nip_valid)
|
if (table[i].nip_valid) {
|
||||||
*addr = regs->nip;
|
*addr = regs->nip;
|
||||||
|
if (mce_err->severity == MCE_SEV_ERROR_SYNC &&
|
||||||
|
table[i].error_type == MCE_ERROR_TYPE_UE) {
|
||||||
|
unsigned long pfn;
|
||||||
|
|
||||||
|
if (get_paca()->in_mce < MAX_MCE_DEPTH) {
|
||||||
|
pfn = addr_to_pfn(regs, regs->nip);
|
||||||
|
if (pfn != ULONG_MAX) {
|
||||||
|
*phys_addr =
|
||||||
|
(pfn << PAGE_SHIFT);
|
||||||
|
handled = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -676,7 +691,8 @@ static long mce_handle_error(struct pt_regs *regs,
|
||||||
handled = mce_handle_derror(regs, dtable, &mce_err, &addr,
|
handled = mce_handle_derror(regs, dtable, &mce_err, &addr,
|
||||||
&phys_addr);
|
&phys_addr);
|
||||||
else
|
else
|
||||||
handled = mce_handle_ierror(regs, itable, &mce_err, &addr);
|
handled = mce_handle_ierror(regs, itable, &mce_err, &addr,
|
||||||
|
&phys_addr);
|
||||||
|
|
||||||
if (!handled && mce_err.error_type == MCE_ERROR_TYPE_UE)
|
if (!handled && mce_err.error_type == MCE_ERROR_TYPE_UE)
|
||||||
handled = mce_handle_ue_error(regs);
|
handled = mce_handle_ue_error(regs);
|
||||||
|
|
Loading…
Add table
Reference in a new issue