2004-09-27 17:04:10

by Antony Suter

[permalink] [raw]
Subject: [PATCH] __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
--- linux-orig/arch/i386/mm/init.c 2004-09-26 03:43:57.944613000 +1000
+++ linux-new/arch/i386/mm/init.c 2004-09-28 02:37:21.787922000 +1000
@@ -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;

--
- Antony Suter (suterant users sourceforge net) "Bonta"
- "Facts do not cease to exist because they are ignored." - Aldous Huxley


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2004-09-27 17:12:39

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] __VMALLOC_RESERVE export

On Tue, Sep 28, 2004 at 03:03:43AM +1000, Antony Suter wrote:
> __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.

2004-09-27 18:27:20

by Antony Suter

[permalink] [raw]
Subject: Re: [PATCH] __VMALLOC_RESERVE export

On Tue, 2004-09-28 at 03:12, Christoph Hellwig wrote:
> On Tue, Sep 28, 2004 at 03:03:43AM +1000, Antony Suter wrote:
> > __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?

--
- Antony Suter (suterant users sourceforge net) "Bonta"
- "Facts do not cease to exist because they are ignored." - Aldous Huxley


Attachments:
signature.asc (189.00 B)
This is a digitally signed message part

2004-09-27 18:44:23

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] __VMALLOC_RESERVE export

On Tue, Sep 28, 2004 at 04:26:43AM +1000, Antony Suter wrote:
> On Tue, 2004-09-28 at 03:12, Christoph Hellwig wrote:
> > On Tue, Sep 28, 2004 at 03:03:43AM +1000, Antony Suter wrote:
> > > __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?

Yes.

2004-09-27 19:57:00

by Tonnerre

[permalink] [raw]
Subject: Re: [PATCH] __VMALLOC_RESERVE export

Salut,

On Tue, Sep 28, 2004 at 03:03:43AM +1000, Antony Suter wrote:
> __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].

Signed-off-by: Tonnerre <[email protected]>

> diff -u -pruaN linux-orig/arch/i386/mm/init.c
> linux-new/arch/i386/mm/init.c
> --- linux-orig/arch/i386/mm/init.c 2004-09-26 03:43:57.944613000 +1000
> +++ linux-new/arch/i386/mm/init.c 2004-09-28 02:37:21.787922000 +1000
> @@ -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;
>
> --
> - Antony Suter (suterant users sourceforge net) "Bonta"
> - "Facts do not cease to exist because they are ignored." - Aldous Huxley



Attachments:
(No filename) (1.08 kB)
signature.asc (189.00 B)
Digital signature
Download all attachments

2004-09-27 19:57:43

by Tonnerre

[permalink] [raw]
Subject: Re: [PATCH] __VMALLOC_RESERVE export

Salut,

On Mon, Sep 27, 2004 at 06:12:29PM +0100, Christoph Hellwig wrote:
> On Tue, Sep 28, 2004 at 03:03:43AM +1000, Antony Suter wrote:
> > __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


Attachments:
(No filename) (640.00 B)
signature.asc (189.00 B)
Digital signature
Download all attachments

2004-09-27 20:15:33

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] __VMALLOC_RESERVE export

> On Mon, Sep 27, 2004 at 06:12:29PM +0100, Christoph Hellwig wrote:
> > On Tue, Sep 28, 2004 at 03:03:43AM +1000, Antony Suter wrote:
> > > __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.

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.