OSDN Git Service

powerpc/security: Show powerpc_security_features in debugfs
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 9 Apr 2019 13:14:20 +0000 (23:14 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 2 May 2019 16:54:56 +0000 (02:54 +1000)
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>
arch/powerpc/kernel/security.c

index b33bafb..d6ba696 100644 (file)
@@ -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