powerpc/hv_gpci: Add sysfs file inside hv_gpci device to show processor config inform...
authorKajol Jain <kjain@linux.ibm.com>
Sat, 29 Jul 2023 07:34:48 +0000 (13:04 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 16 Aug 2023 13:54:49 +0000 (23:54 +1000)
commit1a160c2a13c66c9ad47436e73c821f3d26818733
tree19b4549ccf56fe9faa79893ca6d742fc7831eea7
parent9caf9e2b8bae58e39501f6fb1fc9189009538ccc
powerpc/hv_gpci: Add sysfs file inside hv_gpci device to show processor config information

The hcall H_GET_PERF_COUNTER_INFO with counter request value as
PROCESSOR_CONFIG(0X90), can be used to get the system
processor configuration information. To expose the system
processor config information, patch adds sysfs file called
"processor_config" to the "/sys/devices/hv_gpci/interface/"
of hv_gpci pmu driver.

Add enum and sysinfo_counter_request array to get required
counter request value in hv-gpci.c file.
Also add a new function called "sysinfo_device_attr_create",
which will create and return required device attribute to the
add_sysinfo_interface_files function.

The processor_config sysfs file is only available for power10
and above platforms. Add a new macro called
INTERFACE_PROCESSOR_CONFIG_ATTR, which points to the index of
NULL placefolder, for processor_config attribute in the interface_attrs
array. Also add macro INTERFACE_NULL_ATTR which points to index of NULL
attribute in interface_attrs array.

Reviewed-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230729073455.7918-4-kjain@linux.ibm.com
arch/powerpc/perf/hv-gpci.c