coresight: etm4x: Hide sysfs attributes for unavailable registers
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 1 Feb 2021 18:13:34 +0000 (11:13 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Feb 2021 16:00:33 +0000 (17:00 +0100)
commit91b9f018548747dfa6d543d74dfe59a8c6e9be7e
tree82ca03404588e5fe7255817a4bf130e3f882e5da
parent03336d0f4d0d74e7a5f899bf9d4933e0d4397c94
coresight: etm4x: Hide sysfs attributes for unavailable registers

Some of the management registers in ETMv4.x are not accessible
via system register instructions. Thus we must hide the sysfs
files exposing them to the userspace, to prevent system crashes.

This patch adds an is_visible() routine to control the visibility
at runtime for the registers that may not be accessed.

Link: https://lore.kernel.org/r/20210110224850.1880240-13-suzuki.poulose@arm.com
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20210201181351.1475223-15-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-etm4x-sysfs.c
drivers/hwtracing/coresight/coresight-etm4x.h