[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191127220959.6208-1-msuchanek@suse.de>
Date: Wed, 27 Nov 2019 23:09:59 +0100
From: Michal Suchanek <msuchanek@...e.de>
To: linuxppc-dev@...ts.ozlabs.org
Cc: Michal Suchanek <msuchanek@...e.de>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Michael Ellerman <mpe@...erman.id.au>,
Diana Craciun <diana.craciun@....com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Anthony Steinhauser <asteinhauser@...gle.com>,
"Gustavo L. F. Walbon" <gwalbon@...ux.ibm.com>,
YueHaibing <yuehaibing@...wei.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
"Christopher M. Riedl" <cmr@...ormatik.wtf>,
linux-kernel@...r.kernel.org
Subject: [PATCH] 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 <msuchanek@...e.de>
---
arch/powerpc/kernel/security.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index 7d4b2080a658..56dce4798a4d 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -446,14 +446,26 @@ static int count_cache_flush_get(void *data, u64 *val)
return 0;
}
+static int link_stack_flush_get(void *data, u64 *val)
+{
+ *val = link_stack_flush_enabled;
+
+ return 0;
+}
+
DEFINE_DEBUGFS_ATTRIBUTE(fops_count_cache_flush, count_cache_flush_get,
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)
{
debugfs_create_file_unsafe("count_cache_flush", 0600,
powerpc_debugfs_root, NULL,
&fops_count_cache_flush);
+ debugfs_create_file_unsafe("link_stack_flush", 0600,
+ powerpc_debugfs_root, NULL,
+ &fops_link_stack_flush);
return 0;
}
device_initcall(count_cache_flush_debugfs_init);
--
2.23.0
Powered by blists - more mailing lists