Subject: RE: remap_page_range problem with 2.2.5

From: "Eric Thomas (EUS)" <[email-masked]>
Date: Mon, 19 Apr 1999 22:25:25 +0200

> >remap_page_range(0xD1000000, 0xc0104000, 0x4D000,
> >	__pgprot(PTE_TYPE_SMALL | PTE_AP_WRITE))
> 
> You probably need to change the access permissions there 
> because of the new 
> PTE-handling code.  At a guess you now want (_L_PTE_DEFAULT | 
> L_PTE_DIRTY | 
> L_PTE_WRITE) or something like that.  You could possibly 
> write that as 
> (PAGE_KERNEL & ~(PTE_BUFFERABLE | PTE_CACHEABLE)) to avoid 
> exposing quite so 
> many of the implementation details.
> 
> See include/asm-arm/proc-armv/pgtable.h for the low-down.  
> 
> p.
> 
Thanks, that fixed it.  

Eric
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Tue, 20 Apr 1999 19:39:35 +0100 (BST)

Eric Thomas writes:
> > L_PTE_DIRTY | L_PTE_WRITE) or something like that.  You could
> > possibly write that as (PAGE_KERNEL & ~(PTE_BUFFERABLE | PTE_CACHEABLE))
> > to avoid exposing quite so many of the implementation details.
>
> Thanks, that fixed it.  

Oh no it hasn't.  Unfortunately, Phil has misled you here.

PTE_* macros are no longer valid names to be used outside the header
files and the small assembler fragments that live in arch/arm/mm.

_L_PTE_* macros are not to be used outside the pgtable.h header file.

The correct macros to use are the L_PTE_* macros, and the PAGE_* macros.

However, having said that, I note that there is a very big mistake in
your original message - PTE_TYPE_SMALL.  This should not, under any
circumstance be passed into any routine.  The only valid macros you
should be using for the pagetable stuff are the L_PTE_* macros, and
maybe at a far shot the PMD_* macros.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: [email-masked]
Date: Tue, 20 Apr 1999 17:03:59 -0400

> The correct macros to use are the L_PTE_* macros, and the

PAGE_KERNEL, type pgprot_t, is a struct which prevents me from doing
PAGE_KERNEL & (~(L_PTE_BUFFERABLE | L_PTE_CACHEABLE)).

Some other alternatives would be
__pgprot(L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_WRITE)
or
__pgprot(pgprot_val(PAGE_KERNEL) & (~(L_PTE_BUFFERABLE | L_PTE_CACHEABLE)))

How would you specify a non-bufferable, non-cachable page in a driver?

> maybe at a far shot the PMD_* macros.
Thanks.

Eric

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Tue, 20 Apr 1999 22:13:11 +0100 (BST)

> How would you specify a non-bufferable, non-cachable page in a driver?

There is normally no requirement to specify this.  If you're talking about
using PCI memory space, then you should use ioremap which will take care
of this for you.

If, on the other hand, you're talking about IO space, then this is already
mapped in as non-bufferable & non-cachable.  Can you give any more clues
as to your specific use?
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |
unsubscribe: body of `unsubscribe linux-arm' to [email-masked]