* Re: Badness in map_area_pte
2005-01-15 19:08 Badness in map_area_pte Bob Breuer
@ 2005-01-16 2:25 ` Bob Breuer
2005-01-16 3:55 ` William Lee Irwin III
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Bob Breuer @ 2005-01-16 2:25 UTC (permalink / raw)
To: sparclinux
Bob Breuer wrote:
> At this point, I am guessing that some pte's allocated for the
> framebuffer are being wrongly re-used when loading the module.
>
The cg14 driver is not remapping the framebuffer, and is using the mappings
that were setup by the prom and recreated in linux from
srmmu_inherit_prom_mappings().
How can we tell vmalloc not to step on that area of memory? Is it just from
VMALLOC_START to END? Let's see, for 2.6 those are 0xfe600000 and
0xffc00000. The prom mapped the cg14 to 0xfe700000 (8MB ram) and 0xffec0000
(registers). Hmm, a bit of overlap there... And 2.4 had VMALLOC_START at
0xfe300000. So it would seem that if the total vmalloc'ed memory goes above
1 meg for me, 2.6 will have problems, but 2.4 will still be fine.
Bob
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Badness in map_area_pte
2005-01-15 19:08 Badness in map_area_pte Bob Breuer
2005-01-16 2:25 ` Bob Breuer
@ 2005-01-16 3:55 ` William Lee Irwin III
2005-01-16 4:24 ` Bob Breuer
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: William Lee Irwin III @ 2005-01-16 3:55 UTC (permalink / raw)
To: sparclinux
Bob Breuer wrote:
>> At this point, I am guessing that some pte's allocated for the
>> framebuffer are being wrongly re-used when loading the module.
On Sat, Jan 15, 2005 at 08:25:35PM -0600, Bob Breuer wrote:
> The cg14 driver is not remapping the framebuffer, and is using the mappings
> that were setup by the prom and recreated in linux from
> srmmu_inherit_prom_mappings().
> How can we tell vmalloc not to step on that area of memory? Is it just
> from VMALLOC_START to END? Let's see, for 2.6 those are 0xfe600000 and
> 0xffc00000. The prom mapped the cg14 to 0xfe700000 (8MB ram) and
> 0xffec0000 (registers). Hmm, a bit of overlap there... And 2.4 had
> VMALLOC_START at 0xfe300000. So it would seem that if the total vmalloc'ed
> memory goes above 1 meg for me, 2.6 will have problems, but 2.4 will still
> be fine.
This sounds like a real problem. What happens if you move VMALLOC_START
to where it was in 2.4.x?
-- wli
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Badness in map_area_pte
2005-01-15 19:08 Badness in map_area_pte Bob Breuer
2005-01-16 2:25 ` Bob Breuer
2005-01-16 3:55 ` William Lee Irwin III
@ 2005-01-16 4:24 ` Bob Breuer
2005-01-16 4:29 ` William Lee Irwin III
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Bob Breuer @ 2005-01-16 4:24 UTC (permalink / raw)
To: sparclinux
William Lee Irwin III wrote:
> Bob Breuer wrote:
>
>>>At this point, I am guessing that some pte's allocated for the
>>>framebuffer are being wrongly re-used when loading the module.
>
>
> On Sat, Jan 15, 2005 at 08:25:35PM -0600, Bob Breuer wrote:
>
>>The cg14 driver is not remapping the framebuffer, and is using the mappings
>>that were setup by the prom and recreated in linux from
>>srmmu_inherit_prom_mappings().
>>How can we tell vmalloc not to step on that area of memory? Is it just
>>from VMALLOC_START to END? Let's see, for 2.6 those are 0xfe600000 and
>>0xffc00000. The prom mapped the cg14 to 0xfe700000 (8MB ram) and
>>0xffec0000 (registers). Hmm, a bit of overlap there... And 2.4 had
>>VMALLOC_START at 0xfe300000. So it would seem that if the total vmalloc'ed
>>memory goes above 1 meg for me, 2.6 will have problems, but 2.4 will still
>>be fine.
>
>
> This sounds like a real problem. What happens if you move VMALLOC_START
> to where it was in 2.4.x?
>
Yes, changing it back fixes my problem for now.
The bitkeeper comments say it was changed 4 months ago to fix a framebuffer
on a SparcStation 2. Looks like we need something more dynamic to cover all
the bases.
Bob
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Badness in map_area_pte
2005-01-15 19:08 Badness in map_area_pte Bob Breuer
` (2 preceding siblings ...)
2005-01-16 4:24 ` Bob Breuer
@ 2005-01-16 4:29 ` William Lee Irwin III
2005-02-04 21:37 ` Tom 'spot' Callaway
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: William Lee Irwin III @ 2005-01-16 4:29 UTC (permalink / raw)
To: sparclinux
William Lee Irwin III wrote:
>> This sounds like a real problem. What happens if you move VMALLOC_START
>> to where it was in 2.4.x?
On Sat, Jan 15, 2005 at 10:24:42PM -0600, Bob Breuer wrote:
> Yes, changing it back fixes my problem for now.
> The bitkeeper comments say it was changed 4 months ago to fix a framebuffer
> on a SparcStation 2. Looks like we need something more dynamic to cover
> all the bases.
I suspected the same. Perhaps time to brew up another BTFIXUP.
-- wli
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Badness in map_area_pte
2005-01-15 19:08 Badness in map_area_pte Bob Breuer
` (3 preceding siblings ...)
2005-01-16 4:29 ` William Lee Irwin III
@ 2005-02-04 21:37 ` Tom 'spot' Callaway
2005-02-05 6:07 ` David S. Miller
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Tom 'spot' Callaway @ 2005-02-04 21:37 UTC (permalink / raw)
To: sparclinux
[-- Attachment #1: Type: text/plain, Size: 520 bytes --]
On Sat, 2005-01-15 at 20:29 -0800, William Lee Irwin III wrote:
> I suspected the same. Perhaps time to brew up another BTFIXUP.
I tried to whip up a BTFIXUP patch for this, but it wouldn't work, since
VMALLOC_START is in entry.S. Peter Jones took my patch and made a
version that works. His patch to resolve this is attached.
~spot
---
Tom "spot" Callaway <tcallawa(a)redhat*com> LCA, RHCE
Red Hat Sales Engineer || Aurora Linux Project Leader
"If you are going through hell, keep going."
-- Sir Winston Churchill
[-- Attachment #2: linux-2.6.10-sparc-vmallocstartfix.patch --]
[-- Type: text/x-patch, Size: 3010 bytes --]
--- linux-2.6.10/arch/sparc/kernel/entry.S.BAD 2005-01-30 14:28:32.537336110 -0500
+++ linux-2.6.10/arch/sparc/kernel/entry.S 2005-01-30 14:33:24.781908182 -0500
@@ -863,8 +863,11 @@
.globl vac_hwflush_patch2
.align 4
+ .globl vmalloc_start_addr
+vmalloc_start_addr:
+ .word 0xfe300000
.globl sun4c_fault
! %l0 = %psr
! %l1 = %pc
! %l2 = %npc
@@ -944,7 +947,8 @@
and %l5, %l4, %l5
/* Test for NULL pte_t * in vmalloc area. */
- sethi %hi(VMALLOC_START), %l4
+ sethi %hi(vmalloc_start_addr), %l4
+ ld [%l4 + %lo(vmalloc_start_addr)], %l4
cmp %l5, %l4
blu,a invalid_segment_patch1
lduXa [%l5] ASI_SEGMAP, %l4
@@ -1072,7 +1076,8 @@
andn %l4, 0x1ff, %l5
1:
- sethi %hi(VMALLOC_START), %l4
+ sethi %hi(vmalloc_start_addr), %l4
+ ld [%l4 + %lo(vmalloc_start_addr)], %l4
cmp %l5, %l4
bgeu 1f
--- linux-2.6.10/arch/sparc/mm/init.c.BAD 2005-01-30 14:33:34.300461142 -0500
+++ linux-2.6.10/arch/sparc/mm/init.c 2005-01-30 14:36:27.501130638 -0500
@@ -402,6 +402,23 @@
int reservedpages = 0;
int i;
+ switch(sparc_cpu_model) {
+ case sun4:
+ case sun4c:
+ vmalloc_start_addr = VMALLOC_START_SUN4;
+ break;
+ case sun4d:
+ case sun4e:
+ case sun4m:
+ vmalloc_start_addr = VMALLOC_START_SUN4M;
+ break;
+ /* these are just to pacify gcc warnings */
+ case sun4u:
+ case sun_unknown:
+ case ap1000:
+ break;
+ };
+
if (PKMAP_BASE+LAST_PKMAP*PAGE_SIZE >= FIXADDR_START) {
prom_printf("BUG: fixmap and pkmap areas overlap\n");
prom_printf("pkbase: 0x%lx pkend: 0x%lx fixstart 0x%lx\n",
--- linux-2.6.10/arch/sparc/mm/sun4c.c.BAD 2005-01-30 14:38:04.846331918 -0500
+++ linux-2.6.10/arch/sparc/mm/sun4c.c 2005-01-30 14:38:30.156484190 -0500
@@ -2085,7 +2085,7 @@
memset(pg3, 0, PAGE_SIZE);
/* Save work later. */
- vaddr = VMALLOC_START;
+ vaddr = vmalloc_start_addr;
swapper_pg_dir[vaddr>>SUN4C_PGDIR_SHIFT] = __pgd(PGD_TABLE | (unsigned long) pg0);
vaddr += SUN4C_PGDIR_SIZE;
swapper_pg_dir[vaddr>>SUN4C_PGDIR_SHIFT] = __pgd(PGD_TABLE | (unsigned long) pg1);
--- linux-2.6.10/include/asm-sparc/vaddrs.h.BAD 2005-01-30 14:36:39.942239302 -0500
+++ linux-2.6.10/include/asm-sparc/vaddrs.h 2005-01-30 14:37:56.557591998 -0500
@@ -35,7 +35,13 @@
#define IOBASE_VADDR 0xfe000000
#define IOBASE_END 0xfe600000
-#define VMALLOC_START 0xfe600000
+#ifndef __ASSEMBLY__
+extern unsigned long vmalloc_start_addr;
+#endif
+
+#define VMALLOC_START_SUN4 0xfe600000
+#define VMALLOC_START_SUN4M 0xfe300000
+#define VMALLOC_START vmalloc_start_addr
/* XXX Alter this when I get around to fixing sun4c - Anton */
#define VMALLOC_END 0xffc00000
--- linux-2.6.10/arch/sparc/kernel/sparc_ksyms.c.BAD 2005-01-30 18:06:30.221225966 -0500
+++ linux-2.6.10/arch/sparc/kernel/sparc_ksyms.c 2005-01-30 18:06:59.802728894 -0500
@@ -135,6 +135,7 @@
EXPORT_SYMBOL(__down_trylock);
EXPORT_SYMBOL(__down_interruptible);
+EXPORT_SYMBOL(vmalloc_start_addr);
EXPORT_SYMBOL(sparc_valid_addr_bitmap);
EXPORT_SYMBOL(phys_base);
EXPORT_SYMBOL(pfn_base);
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Badness in map_area_pte
2005-01-15 19:08 Badness in map_area_pte Bob Breuer
` (4 preceding siblings ...)
2005-02-04 21:37 ` Tom 'spot' Callaway
@ 2005-02-05 6:07 ` David S. Miller
2005-02-05 16:30 ` Tom 'spot' Callaway
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: David S. Miller @ 2005-02-05 6:07 UTC (permalink / raw)
To: sparclinux
On Fri, 04 Feb 2005 15:37:24 -0600
"Tom 'spot' Callaway" <tcallawa@redhat.com> wrote:
> On Sat, 2005-01-15 at 20:29 -0800, William Lee Irwin III wrote:
>
> > I suspected the same. Perhaps time to brew up another BTFIXUP.
>
> I tried to whip up a BTFIXUP patch for this, but it wouldn't work, since
> VMALLOC_START is in entry.S. Peter Jones took my patch and made a
> version that works. His patch to resolve this is attached.
That entry.S code is all for sun4c, so you can use VMALLOC_START_SUN4C
or whatever.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Badness in map_area_pte
2005-01-15 19:08 Badness in map_area_pte Bob Breuer
` (5 preceding siblings ...)
2005-02-05 6:07 ` David S. Miller
@ 2005-02-05 16:30 ` Tom 'spot' Callaway
2005-02-05 18:34 ` Tom 'spot' Callaway
2005-02-05 19:48 ` David S. Miller
8 siblings, 0 replies; 10+ messages in thread
From: Tom 'spot' Callaway @ 2005-02-05 16:30 UTC (permalink / raw)
To: sparclinux
[-- Attachment #1: Type: text/plain, Size: 875 bytes --]
On Fri, 2005-02-04 at 22:07 -0800, David S. Miller wrote:
> On Fri, 04 Feb 2005 15:37:24 -0600
> "Tom 'spot' Callaway" <tcallawa@redhat.com> wrote:
>
> > On Sat, 2005-01-15 at 20:29 -0800, William Lee Irwin III wrote:
> >
> > > I suspected the same. Perhaps time to brew up another BTFIXUP.
> >
> > I tried to whip up a BTFIXUP patch for this, but it wouldn't work, since
> > VMALLOC_START is in entry.S. Peter Jones took my patch and made a
> > version that works. His patch to resolve this is attached.
>
> That entry.S code is all for sun4c, so you can use VMALLOC_START_SUN4C
> or whatever.
OK, how about this patch?
Signed-off-by: Tom 'spot' Callaway <tcallawa@redhat.com>
~spot
---
Tom "spot" Callaway <tcallawa(a)redhat*com> LCA, RHCE
Red Hat Sales Engineer || Aurora Linux Project Leader
"If you are going through hell, keep going."
-- Sir Winston Churchill
[-- Attachment #2: linux-2.6.10-sparc-vmallocstartfix2.patch --]
[-- Type: text/x-patch, Size: 2195 bytes --]
--- linux-2.6.10/arch/sparc/kernel/entry.S.BAD 2005-02-05 09:41:05.967434326 -0500
+++ linux-2.6.10/arch/sparc/kernel/entry.S 2005-02-05 09:41:36.828742694 -0500
@@ -944,7 +944,7 @@
and %l5, %l4, %l5
/* Test for NULL pte_t * in vmalloc area. */
- sethi %hi(VMALLOC_START), %l4
+ sethi %hi(VMALLOC_START_SUN4), %l4
cmp %l5, %l4
blu,a invalid_segment_patch1
lduXa [%l5] ASI_SEGMAP, %l4
@@ -1072,7 +1072,7 @@
andn %l4, 0x1ff, %l5
1:
- sethi %hi(VMALLOC_START), %l4
+ sethi %hi(VMALLOC_START_SUN4), %l4
cmp %l5, %l4
bgeu 1f
--- linux-2.6.10/arch/sparc/mm/init.c.BAD 2005-02-05 09:47:32.849619294 -0500
+++ linux-2.6.10/arch/sparc/mm/init.c 2005-02-05 09:56:03.119046550 -0500
@@ -44,6 +44,7 @@
struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS+1];
unsigned long sparc_unmapped_base;
+unsigned long vmalloc_start_addr;
struct pgtable_cache_struct pgt_quicklists;
@@ -402,6 +403,27 @@
int reservedpages = 0;
int i;
+ switch(sparc_cpu_model) {
+ case sun4:
+ case sun4c:
+ vmalloc_start_addr = VMALLOC_START_SUN4;
+ BTFIXUPSET_SETHI(vmalloc_start_addr, VMALLOC_START_SUN4);
+ break;
+ case sun4d:
+ case sun4e:
+ case sun4m:
+ vmalloc_start_addr = VMALLOC_START_SUN4M;
+ BTFIXUPSET_SETHI(vmalloc_start_addr, VMALLOC_START_SUN4M);
+ break;
+ /* these are just to pacify gcc warnings */
+ case sun4u:
+ case sun_unknown:
+ case ap1000:
+ default:
+ break;
+ }
+
+
if (PKMAP_BASE+LAST_PKMAP*PAGE_SIZE >= FIXADDR_START) {
prom_printf("BUG: fixmap and pkmap areas overlap\n");
prom_printf("pkbase: 0x%lx pkend: 0x%lx fixstart 0x%lx\n",
--- linux-2.6.10/include/asm-sparc/vaddrs.h.BAD 2005-02-05 09:45:57.662089998 -0500
+++ linux-2.6.10/include/asm-sparc/vaddrs.h 2005-02-05 09:51:33.763994742 -0500
@@ -35,7 +35,13 @@
#define IOBASE_VADDR 0xfe000000
#define IOBASE_END 0xfe600000
-#define VMALLOC_START 0xfe600000
+extern unsigned long vmalloc_start_addr;
+
+BTFIXUPDEF_SETHI(vmalloc_start_addr)
+
+#define VMALLOC_START_SUN4 0xfe600000
+#define VMALLOC_START_SUN4M 0xfe300000
+#define VMALLOC_START BTFIXUP_SETHI(vmalloc_start_addr)
/* XXX Alter this when I get around to fixing sun4c - Anton */
#define VMALLOC_END 0xffc00000
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Badness in map_area_pte
2005-01-15 19:08 Badness in map_area_pte Bob Breuer
` (6 preceding siblings ...)
2005-02-05 16:30 ` Tom 'spot' Callaway
@ 2005-02-05 18:34 ` Tom 'spot' Callaway
2005-02-05 19:48 ` David S. Miller
8 siblings, 0 replies; 10+ messages in thread
From: Tom 'spot' Callaway @ 2005-02-05 18:34 UTC (permalink / raw)
To: sparclinux
[-- Attachment #1: Type: text/plain, Size: 390 bytes --]
On Sat, 2005-02-05 at 10:30 -0600, Tom 'spot' Callaway wrote:
> OK, how about this patch?
Sorry. That patch was broken, this patch is not.
Signed-off-by: Tom 'spot' Callaway <tcallawa@redhat.com>
~spot
---
Tom "spot" Callaway <tcallawa(a)redhat*com> LCA, RHCE
Red Hat Sales Engineer || Aurora Linux Project Leader
"If you are going through hell, keep going."
-- Sir Winston Churchill
[-- Attachment #2: linux-2.6.10-sparc-vmallocstartfix3.patch --]
[-- Type: text/x-patch, Size: 2388 bytes --]
--- linux-2.6.10/arch/sparc/kernel/entry.S.BAD 2005-02-05 09:41:05.967434326 -0500
+++ linux-2.6.10/arch/sparc/kernel/entry.S 2005-02-05 09:41:36.828742694 -0500
@@ -944,7 +944,7 @@
and %l5, %l4, %l5
/* Test for NULL pte_t * in vmalloc area. */
- sethi %hi(VMALLOC_START), %l4
+ sethi %hi(VMALLOC_START_SUN4), %l4
cmp %l5, %l4
blu,a invalid_segment_patch1
lduXa [%l5] ASI_SEGMAP, %l4
@@ -1072,7 +1072,7 @@
andn %l4, 0x1ff, %l5
1:
- sethi %hi(VMALLOC_START), %l4
+ sethi %hi(VMALLOC_START_SUN4), %l4
cmp %l5, %l4
bgeu 1f
--- linux-2.6.10/arch/sparc/mm/init.c.BAD 2005-02-05 09:47:32.849619294 -0500
+++ linux-2.6.10/arch/sparc/mm/init.c 2005-02-05 09:56:03.119046550 -0500
@@ -44,6 +44,7 @@
struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS+1];
unsigned long sparc_unmapped_base;
+unsigned long vmalloc_start_addr;
struct pgtable_cache_struct pgt_quicklists;
@@ -402,6 +403,27 @@
int reservedpages = 0;
int i;
+ switch(sparc_cpu_model) {
+ case sun4:
+ case sun4c:
+ vmalloc_start_addr = VMALLOC_START_SUN4;
+ BTFIXUPSET_SETHI(vmalloc_start_addr, VMALLOC_START_SUN4);
+ break;
+ case sun4d:
+ case sun4e:
+ case sun4m:
+ vmalloc_start_addr = VMALLOC_START_SUN4M;
+ BTFIXUPSET_SETHI(vmalloc_start_addr, VMALLOC_START_SUN4M);
+ break;
+ /* these are just to pacify gcc warnings */
+ case sun4u:
+ case sun_unknown:
+ case ap1000:
+ default:
+ break;
+ }
+
+
if (PKMAP_BASE+LAST_PKMAP*PAGE_SIZE >= FIXADDR_START) {
prom_printf("BUG: fixmap and pkmap areas overlap\n");
prom_printf("pkbase: 0x%lx pkend: 0x%lx fixstart 0x%lx\n",
--- linux-2.6.10/include/asm-sparc/vaddrs.h.BAD 2005-02-05 09:45:57.662089998 -0500
+++ linux-2.6.10/include/asm-sparc/vaddrs.h 2005-02-05 09:51:33.763994742 -0500
@@ -3,6 +3,7 @@
#define _SPARC_VADDRS_H
#include <asm/head.h>
+#include <asm/btfixup.h>
/*
* asm-sparc/vaddrs.h: Here we define the virtual addresses at
@@ -35,7 +36,15 @@
#define IOBASE_VADDR 0xfe000000
#define IOBASE_END 0xfe600000
-#define VMALLOC_START 0xfe600000
+#define VMALLOC_START_SUN4 0xfe600000
+#define VMALLOC_START_SUN4M 0xfe300000
+#ifndef __ASSEMBLY__
+extern unsigned long vmalloc_start_addr;
+
+BTFIXUPDEF_SETHI(vmalloc_start_addr)
+
+#define VMALLOC_START BTFIXUP_SETHI(vmalloc_start_addr)
+#endif
/* XXX Alter this when I get around to fixing sun4c - Anton */
#define VMALLOC_END 0xffc00000
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Badness in map_area_pte
2005-01-15 19:08 Badness in map_area_pte Bob Breuer
` (7 preceding siblings ...)
2005-02-05 18:34 ` Tom 'spot' Callaway
@ 2005-02-05 19:48 ` David S. Miller
8 siblings, 0 replies; 10+ messages in thread
From: David S. Miller @ 2005-02-05 19:48 UTC (permalink / raw)
To: sparclinux
On Sat, 05 Feb 2005 12:34:45 -0600
"Tom 'spot' Callaway" <tcallawa@redhat.com> wrote:
> On Sat, 2005-02-05 at 10:30 -0600, Tom 'spot' Callaway wrote:
>
> > OK, how about this patch?
>
> Sorry. That patch was broken, this patch is not.
>
> Signed-off-by: Tom 'spot' Callaway <tcallawa@redhat.com>
Looks great Tom.
^ permalink raw reply [flat|nested] 10+ messages in thread