13 #include <linux/errno.h>
15 #include <linux/time.h>
16 #include <linux/module.h>
20 #include <asm/cputime.h>
33 static void s390_handle_damage(
char *
msg)
36 disabled_wait((
unsigned long) __builtin_return_address(0));
74 static int mchchk_wng_posted = 0;
78 if (
xchg(&mchchk_wng_posted, 1) == 0)
84 "malfunction (code 0x%016llx).\n", mcck.
mcck_code);
100 void *fpt_save_area, *fpt_creg_save_area;
133 fpt_save_area = (
void *)
S390_lowcore.extended_save_area_addr;
134 fpt_creg_save_area = fpt_save_area + 128;
141 asm volatile(
"lfpc 0(%0)" : :
"a" (&
zero),
"m" (zero));
145 asm volatile(
"lfpc 0(%0)" : :
"a" (fpt_creg_save_area));
164 : :
"a" (fpt_save_area));
183 s390_handle_damage(
"invalid control registers.");
227 s390_handle_damage(
"old psw invalid.");
229 if (!mci->
ms || !mci->
pm || !mci->
ia)
235 #define MAX_IPD_COUNT 29
236 #define MAX_IPD_TIME (5 * 60 * USEC_PER_SEC)
238 #define ED_STP_ISLAND 6
239 #define ED_STP_SYNC 7
240 #define ED_ETR_SYNC 12
241 #define ED_ETR_SWITCH 13
248 static int ipd_count;
250 static unsigned long long last_ipd;
252 unsigned long long tmp;
258 mci = (
struct mci *) &
S390_lowcore.mcck_interruption_code;
264 s390_handle_damage(
"received system damage machine check.");
269 u64 z_mcic, o_mcic, t_mcic;
271 z_mcic = (1ULL<<63 | 1ULL<<59 | 1ULL<<29);
272 o_mcic = (1ULL<<43 | 1ULL<<42 | 1ULL<<41 | 1ULL<<40 |
273 1ULL<<36 | 1ULL<<35 | 1ULL<<34 | 1ULL<<32 |
274 1ULL<<30 | 1ULL<<21 | 1ULL<<20 | 1ULL<<17 |
277 z_mcic = (1ULL<<63 | 1ULL<<59 | 1ULL<<57 | 1ULL<<50 |
279 o_mcic = (1ULL<<43 | 1ULL<<42 | 1ULL<<41 | 1ULL<<40 |
280 1ULL<<36 | 1ULL<<35 | 1ULL<<34 | 1ULL<<32 |
281 1ULL<<30 | 1ULL<<20 | 1ULL<<17 | 1ULL<<16);
283 t_mcic = *(
u64 *)mci;
285 if (((t_mcic & z_mcic) != 0) ||
286 ((t_mcic & o_mcic) != o_mcic)) {
287 s390_handle_damage(
"processing backup machine "
288 "check with damage.");
295 spin_lock(&ipd_lock);
303 s390_handle_damage(
"too many ipd retries.");
304 spin_unlock(&ipd_lock);
307 s390_handle_damage(
"received instruction processing "
308 "damage machine check.");
311 if (s390_revalidate_registers(mci)) {
318 mcck->
mcck_code = *(
unsigned long long *) mci;
325 s390_handle_damage(
"unable to revalidate registers.");
330 s390_handle_damage(
"TOD clock damaged");
332 if (mci->
ed && mci->
ec) {
345 s390_handle_damage(
"received storage error uncorrected "
349 s390_handle_damage(
"received storage key-error uncorrected "
351 if (mci->
ds && mci->
fa)
353 s390_handle_damage(
"received storage degradation machine "
368 static int __init machine_check_init(
void)