Skip to content

Commit b2a6f60

Browse files
hramrachmpe
authored andcommitted
powerpc: add link stack flush mitigation status in debugfs.
The link stack flush status is not visible in debugfs. It can be enabled even when count cache flush is disabled. Add separate file for its status. Signed-off-by: Michal Suchanek <[email protected]> [mpe: Update for change to link_stack_flush_type] Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 279d1a7 commit b2a6f60

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

arch/powerpc/kernel/security.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,14 +747,29 @@ static int count_cache_flush_get(void *data, u64 *val)
747747
return 0;
748748
}
749749

750+
static int link_stack_flush_get(void *data, u64 *val)
751+
{
752+
if (link_stack_flush_type == BRANCH_CACHE_FLUSH_NONE)
753+
*val = 0;
754+
else
755+
*val = 1;
756+
757+
return 0;
758+
}
759+
750760
DEFINE_DEBUGFS_ATTRIBUTE(fops_count_cache_flush, count_cache_flush_get,
751761
count_cache_flush_set, "%llu\n");
762+
DEFINE_DEBUGFS_ATTRIBUTE(fops_link_stack_flush, link_stack_flush_get,
763+
count_cache_flush_set, "%llu\n");
752764

753765
static __init int count_cache_flush_debugfs_init(void)
754766
{
755767
debugfs_create_file_unsafe("count_cache_flush", 0600,
756768
arch_debugfs_dir, NULL,
757769
&fops_count_cache_flush);
770+
debugfs_create_file_unsafe("link_stack_flush", 0600,
771+
arch_debugfs_dir, NULL,
772+
&fops_link_stack_flush);
758773
return 0;
759774
}
760775
device_initcall(count_cache_flush_debugfs_init);

0 commit comments

Comments
 (0)