linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Li Yang <leoli@freescale.com>
To: benh@kernel.crashing.org, galak@gate.crashing.org
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] powerpc: fix ioremap_flags() with book3e pte definition
Date: Fri,  5 Feb 2010 00:53:02 +0800	[thread overview]
Message-ID: <1265302382-15142-1-git-send-email-leoli@freescale.com> (raw)

We can't just clear the user read permission in book3e pte, because
that will also clear supervisor read permission.  This surely isn't
desired.  Fix the problem by adding the supervisor read back.

Signed-off-by: Li Yang <leoli@freescale.com>
---
 arch/powerpc/mm/pgtable_32.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index cb96cb2..aff7c04 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -144,6 +144,11 @@ ioremap_flags(phys_addr_t addr, unsigned long size, unsigned long flags)
 	/* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */
 	flags &= ~(_PAGE_USER | _PAGE_EXEC);
 
+#if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_PTE_64BIT)
+	/* supervisor read permission has just been cleared, add back */
+	flags |= _PAGE_BAP_SR;
+#endif
+
 	return __ioremap_caller(addr, size, flags, __builtin_return_address(0));
 }
 EXPORT_SYMBOL(ioremap_flags);
-- 
1.6.6-rc1.GIT

             reply	other threads:[~2010-02-04 16:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-04 16:53 Li Yang [this message]
2010-02-08  4:21 ` [PATCH] powerpc: fix ioremap_flags() with book3e pte definition Benjamin Herrenschmidt
2010-05-14 17:57   ` Kumar Gala
  -- strict thread matches above, loose matches on Subject: below --
2010-05-24 18:38 [PATCH] powerpc: Fix " Kumar Gala
2010-06-02 21:59 ` Kumar Gala
2010-06-02 22:02   ` Greg KH

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=1265302382-15142-1-git-send-email-leoli@freescale.com \
    --to=leoli@freescale.com \
    --cc=benh@kernel.crashing.org \
    --cc=galak@gate.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    /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).