linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/mm: Allow user space to map rtas_rmo_buf
@ 2016-01-21 16:15 Vasant Hegde
  2016-01-21 16:32 ` Dan Williams
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Vasant Hegde @ 2016-01-21 16:15 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: Vasant Hegde, Dan Williams, Nathan Fontenot, Michael Ellerman

With commit 90a545e9 (restrict /dev/mem to idle io memory ranges) mapping
rtas_rmo_buf from user space is failing. Hence we are not able to make
RTAS syscall.

This patch calls page_is_rtas_user_buf before calling iomem_is_exclusive
in  devmem_is_allowed(). This will allow user space to map rtas_rmo_buf
and we are able to make RTAS syscall.

Reported-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
CC: Dan Williams <dan.j.williams@intel.com>
CC: Nathan Fontenot <nfont@linux.vnet.ibm.com>
CC: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 arch/powerpc/mm/mem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 22d94c3..d0f0a51 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -560,12 +560,12 @@ subsys_initcall(add_system_ram_resources);
  */
 int devmem_is_allowed(unsigned long pfn)
 {
+	if (page_is_rtas_user_buf(pfn))
+		return 1;
 	if (iomem_is_exclusive(PFN_PHYS(pfn)))
 		return 0;
 	if (!page_is_ram(pfn))
 		return 1;
-	if (page_is_rtas_user_buf(pfn))
-		return 1;
 	return 0;
 }
 #endif /* CONFIG_STRICT_DEVMEM */
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-29  1:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-21 16:15 [PATCH] powerpc/mm: Allow user space to map rtas_rmo_buf Vasant Hegde
2016-01-21 16:32 ` Dan Williams
2016-01-22  5:29 ` Michael Ellerman
2016-01-22  6:28   ` Vasant Hegde
2016-01-22  8:35     ` Michael Ellerman
2016-01-22 10:41       ` Denis Kirjanov
2016-01-25 18:42         ` Nathan Fontenot
2016-01-25 18:42       ` Nathan Fontenot
2016-01-29  1:58 ` Michael Ellerman

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).