Skip to content

Commit c134f0d

Browse files
cyrilbur-ibmmpe
authored andcommitted
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]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 694a20d commit c134f0d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/powerpc/kernel/sysfs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,8 @@ static int register_cpu_online(unsigned int cpu)
788788
if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
789789
device_create_file(s, &dev_attr_pir);
790790

791-
if (cpu_has_feature(CPU_FTR_ARCH_206))
791+
if (cpu_has_feature(CPU_FTR_ARCH_206) &&
792+
!firmware_has_feature(FW_FEATURE_LPAR))
792793
device_create_file(s, &dev_attr_tscr);
793794
#endif /* CONFIG_PPC64 */
794795

@@ -873,7 +874,8 @@ static int unregister_cpu_online(unsigned int cpu)
873874
if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
874875
device_remove_file(s, &dev_attr_pir);
875876

876-
if (cpu_has_feature(CPU_FTR_ARCH_206))
877+
if (cpu_has_feature(CPU_FTR_ARCH_206) &&
878+
!firmware_has_feature(FW_FEATURE_LPAR))
877879
device_remove_file(s, &dev_attr_tscr);
878880
#endif /* CONFIG_PPC64 */
879881

0 commit comments

Comments
 (0)