LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Suchanek <msuchanek@suse.de>
To: linuxppc-dev@lists.ozlabs.org
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Anthony Steinhauser <asteinhauser@google.com>,
	"Gustavo L. F. Walbon" <gwalbon@linux.ibm.com>,
	"Christopher M. Riedl" <cmr@informatik.wtf>,
	YueHaibing <yuehaibing@huawei.com>,
	linux-kernel@vger.kernel.org,
	Diana Craciun <diana.craciun@nxp.com>,
	Paul Mackerras <paulus@samba.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Michal Suchanek <msuchanek@suse.de>
Subject: [PATCH] powerpc: add link stack flush mitigation status in debugfs.
Date: Wed, 27 Nov 2019 23:09:59 +0100	[thread overview]
Message-ID: <20191127220959.6208-1-msuchanek@suse.de> (raw)

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@suse.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


             reply	other threads:[~2019-11-27 22:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27 22:09 Michal Suchanek [this message]
2022-02-15  5:26 ` [PATCH] powerpc: add link stack flush mitigation status in debugfs Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191127220959.6208-1-msuchanek@suse.de \
    --to=msuchanek@suse.de \
    --cc=asteinhauser@google.com \
    --cc=cmr@informatik.wtf \
    --cc=diana.craciun@nxp.com \
    --cc=geert+renesas@glider.be \
    --cc=gwalbon@linux.ibm.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox