X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fia64%2Fkernel%2Fmca_drv.c;h=e883d85906db5aa583db42f3dcbb9146e40af1a6;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=8db6e0cedadcbc3d660bd6f5621cbc496e75b466;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c index 8db6e0ced..e883d8590 100644 --- a/arch/ia64/kernel/mca_drv.c +++ b/arch/ia64/kernel/mca_drv.c @@ -6,8 +6,8 @@ * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com) * Copyright (C) 2005 Silicon Graphics, Inc * Copyright (C) 2005 Keith Owens - * Copyright (C) 2006 Russ Anderson */ +#include #include #include #include @@ -61,11 +61,6 @@ typedef enum { ISOLATE_NONE } isolate_status_t; -typedef enum { - MCA_NOT_RECOVERED = 0, - MCA_RECOVERED = 1 -} recovery_status_t; - /* * This pool keeps pointers to the section part of SAL error record */ @@ -75,18 +70,6 @@ static struct { int max_idx; /* Maximum index of section pointer list pool */ } slidx_pool; -static int -fatal_mca(const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - vprintk(fmt, args); - va_end(args); - - return MCA_NOT_RECOVERED; -} - /** * mca_page_isolate - isolate a poisoned page in order not to use it later * @paddr: poisoned memory location @@ -138,12 +121,11 @@ mca_page_isolate(unsigned long paddr) */ void -mca_handler_bh(unsigned long paddr, void *iip, unsigned long ipsr) +mca_handler_bh(unsigned long paddr) { - printk(KERN_ERR "OS_MCA: process [cpu %d, pid: %d, uid: %d, " - "iip: %p, psr: 0x%lx,paddr: 0x%lx](%s) encounters MCA.\n", - raw_smp_processor_id(), current->pid, current->uid, - iip, ipsr, paddr, current->comm); + printk(KERN_ERR + "OS_MCA: process [pid: %d](%s) encounters MCA (paddr=%lx)\n", + current->pid, current->comm, paddr); spin_lock(&mca_bh_lock); switch (mca_page_isolate(paddr)) { @@ -440,7 +422,7 @@ recover_from_read_error(slidx_table_t *slidx, /* Is target address valid? */ if (!pbci->tv) - return fatal_mca(KERN_ALERT "MCA: target address not valid\n"); + return 0; /* * cpu read or memory-mapped io read @@ -458,28 +440,23 @@ recover_from_read_error(slidx_table_t *slidx, /* Is minstate valid? */ if (!peidx_bottom(peidx) || !(peidx_bottom(peidx)->valid.minstate)) - return fatal_mca(KERN_ALERT "MCA: minstate not valid\n"); + return 0; psr1 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_ipsr); - psr2 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_xpsr); /* * Check the privilege level of interrupted context. * If it is user-mode, then terminate affected process. */ - - pmsa = sos->pal_min_state; - if (psr1->cpl != 0 || - ((psr2->cpl != 0) && mca_recover_range(pmsa->pmsa_iip))) { + if (psr1->cpl != 0) { smei = peidx_bus_check(peidx, 0); if (smei->valid.target_identifier) { /* * setup for resume to bottom half of MCA, * "mca_handler_bhhook" */ - /* pass to bhhook as argument (gr8, ...) */ + pmsa = sos->pal_min_state; + /* pass to bhhook as 1st argument (gr8) */ pmsa->pmsa_gr[8-1] = smei->target_identifier; - pmsa->pmsa_gr[9-1] = pmsa->pmsa_iip; - pmsa->pmsa_gr[10-1] = pmsa->pmsa_ipsr; /* set interrupted return address (but no use) */ pmsa->pmsa_br0 = pmsa->pmsa_iip; /* change resume address to bottom half */ @@ -489,16 +466,14 @@ recover_from_read_error(slidx_table_t *slidx, psr2 = (struct ia64_psr *)&pmsa->pmsa_ipsr; psr2->cpl = 0; psr2->ri = 0; - psr2->bn = 1; psr2->i = 0; - return MCA_RECOVERED; + return 1; } } - return fatal_mca(KERN_ALERT "MCA: kernel context not recovered," - " iip 0x%lx\n", pmsa->pmsa_iip); + return 0; } /** @@ -584,13 +559,13 @@ recover_from_processor_error(int platform, slidx_table_t *slidx, * The machine check is corrected. */ if (psp->cm == 1) - return MCA_RECOVERED; + return 1; /* * The error was not contained. Software must be reset. */ if (psp->us || psp->ci == 0) - return fatal_mca(KERN_ALERT "MCA: error not contained\n"); + return 0; /* * The cache check and bus check bits have four possible states @@ -601,22 +576,20 @@ recover_from_processor_error(int platform, slidx_table_t *slidx, * 1 1 Memory error, attempt recovery */ if (psp->bc == 0 || pbci == NULL) - return fatal_mca(KERN_ALERT "MCA: No bus check\n"); + return 0; /* * Sorry, we cannot handle so many. */ if (peidx_bus_check_num(peidx) > 1) - return fatal_mca(KERN_ALERT "MCA: Too many bus checks\n"); + return 0; /* * Well, here is only one bus error. */ - if (pbci->ib) - return fatal_mca(KERN_ALERT "MCA: Internal Bus error\n"); - if (pbci->cc) - return fatal_mca(KERN_ALERT "MCA: Cache-cache error\n"); + if (pbci->ib || pbci->cc) + return 0; if (pbci->eb && pbci->bsi > 0) - return fatal_mca(KERN_ALERT "MCA: External bus check fatal status\n"); + return 0; /* * This is a local MCA and estimated as recoverble external bus error. @@ -628,7 +601,7 @@ recover_from_processor_error(int platform, slidx_table_t *slidx, /* * On account of strange SAL error record, we cannot recover. */ - return fatal_mca(KERN_ALERT "MCA: Strange SAL record\n"); + return 0; } /** @@ -657,10 +630,12 @@ mca_try_to_recover(void *rec, struct ia64_sal_os_state *sos) /* Now, OS can recover when there is one processor error section */ if (n_proc_err > 1) - return fatal_mca(KERN_ALERT "MCA: Too Many Errors\n"); - else if (n_proc_err == 0) + return 0; + else if (n_proc_err == 0) { /* Weird SAL record ... We need not to recover */ - return fatal_mca(KERN_ALERT "MCA: Weird SAL record\n"); + + return 1; + } /* Make index of processor error section */ mca_make_peidx((sal_log_processor_info_t*) @@ -671,7 +646,7 @@ mca_try_to_recover(void *rec, struct ia64_sal_os_state *sos) /* Check whether MCA is global or not */ if (is_mca_global(&peidx, &pbci, sos)) - return fatal_mca(KERN_ALERT "MCA: global MCA\n"); + return 0; /* Try to recover a processor error */ return recover_from_processor_error(platform_err, &slidx, &peidx,