1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 /* 3 * Machine check handler definitions 4 * 5 * Copyright IBM Corp. 2000, 2009 6 * Author(s): Ingo Adlung <adlung@de.ibm.co 7 * Martin Schwidefsky <schwidefs 8 * Cornelia Huck <cornelia.huck@ 9 */ 10 11 #ifndef _ASM_S390_NMI_H 12 #define _ASM_S390_NMI_H 13 14 #include <linux/bits.h> 15 #include <linux/types.h> 16 17 #define MCIC_SUBCLASS_MASK (1ULL<<63 | 1U 18 1ULL<<59 | 1UL 19 1ULL<<55 | 1UL 20 1ULL<<52 | 1UL 21 1ULL<<45 | 1UL 22 #define MCCK_CODE_SYSTEM_DAMAGE BIT(63 23 #define MCCK_CODE_EXT_DAMAGE BIT(63 24 #define MCCK_CODE_CP BIT(63 25 #define MCCK_CODE_STG_ERROR BIT(63 26 #define MCCK_CODE_STG_KEY_ERROR BIT(63 27 #define MCCK_CODE_STG_DEGRAD BIT(63 28 #define MCCK_CODE_PSW_MWP_VALID BIT(63 29 #define MCCK_CODE_PSW_IA_VALID BIT(63 30 #define MCCK_CODE_STG_FAIL_ADDR BIT(63 31 #define MCCK_CODE_CR_VALID BIT(63 32 #define MCCK_CODE_GS_VALID BIT(63 33 #define MCCK_CODE_FC_VALID BIT(63 34 #define MCCK_CODE_CPU_TIMER_VALID BIT(63 35 36 #ifndef __ASSEMBLY__ 37 38 union mci { 39 unsigned long val; 40 struct { 41 u64 sd : 1; /* 00 system dama 42 u64 pd : 1; /* 01 instruction 43 u64 sr : 1; /* 02 system reco 44 u64 : 1; /* 03 */ 45 u64 cd : 1; /* 04 timing-faci 46 u64 ed : 1; /* 05 external da 47 u64 : 1; /* 06 */ 48 u64 dg : 1; /* 07 degradation 49 u64 w : 1; /* 08 warning pen 50 u64 cp : 1; /* 09 channel-rep 51 u64 sp : 1; /* 10 service-pro 52 u64 ck : 1; /* 11 channel-sub 53 u64 : 2; /* 12-13 */ 54 u64 b : 1; /* 14 backed up * 55 u64 : 1; /* 15 */ 56 u64 se : 1; /* 16 storage err 57 u64 sc : 1; /* 17 storage err 58 u64 ke : 1; /* 18 storage-key 59 u64 ds : 1; /* 19 storage deg 60 u64 wp : 1; /* 20 psw mwp val 61 u64 ms : 1; /* 21 psw mask an 62 u64 pm : 1; /* 22 psw program 63 u64 ia : 1; /* 23 psw instruc 64 u64 fa : 1; /* 24 failing sto 65 u64 vr : 1; /* 25 vector regi 66 u64 ec : 1; /* 26 external da 67 u64 fp : 1; /* 27 floating po 68 u64 gr : 1; /* 28 general reg 69 u64 cr : 1; /* 29 control reg 70 u64 : 1; /* 30 */ 71 u64 st : 1; /* 31 storage log 72 u64 ie : 1; /* 32 indirect st 73 u64 ar : 1; /* 33 access regi 74 u64 da : 1; /* 34 delayed acc 75 u64 : 1; /* 35 */ 76 u64 gs : 1; /* 36 guarded sto 77 u64 : 5; /* 37-41 */ 78 u64 pr : 1; /* 42 tod program 79 u64 fc : 1; /* 43 fp control 80 u64 ap : 1; /* 44 ancillary r 81 u64 : 1; /* 45 */ 82 u64 ct : 1; /* 46 cpu timer v 83 u64 cc : 1; /* 47 clock compa 84 u64 : 16; /* 47-63 */ 85 }; 86 }; 87 88 #define MCESA_ORIGIN_MASK (~0x3ffUL) 89 #define MCESA_LC_MASK (0xfUL) 90 #define MCESA_MIN_SIZE (1024) 91 #define MCESA_MAX_SIZE (2048) 92 93 struct mcesa { 94 u8 vector_save_area[1024]; 95 u8 guarded_storage_save_area[32]; 96 }; 97 98 struct pt_regs; 99 100 void nmi_alloc_mcesa_early(u64 *mcesad); 101 int nmi_alloc_mcesa(u64 *mcesad); 102 void nmi_free_mcesa(u64 *mcesad); 103 104 void s390_handle_mcck(void); 105 void s390_do_machine_check(struct pt_regs *reg 106 107 #endif /* __ASSEMBLY__ */ 108 #endif /* _ASM_S390_NMI_H */ 109
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.