From: Daniel J Blueman <daniel.blueman@quadrics.com>
To: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
marcelo.tosatti@cyclades.com
Subject: pte_modify fix backport...
Date: Thu, 05 Aug 2004 11:13:51 +0000 [thread overview]
Message-ID: <1091704431.1829.235.camel@pc107.quadrics.com> (raw)
This patch [1] corrects the behaviour of pte_modify() on ia64 to not
clear page protection flags it shouldn't touch.
Without this patch, it clears the uncacheable flag on UC memory regions,
which can cause MCAs with device I/O.
It was taken into 2.6.0 a while ago, but is yet to be included in 2.4 -
the patch here is rediffed against 2.4.26-rc5.
Is there chance of it being taken in?
--- [1]
diff -durN linux-2.4.26-rc5-orig/include/asm-ia64/pgtable.h linux-2.4.26-rc5-patched/include/asm-ia64/pgtable.h
--- linux-2.4.26-rc5-orig/include/asm-ia64/pgtable.h 2004-02-18 13:36:32.000000000 +0000
+++ linux-2.4.26-rc5-patched/include/asm-ia64/pgtable.h 2004-08-05 11:46:03.000000000 +0100
@@ -60,7 +60,8 @@
#define _PAGE_PROTNONE (__IA64_UL(1) << 63)
#define _PFN_MASK _PAGE_PPN_MASK
-#define _PAGE_CHG_MASK (_PFN_MASK | _PAGE_A | _PAGE_D)
+/* Mask of bits which may be changed by pte_modify(); the odd bits are there for _PAGE_PROTNONE */
+#define _PAGE_CHG_MASK (_PAGE_P | _PAGE_PROTNONE | _PAGE_PL_MASK | _PAGE_AR_MASK | _PAGE_ED)
#define _PAGE_SIZE_4K 12
#define _PAGE_SIZE_8K 13
@@ -216,7 +217,7 @@
({ pte_t __pte; pte_val(__pte) = physpage + pgprot_val(pgprot); __pte; })
#define pte_modify(_pte, newprot) \
- (__pte((pte_val(_pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)))
+ (__pte((pte_val(_pte) & ~_PAGE_CHG_MASK) | (pgprot_val(newprot) & _PAGE_CHG_MASK)))
#define page_pte_prot(page,prot) mk_pte(page, prot)
#define page_pte(page) page_pte_prot(page, __pgprot(0))
--
Daniel J Blueman
Software Engineer, Quadrics Ltd
next reply other threads:[~2004-08-05 11:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-05 11:13 Daniel J Blueman [this message]
2004-08-05 15:56 ` pte_modify fix backport Bjorn Helgaas
2004-08-05 16:21 ` Daniel J Blueman
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=1091704431.1829.235.camel@pc107.quadrics.com \
--to=daniel.blueman@quadrics.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.tosatti@cyclades.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