Re: [PATCH V2 1/8] perf/x86/uncore: Save the unit control address of all units

From: Liang, Kan
Date: Mon Jun 17 2024 - 13:51:40 EST




On 2024-06-17 11:50 a.m., Peter Zijlstra wrote:
> On Fri, Jun 14, 2024 at 06:46:24AM -0700, kan.liang@xxxxxxxxxxxxxxx wrote:
>> From: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
>>
>> The unit control address of some CXL units may be wrongly calculated
>> under some configuration on a EMR machine.
>>
>> The current implementation only saves the unit control address of the
>> units from the first die, and the first unit of the rest of dies. Perf
>> assumed that the units from the other dies have the same offset as the
>> first die. So the unit control address of the rest of the units can be
>> calculated. However, the assumption is wrong, especially for the CXL
>> units.
>
> Oh gawd, that's terrible. Was this actually specified, or are we hacking
> around a firmware fail?

Not a workaround for a firmware fail. The the CXL discovery units depend
on the stacks and CXL devices present on each socket. So different
number of CXL devices on each socket is a valid combination.
SW cannot calculate the address of the devices on the other sockets via
the first socket. Full addresses have to be used.

Thanks,
Kan