From c13ff6f3251318f5e1ff5b1a6d05f76996db672a Mon Sep 17 00:00:00 2001 From: Nathan Lynch Date: Thu, 8 Apr 2021 09:06:26 -0500 Subject: powerpc/rtas: improve ppc_rtas_rmo_buf_show documentation Add kerneldoc for ppc_rtas_rmo_buf_show(), the callback for /proc/powerpc/rtas/rmo_buffer, explaining its expected use. Signed-off-by: Nathan Lynch Reviewed-by: Alexey Kardashevskiy Reviewed-by: Andrew Donnellan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210408140630.205502-2-nathanl@linux.ibm.com --- arch/powerpc/kernel/rtas-proc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'arch/powerpc/kernel/rtas-proc.c') diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c index 2d33f342a293..e0f8329966d6 100644 --- a/arch/powerpc/kernel/rtas-proc.c +++ b/arch/powerpc/kernel/rtas-proc.c @@ -757,7 +757,16 @@ static int ppc_rtas_tone_volume_show(struct seq_file *m, void *v) #define RMO_READ_BUF_MAX 30 -/* RTAS Userspace access */ +/** + * ppc_rtas_rmo_buf_show() - Describe RTAS-addressable region for user space. + * + * Base + size description of a range of RTAS-addressable memory set + * aside for user space to use as work area(s) for certain RTAS + * functions. User space accesses this region via /dev/mem. Apart from + * security policies, the kernel does not arbitrate or serialize + * access to this region, and user space must ensure that concurrent + * users do not interfere with each other. + */ static int ppc_rtas_rmo_buf_show(struct seq_file *m, void *v) { seq_printf(m, "%016lx %x\n", rtas_rmo_buf, RTAS_RMOBUF_MAX); -- cgit v1.2.3 From 01c1b9984a12a379f332c39c4b1fd96e473b93b0 Mon Sep 17 00:00:00 2001 From: Nathan Lynch Date: Thu, 8 Apr 2021 09:06:27 -0500 Subject: powerpc/rtas-proc: remove unused RMO_READ_BUF_MAX This constant is unused. Signed-off-by: Nathan Lynch Reviewed-by: Alexey Kardashevskiy Reviewed-by: Andrew Donnellan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210408140630.205502-3-nathanl@linux.ibm.com --- arch/powerpc/kernel/rtas-proc.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/powerpc/kernel/rtas-proc.c') diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c index e0f8329966d6..d2b0d99824a4 100644 --- a/arch/powerpc/kernel/rtas-proc.c +++ b/arch/powerpc/kernel/rtas-proc.c @@ -755,8 +755,6 @@ static int ppc_rtas_tone_volume_show(struct seq_file *m, void *v) return 0; } -#define RMO_READ_BUF_MAX 30 - /** * ppc_rtas_rmo_buf_show() - Describe RTAS-addressable region for user space. * -- cgit v1.2.3 From e5d56763525e65417dad0d46572b234fa0008e40 Mon Sep 17 00:00:00 2001 From: Nathan Lynch Date: Thu, 8 Apr 2021 09:06:30 -0500 Subject: powerpc/rtas: rename RTAS_RMOBUF_MAX to RTAS_USER_REGION_SIZE RTAS_RMOBUF_MAX doesn't actually describe a "maximum" value in any sense. It represents the size of an area of memory set aside for user space to use as work areas for certain RTAS calls. Rename it to RTAS_USER_REGION_SIZE. Signed-off-by: Nathan Lynch Reviewed-by: Andrew Donnellan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210408140630.205502-6-nathanl@linux.ibm.com --- arch/powerpc/kernel/rtas-proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/powerpc/kernel/rtas-proc.c') diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c index d2b0d99824a4..6857a5b0a1c3 100644 --- a/arch/powerpc/kernel/rtas-proc.c +++ b/arch/powerpc/kernel/rtas-proc.c @@ -767,6 +767,6 @@ static int ppc_rtas_tone_volume_show(struct seq_file *m, void *v) */ static int ppc_rtas_rmo_buf_show(struct seq_file *m, void *v) { - seq_printf(m, "%016lx %x\n", rtas_rmo_buf, RTAS_RMOBUF_MAX); + seq_printf(m, "%016lx %x\n", rtas_rmo_buf, RTAS_USER_REGION_SIZE); return 0; } -- cgit v1.2.3