Subject: remap_page_range problem with 2.2.5

From: "Eric Thomas (EUS)" <[email-masked]>
Date: Mon, 19 Apr 1999 13:14:43 -0500

Tried out the pre-patch-2.2.5-rmk5 (and rmk4) this morning with
diff-2.2.5-rmk4-np6 on my SA1100 board and am seeing the sa1100fb.c code
crash on startup.  The driver remaps a region of cacheable, bufferable RAM
to 0xD1000000 as non-cached, non-bufferable.  The remap_page_range returns
successfully (0).  However, as soon as I read from or write to the mapped
memory region, I receive an Oops.  This is working under 2.2.3 kernel.  The
remap_page_range call I am using is below along with the Oops.  

remap_page_range(0xD1000000, 0xc0104000, 0x4D000,
	__pgprot(PTE_TYPE_SMALL | PTE_AP_WRITE))

Unable to handle kernel paging request at virtual address d1000000

memmap = C0004000, pgd = c0004000

*pgd = c8fdb001, *pmd = c8fdb001, *pte = c0104ff2, *ppte = 00000000

Internal error: Oops: 2

CPU: 0

pc : [<c00a914c>]    lr : [<c00a9144>]

sp : c01bdf40  ip : c01bdef8  fp : c01bdf58

r10: c00081fc  r9 : 4401a118  r8 : c00e98ec

r7 : c0162488  r6 : c00de824  r5 : fffff000  r4 : d1000000

r3 : 60000053  r2 : 0000b928  r1 : 00000418  r0 : c00de910

Flags: Nzcv  IRQs on  FIQs off  Mode SVC_32  Segment kernel

Control: C000517F  Table: C000517F  DAC: 0000001D

Process swapper (pid: 1, stackpage=c01bd000)

Stack:

c01bdf20:                                      c00a9144 c00a914c 80000053
fffff 
c01bdf40: c0151c2c 00000000 c000b450 c01bdf78  c01bdf5c c00a9744 c00a904c
c00de 
c01bdf60: 00000000 00000000 c000b450 c01bdf94  c01bdf7c c00a7bcc c00a96e4
c000c 
c01bdf80: c00e96d0 c0152580 c01bdfa4 c01bdf98  c0096900 c00a7b38 c01bdfb4
c01bd 
c01bdfa0: c00884e0 c00968d8 c01bdfd4 c01bdfb8  c0031170 c00884dc c000c8b0
c00e9 
c01bdfc0: c0152580 c0162488 c01bdfe4 c01bdfd8  c000c88c c003116c c01bdffc
c01bd 
c01bdfe0: c000c8c0 c000c840 c000c8b0 c00e96d0  c00e7fe0 c01be000 c000e380
c000c 

Any ideas whats going on?     

Thanks,
Eric

--------------------------------------------------------------
Eric Thomas                                      Ericsson Inc.
Software Engineer                       7001 Development Drive
[email-masked]     Research Triangle Park, NC  27709
Voice: (919)472-7082                        FAX: (919)472-1561

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

---

From: Philip Blundell <[email-masked]>
Date: Mon, 19 Apr 1999 21:00:28 +0100

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

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Mon, 19 Apr 1999 22:06:06 +0100 (BST)

> 	__pgprot(PTE_TYPE_SMALL | PTE_AP_WRITE))

The page table protection bits are no longer the PTE_* macros.  Please upgrade
then yo use the L_PTE_* macros instead.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        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]