Skip to contentSkip to conversation

"BUG: Bad page map in process Xorg" with 3.1 kernel

DISCUSSION Jurij Smakov 2 participants 5 messages Dec 20, 2011 – Dec 22, 2011 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

Hello,

Today I've tried running Xorg on my SunBlade 1000 with a rather old ATI Mach64 graphics card. When I launch Xorg, messages like these get logged a few times:

[  595.437513] BUG: Bad page map in process Xorg  pte:800007fe027fef8a pmd:000f6904
[  595.437528] addr:00000000f75b6000 vm_flags:000844bb anon_vma:          (null) mapping:fffff8007da94f00 index:3ff013ff
[  595.437543] vma->vm_ops->fault: bin_fault+0x8/0x5c
[  595.437553] vma->vm_file->f_op->mmap: mmap+0x8/0xe0
[  595.437559] Call Trace:
[  595.437571]  [00000000004f0c74] vm_normal_page+0x80/0x90
[  595.437581]  [00000000004f1b3c] unmap_vmas+0x218/0x680
[  595.437592]  [00000000004f5a84] unmap_region+0x6c/0xcc
[  595.437603]  [00000000004f6900] do_munmap+0x268/0x2d4
[  595.437613]  [00000000004f6ad8] SyS_munmap+0x24/0x40
[  595.437625]  [0000000000406194] linux_sparc_syscall32+0x34/0x40
[  596.716253] BUG: Bad page map in process Xorg  pte:800007fe027fef8a pmd:000f6520
[  596.803924] addr:00000000f777a000 vm_flags:000844bb anon_vma:          (null) mapping:fffff8007da94f00 index:3ff013ff
[  596.931006] vma->vm_ops->fault: bin_fault+0x8/0x5c
[  596.931020] vma->vm_file->f_op->mmap: mmap+0x8/0xe0
[  596.931027] Call Trace:
[  596.931041]  [00000000004f0c74] vm_normal_page+0x80/0x90
[  596.931053]  [00000000004f1b3c] unmap_vmas+0x218/0x680
[  596.931065]  [00000000004f5a84] unmap_region+0x6c/0xcc
[  596.931077]  [00000000004f6900] do_munmap+0x268/0x2d4
[  596.931087]  [00000000004f6ad8] SyS_munmap+0x24/0x40
[  596.931103]  [0000000000406194] linux_sparc_syscall32+0x34/0x40

This is with kernel

jurij@debian:~$ uname -a
Linux debian 3.1.0-1-sparc64-smp #1 SMP Sun Dec 11 22:45:09 UTC 2011 sparc64 GNU/Linux

I'm also not getting any output on the monitor, even though Xorg appears to start up without any errors in the log, last lines there:

[    46.160] (II) MACH64: Driver for ATI Mach64 chipsets
[    46.160] (II) SUNFFB: driver for Creator, Creator 3D and Elite 3D
[    46.160] (II) FBDEV: driver for framebuffer: fbdev
[    46.160] (++) using VT number 7

I did confirm that the card is functional by sticking it in a Linux PC.

Best regards,

Signature · 2 lines
Jurij Smakov                                           [email protected]
Key: http://www.wooyd.org/pgpkey/                      KeyID: C99E03CC
maintainer
#1 lore raw

From: Jurij Smakov <[email protected]>
Date: Tue, 20 Dec 2011 23:00:40 +0000

Quoted 3 lines

Today I've tried running Xorg on my SunBlade 1000 with a rather old ATI Mach64 graphics card. When I launch Xorg, messages like these get logged a few times:

Can you see if reverting this fixes things?

--------------------
commit 3e37fd3153ac95088a74f5e7c569f7567e9f993a

Author: David S. Miller <[email protected]>
Date:   Thu Nov 17 18:17:59 2011 -0800

sparc: Kill custom io_remap_pfn_range().

To handle the large physical addresses, just make a simple wrapper around remap_pfn_range() like MIPS does.

