linux/include/trace
Avadhut Naik 750fd23926 x86/mce: Add wrapper for struct mce to export vendor specific info
Currently, exporting new additional machine check error information
involves adding new fields for the same at the end of the struct mce.
This additional information can then be consumed through mcelog or
tracepoint.

However, as new MSRs are being added (and will be added in the future)
by CPU vendors on their newer CPUs with additional machine check error
information to be exported, the size of struct mce will balloon on some
CPUs, unnecessarily, since those fields are vendor-specific. Moreover,
different CPU vendors may export the additional information in varying
sizes.

The problem particularly intensifies since struct mce is exposed to
userspace as part of UAPI. It's bloating through vendor-specific data
should be avoided to limit the information being sent out to userspace.

Add a new structure mce_hw_err to wrap the existing struct mce. The same
will prevent its ballooning since vendor-specifc data, if any, can now be
exported through a union within the wrapper structure and through
__dynamic_array in mce_record tracepoint.

Furthermore, new internal kernel fields can be added to the wrapper
struct without impacting the user space API.

  [ bp: Restore reverse x-mas tree order of function vars declarations. ]

Suggested-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Link: https://lore.kernel.org/r/20241022194158.110073-2-avadhut.naik@amd.com
2024-10-30 17:18:59 +01:00
..
events x86/mce: Add wrapper for struct mce to export vendor specific info 2024-10-30 17:18:59 +01:00
misc NFS: trace: show TIMEDOUT instead of 0x6e 2024-09-01 10:04:55 -04:00
stages tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
bpf_probe.h bpf: pass whole link instead of prog when triggering raw tracepoint 2024-03-19 23:05:33 -07:00
define_custom_trace.h
define_trace.h
perf.h perf/tracing: Use stage6 of tracing to not duplicate macros 2023-01-25 10:31:24 -05:00
syscall.h
trace_custom_events.h
trace_events.h