All of lore.kernel.org
 help / color / mirror / Atom feed
* pte_modify fix backport...
@ 2004-08-05 11:13 ` Daniel J Blueman
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel J Blueman @ 2004-08-05 11:13 UTC (permalink / raw)
  To: linux-ia64, linux-kernel, marcelo.tosatti

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


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

* pte_modify fix backport...
@ 2004-08-05 11:13 ` Daniel J Blueman
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel J Blueman @ 2004-08-05 11:13 UTC (permalink / raw)
  To: linux-ia64, linux-kernel, marcelo.tosatti

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


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

* Re: pte_modify fix backport...
  2004-08-05 11:13 ` Daniel J Blueman
@ 2004-08-05 15:56   ` Bjorn Helgaas
  -1 siblings, 0 replies; 6+ messages in thread
From: Bjorn Helgaas @ 2004-08-05 15:56 UTC (permalink / raw)
  To: Daniel J Blueman; +Cc: linux-ia64, linux-kernel, marcelo.tosatti

On Thursday 05 August 2004 5:13 am, Daniel J Blueman wrote:
> 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?

I put this in the 2.4 ia64 BK tree a couple days ago.  Can you check
here: http://lia64.bkbits.net:8080/linux-ia64-2.4 and make sure that
it works for you?

The plain patch is also available here, if that works better for you:
ftp://ftp.kernel.org/pub/linux/kernel/ports/ia64/v2.4/testing/cset/index.html

> 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

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

* Re: pte_modify fix backport...
@ 2004-08-05 15:56   ` Bjorn Helgaas
  0 siblings, 0 replies; 6+ messages in thread
From: Bjorn Helgaas @ 2004-08-05 15:56 UTC (permalink / raw)
  To: Daniel J Blueman; +Cc: linux-ia64, linux-kernel, marcelo.tosatti

On Thursday 05 August 2004 5:13 am, Daniel J Blueman wrote:
> 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?

I put this in the 2.4 ia64 BK tree a couple days ago.  Can you check
here: http://lia64.bkbits.net:8080/linux-ia64-2.4 and make sure that
it works for you?

The plain patch is also available here, if that works better for you:
ftp://ftp.kernel.org/pub/linux/kernel/ports/ia64/v2.4/testing/cset/index.html

> 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

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

* Re: pte_modify fix backport...
  2004-08-05 15:56   ` Bjorn Helgaas
@ 2004-08-05 16:21     ` Daniel J Blueman
  -1 siblings, 0 replies; 6+ messages in thread
From: Daniel J Blueman @ 2004-08-05 16:21 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-ia64, linux-kernel, marcelo.tosatti

On Thu, 2004-08-05 at 16:56, Bjorn Helgaas wrote:
> On Thursday 05 August 2004 5:13 am, Daniel J Blueman wrote:
> > 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?
> 
> I put this in the 2.4 ia64 BK tree a couple days ago.  Can you check
> here: http://lia64.bkbits.net:8080/linux-ia64-2.4 and make sure that
> it works for you?
> 
> The plain patch is also available here, if that works better for you:
> ftp://ftp.kernel.org/pub/linux/kernel/ports/ia64/v2.4/testing/cset/index.html
> 
> > 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))

Bjorn,

The two changesets are good. Thanks!
-- 
Daniel J Blueman
Software Engineer, Quadrics Ltd


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

* Re: pte_modify fix backport...
@ 2004-08-05 16:21     ` Daniel J Blueman
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel J Blueman @ 2004-08-05 16:21 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-ia64, linux-kernel, marcelo.tosatti

On Thu, 2004-08-05 at 16:56, Bjorn Helgaas wrote:
> On Thursday 05 August 2004 5:13 am, Daniel J Blueman wrote:
> > 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?
> 
> I put this in the 2.4 ia64 BK tree a couple days ago.  Can you check
> here: http://lia64.bkbits.net:8080/linux-ia64-2.4 and make sure that
> it works for you?
> 
> The plain patch is also available here, if that works better for you:
> ftp://ftp.kernel.org/pub/linux/kernel/ports/ia64/v2.4/testing/cset/index.html
> 
> > 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))

Bjorn,

The two changesets are good. Thanks!
-- 
Daniel J Blueman
Software Engineer, Quadrics Ltd


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

end of thread, other threads:[~2004-08-05 16:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-05 11:13 pte_modify fix backport Daniel J Blueman
2004-08-05 11:13 ` Daniel J Blueman
2004-08-05 15:56 ` Bjorn Helgaas
2004-08-05 15:56   ` Bjorn Helgaas
2004-08-05 16:21   ` Daniel J Blueman
2004-08-05 16:21     ` Daniel J Blueman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.