Skip to contentSkip to conversation

__VMALLOC_RESERVE export

PATCH In review Antony Suter 3 participants 7 messages Sep 27, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 __VMALLOC_RESERVE export

__VMALLOC_RESERVE itself is not exported but is used by something that is. This patch is against 2.6.9-rc2-bk11

This is required by the nvidia binary driver 1.0.6111

(2 long lines are being wrapped by my emailer)

####

diff -u -pruaN linux-orig/arch/i386/mm/init.c
linux-new/arch/i386/mm/init.c

arch/i386/mm/init.c +1 -0
@@ -41,6 +41,7 @@
 #include <asm/sections.h>
 
 unsigned int __VMALLOC_RESERVE = 128 << 20;
+EXPORT_SYMBOL(__VMALLOC_RESERVE);
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 unsigned long highstart_pfn, highend_pfn;
Signature · 2 lines
- Antony Suter  (suterant users sourceforge net)  "Bonta"
- "Facts do not cease to exist because they are ignored." - Aldous Huxley
#1 lore raw
Quoted 4 lines · Antony Suter

__VMALLOC_RESERVE itself is not exported but is used by something that is. This patch is against 2.6.9-rc2-bk11

This is required by the nvidia binary driver 1.0.6111

And the driver does absolutely nasty things it shouldn't do. This is an implementation detail that absolutely should not be exported.

#2 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Antony Suter

__VMALLOC_RESERVE itself is not exported but is used by something that is. This patch is against 2.6.9-rc2-bk11

This is required by the nvidia binary driver 1.0.6111

And the driver does absolutely nasty things it shouldn't do. This is an implementation detail that absolutely should not be exported.

However __VMALLOC_RESERVE, specific to arch-i386 is now used by the macro MAXMEM. MAXMEM is _not_ specific to arch-i386. The nvidia driver has a kernel module that uses the macro MAXMEM. Is it wrong for a kernel module to use MAXMEM?

Signature · 2 lines
- Antony Suter  (suterant users sourceforge net)  "Bonta"
- "Facts do not cease to exist because they are ignored." - Aldous Huxley
#3 lore raw
Quoted 7 lines · Antony Suter
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Antony Suter

__VMALLOC_RESERVE itself is not exported but is used by something that is. This patch is against 2.6.9-rc2-bk11

This is required by the nvidia binary driver 1.0.6111

Quoted 7 lines
Quoted 2 lines

And the driver does absolutely nasty things it shouldn't do. This is an implementation detail that absolutely should not be exported.

However __VMALLOC_RESERVE, specific to arch-i386 is now used by the macro MAXMEM. MAXMEM is _not_ specific to arch-i386. The nvidia driver has a kernel module that uses the macro MAXMEM. Is it wrong for a kernel module to use MAXMEM?

Yes.

#4 lore raw
In reply to Christoph Hellwig

Salut,

Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Antony Suter

__VMALLOC_RESERVE itself is not exported but is used by something that is. This patch is against 2.6.9-rc2-bk11

This is required by the nvidia binary driver 1.0.6111

And the driver does absolutely nasty things it shouldn't do. This is an implementation detail that absolutely should not be exported.

NVidia isn't the only user...

Every kernel module that uses just anything that uses the old __VMALLOC_RESERVE define was broken without this patch.

Tonnerre

#5 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 6 lines · Antony Suter
Quoted 4 lines

__VMALLOC_RESERVE itself is not exported but is used by something that is. This patch is against 2.6.9-rc2-bk11

This is required by the nvidia binary driver 1.0.6111

Quoted 7 lines
Quoted 2 lines

And the driver does absolutely nasty things it shouldn't do. This is an implementation detail that absolutely should not be exported.

NVidia isn't the only user...

Every kernel module that uses just anything that uses the old __VMALLOC_RESERVE define was broken without this patch.

NVidia doesn't have a monopoly on crappy drivers, news at eleven..

__VMALLOC_RESERVE/VMALLOC_RESERVE is only used either in arch/i386 or defined to MAXMEM whichs is also not used outside of arch/{i386,x86_64,mips}.

Doesn't exactly sounds like a published interface, heh? Especially as there's not sane way to use it outside memory managment code.

#6 lore raw
In reply to Antony Suter

Salut,

Quoted 6 lines · Antony Suter

__VMALLOC_RESERVE itself is not exported but is used by something that is. This patch is against 2.6.9-rc2-bk11

This is required by the nvidia binary driver 1.0.6111

(2 long lines are being wrapped by my emailer)

ACK. I did the same thing at some friend's computer which is running with it since the __VMALLOC_RESERVE patch came out, so it's The Right Thing[tm].

Quoted 16 lines

diff -u -pruaN linux-orig/arch/i386/mm/init.c
linux-new/arch/i386/mm/init.c

arch/i386/mm/init.c +1 -0
@@ -41,6 +41,7 @@
 #include <asm/sections.h>
 
 unsigned int __VMALLOC_RESERVE = 128 << 20;
+EXPORT_SYMBOL(__VMALLOC_RESERVE);
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 unsigned long highstart_pfn, highend_pfn;
Signature · 3 lines
-- 
- Antony Suter  (suterant users sourceforge net)  "Bonta"
- "Facts do not cease to exist because they are ignored." - Aldous Huxley