[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY8PR11MB71346E0906C0540C998730DD89402@CY8PR11MB7134.namprd11.prod.outlook.com>
Date: Fri, 18 Oct 2024 02:24:37 +0000
From: "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>
To: "Naik, Avadhut" <avadnaik@....com>, "x86@...nel.org" <x86@...nel.org>,
"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
"linux-trace-kernel@...r.kernel.org" <linux-trace-kernel@...r.kernel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"bp@...en8.de" <bp@...en8.de>, "Luck, Tony" <tony.luck@...el.com>,
"tglx@...utronix.de" <tglx@...utronix.de>, "mingo@...hat.com"
<mingo@...hat.com>, "rostedt@...dmis.org" <rostedt@...dmis.org>,
"mchehab@...nel.org" <mchehab@...nel.org>, "yazen.ghannam@....com"
<yazen.ghannam@....com>, "john.allen@....com" <john.allen@....com>, "Avadhut
Naik" <avadhut.naik@....com>
Subject: RE: [PATCH v6 3/5] x86/mce, EDAC/mce_amd: Add support for new
MCA_SYND{1,2} registers
> From: Naik, Avadhut <avadnaik@....com>
> [...]
> > __print_dynamic_array(v_data, sizeof(u8)))
> >
> > -Qiuxu
> >
> IIUC, 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
Powered by blists - more mailing lists