Merge tag 'x86-mm-2021-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 mm update from Ingo Molnar: "Do not create the x86/init_pkru debugfs file if the CPU doesn't support PKRU" * tag 'x86-mm-2021-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/pkeys: Skip 'init_pkru' debugfs file creation when pkeys not supported
This commit is contained in:
@@ -192,6 +192,10 @@ static const struct file_operations fops_init_pkru = {
|
||||
|
||||
static int __init create_init_pkru_value(void)
|
||||
{
|
||||
/* Do not expose the file if pkeys are not supported. */
|
||||
if (!cpu_feature_enabled(X86_FEATURE_OSPKE))
|
||||
return 0;
|
||||
|
||||
debugfs_create_file("init_pkru", S_IRUSR | S_IWUSR,
|
||||
arch_debugfs_dir, NULL, &fops_init_pkru);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user