arch/sparc/include/asm/pgtable_32.h +16 -4
index 5b31a8e..a790cc6 100644
@@ -431,10 +431,6 @@ extern unsigned long *sparc_valid_addr_bitmap;
 #define kern_addr_valid(addr) \
 	(test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap))
 
-extern int io_remap_pfn_range(struct vm_area_struct *vma,
-			      unsigned long from, unsigned long pfn,
-			      unsigned long size, pgprot_t prot);
-
 /*
  * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in
  * its high 4 bits.  These macros/functions put it there or get it from there.
@@ -443,6 +439,22 @@ extern int io_remap_pfn_range(struct vm_area_struct *vma,
 #define GET_IOSPACE(pfn)		(pfn >> (BITS_PER_LONG - 4))
 #define GET_PFN(pfn)			(pfn & 0x0fffffffUL)
 
+extern int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long,
+			   unsigned long, pgprot_t);
+
+static inline int io_remap_pfn_range(struct vm_area_struct *vma,
+				     unsigned long from, unsigned long pfn,
+				     unsigned long size, pgprot_t prot)
+{
+	unsigned long long offset, space, phys_base;
+
+	offset = ((unsigned long long) GET_PFN(pfn)) << PAGE_SHIFT;
+	space = GET_IOSPACE(pfn);
+	phys_base = offset | (space << 32ULL);
+
+	return remap_pfn_range(vma, from, phys_base >> PAGE_SHIFT, size, prot);
+}
+
 #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
 #define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \
 ({									  \
arch/sparc/include/asm/pgtable_64.h +16 -4
index adf8932..38ebb2c 100644
@@ -757,10 +757,6 @@ static inline bool kern_addr_valid(unsigned long addr)
 
 extern int page_in_phys_avail(unsigned long paddr);
 
-extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
-			       unsigned long pfn,
-			       unsigned long size, pgprot_t prot);
-
 /*
  * For sparc32&64, the pfn in io_remap_pfn_range() carries <iospace> in
  * its high 4 bits.  These macros/functions put it there or get it from there.
@@ -769,6 +765,22 @@ extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
 #define GET_IOSPACE(pfn)		(pfn >> (BITS_PER_LONG - 4))
 #define GET_PFN(pfn)			(pfn & 0x0fffffffffffffffUL)
 
+extern int remap_pfn_range(struct vm_area_struct *, unsigned long, unsigned long,
+			   unsigned long, pgprot_t);
+
+static inline int io_remap_pfn_range(struct vm_area_struct *vma,
+				     unsigned long from, unsigned long pfn,
+				     unsigned long size, pgprot_t prot)
+{
+	unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT;
+	int space = GET_IOSPACE(pfn);
+	unsigned long phys_base;
+
+	phys_base = offset | (((unsigned long) space) << 32UL);
+
+	return remap_pfn_range(vma, from, phys_base >> PAGE_SHIFT, size, prot);
+}
+
 #include <asm-generic/pgtable.h>
 
 /* We provide our own get_unmapped_area to cope with VA holes and
arch/sparc/mm/Makefile +0 -1
index e3cda21..301421c 100644
@@ -8,7 +8,6 @@ obj-$(CONFIG_SPARC64)   += ultra.o tlb.o tsb.o gup.o
 obj-y                   += fault_$(BITS).o
 obj-y                   += init_$(BITS).o
 obj-$(CONFIG_SPARC32)   += loadmmu.o
-obj-y                   += generic_$(BITS).o
 obj-$(CONFIG_SPARC32)   += extable.o btfixup.o srmmu.o iommu.o io-unit.o
 obj-$(CONFIG_SPARC32)   += hypersparc.o viking.o tsunami.o swift.o
 obj-$(CONFIG_SPARC_LEON)+= leon_mm.o
arch/sparc/mm/generic_32.c deleted +0 -99

99 lines not on this page · raw message

arch/sparc/mm/generic_64.c deleted +0 -165

165 lines not on this page · raw message

#2 lore raw
In reply to Jurij Smakov
Quoted 14 lines · David Miller

From: Jurij Smakov <[email protected]>
Date: Tue, 20 Dec 2011 23:00:40 +0000

Quoted 3 lines

Today I've tried running Xorg on my SunBlade 1000 with a rather old ATI Mach64 graphics card. When I launch Xorg, messages like these get logged a few times:

Can you see if reverting this fixes things?

--------------------
commit 3e37fd3153ac95088a74f5e7c569f7567e9f993a

Author: David S. Miller <[email protected]>
Date:   Thu Nov 17 18:17:59 2011 -0800
Quoted 6 lines

sparc: Kill custom io_remap_pfn_range().

To handle the large physical addresses, just make a simple wrapper around remap_pfn_range() like MIPS does.

It does not look like this change made it into 3.1 (where I see these errors).

Best regards,

Signature · 2 lines
Jurij Smakov                                           [email protected]
Key: http://www.wooyd.org/pgpkey/                      KeyID: C99E03CC
maintainer
#3 lore raw
In reply to Jurij Smakov

From: Jurij Smakov <[email protected]>
Date: Wed, 21 Dec 2011 21:34:29 +0000

Quoted 17 lines · David Miller
Quoted 16 lines

From: Jurij Smakov <[email protected]>
Date: Tue, 20 Dec 2011 23:00:40 +0000

Quoted 3 lines

Today I've tried running Xorg on my SunBlade 1000 with a rather old ATI Mach64 graphics card. When I launch Xorg, messages like these get logged a few times:

Can you see if reverting this fixes things?

--------------------
commit 3e37fd3153ac95088a74f5e7c569f7567e9f993a

Author: David S. Miller <[email protected]>
Date:   Thu Nov 17 18:17:59 2011 -0800

sparc: Kill custom io_remap_pfn_range().

Quoted 7 lines
Quoted 4 lines

To handle the large physical addresses, just make a simple wrapper around remap_pfn_range() like MIPS does.

It does not look like this change made it into 3.1 (where I see these errors).

Interesting.... try applying it! :-)

The bug log message is essentially complaining that pte_special() is not true and the PFN is for an area outside of the physical memory range.

The patch I mentioned uses generic code instead of the by-hand sparc stuff, and is likely to fix that kind of problem.

So give it a try and let me know how it goes.

#4 lore raw
In reply to Jurij Smakov
Quoted 30 lines · David Miller

From: Jurij Smakov <[email protected]>
Date: Wed, 21 Dec 2011 21:34:29 +0000

Quoted 17 lines · David Miller
Quoted 16 lines

From: Jurij Smakov <[email protected]>
Date: Tue, 20 Dec 2011 23:00:40 +0000

Quoted 3 lines

Today I've tried running Xorg on my SunBlade 1000 with a rather old ATI Mach64 graphics card. When I launch Xorg, messages like these get logged a few times:

Can you see if reverting this fixes things?

--------------------
commit 3e37fd3153ac95088a74f5e7c569f7567e9f993a

Author: David S. Miller <[email protected]>
Date:   Thu Nov 17 18:17:59 2011 -0800

sparc: Kill custom io_remap_pfn_range().

Quoted 7 lines
Quoted 4 lines

To handle the large physical addresses, just make a simple wrapper around remap_pfn_range() like MIPS does.

It does not look like this change made it into 3.1 (where I see these errors).

Interesting.... try applying it! :-)

Quoted 8 lines

The bug log message is essentially complaining that pte_special() is not true and the PFN is for an area outside of the physical memory range.

The patch I mentioned uses generic code instead of the by-hand sparc stuff, and is likely to fix that kind of problem.

So give it a try and let me know how it goes.

Yeah, with this patch applied the messages are no longer there. X still does not work though, but that can be for a variety of reasons...

Best regards,

Signature · 2 lines
Jurij Smakov                                           [email protected]
Key: http://www.wooyd.org/pgpkey/                      KeyID: C99E03CC