summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2019-04-09 23:14:20 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2019-05-03 02:54:56 +1000
commit398af571128fe75f07343f929975b26d57eafd18 (patch)
treea9869d931a7b9dfa79d8f1453f1b87e7a726ffcc /arch/powerpc
parent453d87f6a8aed827f5ebb1708a4cea458fd68d23 (diff)
downloadlwn-398af571128fe75f07343f929975b26d57eafd18.tar.gz
lwn-398af571128fe75f07343f929975b26d57eafd18.zip
powerpc/security: Show powerpc_security_features in debugfs
This can be helpful for debugging problems with the security feature flags, especially on guests where the flags come from the hypervisor via an hcall and so can't be observed in the device tree. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/security.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index b33bafb8fcea..d6ba696d0ed0 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -104,6 +104,14 @@ static __init int barrier_nospec_debugfs_init(void)
return 0;
}
device_initcall(barrier_nospec_debugfs_init);
+
+static __init int security_feature_debugfs_init(void)
+{
+ debugfs_create_x64("security_features", 0400, powerpc_debugfs_root,
+ (u64 *)&powerpc_security_features);
+ return 0;
+}
+device_initcall(security_feature_debugfs_init);
#endif /* CONFIG_DEBUG_FS */
#ifdef CONFIG_PPC_FSL_BOOK3E