RE: [PATCH v6 3/5] x86/mce, EDAC/mce_amd: Add support for new MCA_SYND{1,2} registers
From: "Zhuo, Qiuxu" <qiuxu.zhuo@intel.com>
Date: 2024-10-18 02:24:41
Also in:
linux-edac, lkml
From: Naik, Avadhut <redacted> [...]quoted
__print_dynamic_array(v_data, sizeof(u8))) -QiuxuIIUC, the second parameter above determines how the dynamic array is parsed and logged. The value of 8 means that the array will be traversed with a u64 pointer i.e. data within the array will be logged by the tracepoint in chunks of 8 bytes. Something like below: vendor data: {0x3a726f7461636f4c,0x30434d305020,0x27000003fd} This seems convenient since, AFAIK, MCA registers on x86-64 are of 8 bytes.
So, this is based on the assumption that all vendor data fields are of the u64 type, which may NOT be true for other x86 vendors in the future. In case there is some non-u64 vendor data in the future, the parser would need to break the u64 tracing data into u8 data and then composite the split u8 data into other types like u16 or u32, which seems even inconvenient. IMHO: Printing the u8 tracing data and leaving the vendor-specific tool to parse the u8 data is a more flexible and balanced approach. Maybe Boris and Tony could provide more comments here.
If we use sizeof(u8) (which equates to 1) above, then u8 pointer will be used
for traversing the dynamic array and each byte within the registers will be
logged individually.
Something like below.
vendor data:
{0x4c,0x6f,0x63,0x61,0x74,0x6f,0x72,0x3a,0x20,0x50,0x30,0x4d,0x43,0x30,0x0,
0x0,0xfd,0x3,0x0,0x0,0x27,0x0,0x0,0x0}
Combined with endianness of the processor, this seems somewhat
inconvenient to decipher. Would you agree?x86 is in little-endian, which is consistent across all x86 processors. Endianness should not pose any inconvenience. Thanks! -Qiuxu