/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1#ifndef _UAPI_ASM_X86_MCE_H2#define _UAPI_ASM_X86_MCE_H34#include <linux/types.h>5#include <linux/ioctl.h>67/*8* Fields are zero when not available. Also, this struct is shared with9* userspace mcelog and thus must keep existing fields at current offsets.10* Only add new, shared fields to the end of the structure.11* Do not add vendor-specific fields.12*/13struct mce {14__u64 status; /* Bank's MCi_STATUS MSR */15__u64 misc; /* Bank's MCi_MISC MSR */16__u64 addr; /* Bank's MCi_ADDR MSR */17__u64 mcgstatus; /* Machine Check Global Status MSR */18__u64 ip; /* Instruction Pointer when the error happened */19__u64 tsc; /* CPU time stamp counter */20__u64 time; /* Wall time_t when error was detected */21__u8 cpuvendor; /* Kernel's X86_VENDOR enum */22__u8 inject_flags; /* Software inject flags */23__u8 severity; /* Error severity */24__u8 pad;25__u32 cpuid; /* CPUID 1 EAX */26__u8 cs; /* Code segment */27__u8 bank; /* Machine check bank reporting the error */28__u8 cpu; /* CPU number; obsoleted by extcpu */29__u8 finished; /* Entry is valid */30__u32 extcpu; /* Linux CPU number that detected the error */31__u32 socketid; /* CPU socket ID */32__u32 apicid; /* CPU initial APIC ID */33__u64 mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */34__u64 synd; /* MCA_SYND MSR: only valid on SMCA systems */35__u64 ipid; /* MCA_IPID MSR: only valid on SMCA systems */36__u64 ppin; /* Protected Processor Inventory Number */37__u32 microcode; /* Microcode revision */38__u64 kflags; /* Internal kernel use */39};4041#define MCE_GET_RECORD_LEN _IOR('M', 1, int)42#define MCE_GET_LOG_LEN _IOR('M', 2, int)43#define MCE_GETCLEAR_FLAGS _IOR('M', 3, int)4445#endif /* _UAPI_ASM_X86_MCE_H */464748