powerpc: Expose TSCR via sysfs only on powernv
PATCH 1/1 powerpc: Expose TSCR via sysfs only on powernv
The TSCR can only be accessed in hypervisor mode.
Fixes 88b5e12eeb11 ("powerpc: Expose TSCR via sysfs")
Signed-off-by Cyril Bur <[email protected]>
--- arch/powerpc/kernel/sysfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/powerpc/kernel/sysfs.c +4 -2
@@ -788,7 +788,8 @@ static int register_cpu_online(unsigned int cpu)if (cpu_has_feature (CPU_FTR_PPCAS_ARCH_V2 ))device_create_file (s, &dev_attr_pir); -if (cpu_has_feature (CPU_FTR_ARCH_206 )) +if (cpu_has_feature (CPU_FTR_ARCH_206 ) && + !firmware_has_feature (FW_FEATURE_LPAR ))device_create_file (s, &dev_attr_tscr);#endif /* CONFIG_PPC64 */
@@ -873,7 +874,8 @@ static int unregister_cpu_online(unsigned int cpu)if (cpu_has_feature (CPU_FTR_PPCAS_ARCH_V2 ))device_remove_file (s, &dev_attr_pir); -if (cpu_has_feature (CPU_FTR_ARCH_206 )) +if (cpu_has_feature (CPU_FTR_ARCH_206 ) && + !firmware_has_feature (FW_FEATURE_LPAR ))device_remove_file (s, &dev_attr_tscr);#endif /* CONFIG_PPC64 */
Signature · 1 line
2.16.1
Michael Ellerman
AppliedQuoted 4 lines · Cyril Bur
The TSCR can only be accessed in hypervisor mode.
Fixes 88b5e12eeb11 ("powerpc: Expose TSCR via sysfs")Signed-off-by Cyril Bur <[email protected]>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/c134f0d57a47b7f8704dee1cefc246
cheers