Commit b2a6f604 authored by Michal Suchanek's avatar Michal Suchanek Committed by Michael Ellerman

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: default avatarMichal Suchanek <msuchanek@suse.de>
[mpe: Update for change to link_stack_flush_type]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191127220959.6208-1-msuchanek@suse.de
parent 279d1a72
...@@ -747,14 +747,29 @@ static int count_cache_flush_get(void *data, u64 *val) ...@@ -747,14 +747,29 @@ static int count_cache_flush_get(void *data, u64 *val)
return 0; return 0;
} }
static int link_stack_flush_get(void *data, u64 *val)
{
if (link_stack_flush_type == BRANCH_CACHE_FLUSH_NONE)
*val = 0;
else
*val = 1;
return 0;
}
DEFINE_DEBUGFS_ATTRIBUTE(fops_count_cache_flush, count_cache_flush_get, DEFINE_DEBUGFS_ATTRIBUTE(fops_count_cache_flush, count_cache_flush_get,
count_cache_flush_set, "%llu\n"); count_cache_flush_set, "%llu\n");
DEFINE_DEBUGFS_ATTRIBUTE(fops_link_stack_flush, link_stack_flush_get,
count_cache_flush_set, "%llu\n");
static __init int count_cache_flush_debugfs_init(void) static __init int count_cache_flush_debugfs_init(void)
{ {
debugfs_create_file_unsafe("count_cache_flush", 0600, debugfs_create_file_unsafe("count_cache_flush", 0600,
arch_debugfs_dir, NULL, arch_debugfs_dir, NULL,
&fops_count_cache_flush); &fops_count_cache_flush);
debugfs_create_file_unsafe("link_stack_flush", 0600,
arch_debugfs_dir, NULL,
&fops_link_stack_flush);
return 0; return 0;
} }
device_initcall(count_cache_flush_debugfs_init); device_initcall(count_cache_flush_debugfs_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment