linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michal Suchanek <msuchanek@suse.de>
To: "Michael Ellerman" <mpe@ellerman.id.au>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Michal Suchánek" <msuchanek@suse.de>
Cc: Nathan Lynch <nathanl@linux.ibm.com>,
	tyreld@linux.ibm.com, gcwilson@linux.ibm.com,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH RFC] powerpc/rtas: Make it possible to disable sys_rtas
Date: Wed,  6 Sep 2023 14:08:46 +0200	[thread overview]
Message-ID: <20230906120855.28331-1-msuchanek@suse.de> (raw)
In-Reply-To: <20230822-papr-sys_rtas-vs-lockdown-v1-0-932623cf3c7b@linux.ibm.com>

Additional patch suggestion to go with the rtas devices:

-----------------------------------------------------------------------

With most important rtas functions available through different
interfaces the sys_rtas interface can be disabled completely.

Do not remove it for now to make it possible to run older versions of
userspace tools that don't support other interfaces.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
 arch/powerpc/kernel/rtas.c     | 2 ++
 arch/powerpc/platforms/Kconfig | 9 +++++++++
 2 files changed, 11 insertions(+)

diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index eddc031c4b95..5854a8bb5731 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -1684,6 +1684,7 @@ noinstr struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log
 	return NULL;
 }
 
+#ifdef PPC_RTAS_SYSCALL
 /*
  * The sys_rtas syscall, as originally designed, allows root to pass
  * arbitrary physical addresses to RTAS calls. A number of RTAS calls
@@ -1893,6 +1894,7 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs)
 
 	return 0;
 }
+#endif
 
 static void __init rtas_function_table_init(void)
 {
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 1fd253f92a77..9563e38188d5 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -150,6 +150,15 @@ config RTAS_FLASH
 	tristate "Firmware flash interface"
 	depends on PPC64 && RTAS_PROC
 
+config RTAS_SYSCALL
+	bool "Legacy syscall interface to RTAS"
+	depends on PPC_RTAS
+	default y
+	help
+	  Enables support for the legacy sys_rtas interface. Calls that need to
+	  pass data buffers use /dev/mem directly which is not compatible with
+	  lockdown. For now some tools still need this interface to work.
+
 config MMIO_NVRAM
 	bool
 
-- 
2.41.0


  parent reply	other threads:[~2023-09-06 12:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 21:33 [PATCH RFC 0/2] powerpc/pseries: new character devices for RTAS functions Nathan Lynch via B4 Relay
2023-08-22 21:33 ` [PATCH RFC 1/2] powerpc/pseries: papr-vpd char driver for VPD retrieval Nathan Lynch via B4 Relay
2023-08-30  7:29   ` Michal Suchánek
2023-08-31  5:34     ` Michael Ellerman
2023-08-31 10:38       ` Michal Suchánek
2023-08-31 11:37         ` Michael Ellerman
2023-08-31 11:44           ` Michal Suchánek
2023-08-31 17:59             ` Nathan Lynch
2023-09-04  7:20               ` Michal Suchánek
2023-09-05  2:42                 ` Michael Ellerman
2023-09-05  8:24                   ` Michal Suchánek
2023-08-31 11:35       ` Michal Suchánek
2023-09-04  7:48       ` Michal Suchánek
2023-08-31 15:52     ` Nathan Lynch
2023-09-06  9:19   ` Michal Suchánek
2023-08-22 21:33 ` [PATCH RFC 2/2] powerpc/selftests: add test for papr-vpd Nathan Lynch via B4 Relay
2023-08-24  6:20   ` Russell Currey
2023-08-24 11:51     ` Nathan Lynch
2023-09-06  9:30 ` [PATCH RFC 0/2] powerpc/pseries: new character devices for RTAS functions Michal Suchánek
2023-09-06 12:08 ` Michal Suchanek [this message]
2023-09-06 19:34   ` [PATCH RFC] powerpc/rtas: Make it possible to disable sys_rtas Nathan Lynch
2023-09-07 16:01     ` Michal Suchánek
2023-09-07 16:52       ` Nathan Lynch
2023-09-07 17:19         ` Michal Suchánek
2023-09-08 17:48           ` Nathan Lynch

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=20230906120855.28331-1-msuchanek@suse.de \
    --to=msuchanek@suse.de \
    --cc=gcwilson@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nathanl@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=tyreld@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).