powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function
authorKajol Jain <kjain@linux.ibm.com>
Thu, 16 Nov 2023 12:20:32 +0000 (17:50 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 13 Dec 2023 10:05:03 +0000 (21:05 +1100)
commit070b71f428facd9130319707db854ed8bd24637a
tree64d0c687b67524e77d0c574cba7f53993e7c16e5
parent1bdf22580b794a498b17617bcd7ae417d6b78444
powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function

To access hv-gpci kernel interface files data, the
"Enable Performance Information Collection" option has to be set
in hmc. Incase that option is not set and user try to read
the interface files, it should give error message as
operation not permitted.

Result of accessing added interface files with disabled
performance collection option:

[command]# cat processor_bus_topology
cat: processor_bus_topology: Operation not permitted

[command]# cat processor_config
cat: processor_config: Operation not permitted

[command]# cat affinity_domain_via_domain
cat: affinity_domain_via_domain: Operation not permitted

[command]# cat affinity_domain_via_virtual_processor
cat: affinity_domain_via_virtual_processor: Operation not permitted

[command]# cat affinity_domain_via_partition

Based on above result there is no error message when reading
affinity_domain_via_partition file because of missing
check for failed hcall. Fix this issue by adding
a check in the start of affinity_domain_via_partition_show
function, to return error incase hcall fails, with error type
other then H_PARAMETER.

Fixes: a15e0d6a6929 ("powerpc/hv_gpci: Add sysfs file inside hv_gpci device to show affinity domain via partition information")
Reported-by: Disha Goel <disgoel@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/20231116122033.160964-1-kjain@linux.ibm.com
arch/powerpc/perf/hv-gpci.c