2003-02-26 22:20:09

by Pavel Machek

[permalink] [raw]
Subject: mem= option for broken bioses

Hi!

I've seen broken bios that did not mark acpi tables in e820
tables. This allows user to override it. Please apply,

Pavel

--- linux/arch/i386/kernel/setup.c 2003-02-11 17:50:57.000000000 +0100
+++ linux-tablet/arch/i386/kernel/setup.c 2003-02-20 18:03:03.000000000 +0100
@@ -546,6 +546,12 @@
if (*from == '@') {
start_at = memparse(from+1, &from);
add_memory_region(start_at, mem_size, E820_RAM);
+ } else if (*from == '#') {
+ start_at = memparse(from+1, &from);
+ add_memory_region(start_at, mem_size, E820_ACPI);
+ } else if (*from == '$') {
+ start_at = memparse(from+1, &from);
+ add_memory_region(start_at, mem_size, E820_RESERVED);
} else {
limit_regions(mem_size);
userdef=1;

--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]


2003-02-26 22:34:34

by Pavel Machek

[permalink] [raw]
Subject: Re: mem= option for broken bioses

Hi!

> > From: Pavel Machek [mailto:[email protected]]
> > I've seen broken bios that did not mark acpi tables in e820
> > tables. This allows user to override it. Please apply,
>
> OK, looks reasonable. Can you also gen up a patch documenting this in
> kernel-parameters.txt?

You can, assuming you took the patch ;-).

Pavel

--- clean/Documentation/kernel-parameters.txt 2003-02-11 17:40:28.000000000 +0100
+++ linux/Documentation/kernel-parameters.txt 2003-02-26 23:43:21.000000000 +0100
@@ -516,6 +516,10 @@
[KNL,BOOT] Force usage of a specific region of memory
Region of memory to be used, from ss to ss+nn.

+ mem=nn[KMG]#ss[KMG]
+ [KNL,BOOT,ACPI] Mark specific memory as ACPI data.
+ Region of memory to be used, from ss to ss+nn.
+
mem=nopentium [BUGS=IA-32] Disable usage of 4MB pages for kernel
memory.

--
Horseback riding is like software...
...vgf orggre jura vgf serr.

2003-02-26 22:29:37

by Andrew Grover

[permalink] [raw]
Subject: RE: mem= option for broken bioses

> From: Pavel Machek [mailto:[email protected]]
> I've seen broken bios that did not mark acpi tables in e820
> tables. This allows user to override it. Please apply,

OK, looks reasonable. Can you also gen up a patch documenting this in
kernel-parameters.txt?

Thanks -- Regards -- Andy

Subject: Re: [ACPI] Re: mem= option for broken bioses



Pavel Machek schrieb:

>Hi!
>
>
>
>>>From: Pavel Machek [mailto:[email protected]]
>>>I've seen broken bios that did not mark acpi tables in e820
>>>tables. This allows user to override it. Please apply,
>>>
>>>
>>OK, looks reasonable. Can you also gen up a patch documenting this in
>>kernel-parameters.txt?
>>
>>
>
>You can, assuming you took the patch ;-).
>
>
well how can i find the correct value`s to put in ??

> Pavel
>
>--- clean/Documentation/kernel-parameters.txt 2003-02-11 17:40:28.000000000 +0100
>+++ linux/Documentation/kernel-parameters.txt 2003-02-26 23:43:21.000000000 +0100
>@@ -516,6 +516,10 @@
> [KNL,BOOT] Force usage of a specific region of memory
> Region of memory to be used, from ss to ss+nn.
>
>+ mem=nn[KMG]#ss[KMG]
>+ [KNL,BOOT,ACPI] Mark specific memory as ACPI data.
>+ Region of memory to be used, from ss to ss+nn.
>+
> mem=nopentium [BUGS=IA-32] Disable usage of 4MB pages for kernel
> memory.
>
>
>

--
_____________________________________
*Robert Woerle
**Technical Support | Linux
PaceBlade Technology Europe SA*
phone: +49 89 552 99935
fax: +49 89 552 99910
mobile: +49 179 474 45 27
email: [email protected] <mailto:[email protected]>
web: http://www.paceblade.com
_____________________________________





2003-02-27 15:08:50

by Pavel Machek

[permalink] [raw]
Subject: Re: [ACPI] Re: mem= option for broken bioses

Hi!

> >>OK, looks reasonable. Can you also gen up a patch documenting this in
> >>kernel-parameters.txt?
> >>
> >>
> >
> >You can, assuming you took the patch ;-).
> >
> >
> well how can i find the correct value`s to put in ??

Well, similar method to how you use mem=123@456 parameters. You just
guess them. [Given kernel messages, it is actually quite easy.]


> >--- clean/Documentation/kernel-parameters.txt 2003-02-11
> >17:40:28.000000000 +0100
> >+++ linux/Documentation/kernel-parameters.txt 2003-02-26
> >23:43:21.000000000 +0100
> >@@ -516,6 +516,10 @@
> > [KNL,BOOT] Force usage of a specific region of memory
> > Region of memory to be used, from ss to ss+nn.
> >
> >+ mem=nn[KMG]#ss[KMG]
> >+ [KNL,BOOT,ACPI] Mark specific memory as ACPI data.
> >+ Region of memory to be used, from ss to ss+nn.
> >+
> > mem=nopentium [BUGS=IA-32] Disable usage of 4MB pages for kernel
> > memory.
> >


--
Horseback riding is like software...
...vgf orggre jura vgf serr.

2003-02-27 15:39:24

by Bruno Ducrot

[permalink] [raw]
Subject: Re: [ACPI] Re: mem= option for broken bioses

On Thu, Feb 27, 2003 at 04:19:07PM +0100, Pavel Machek wrote:
> Hi!
>
> > >>OK, looks reasonable. Can you also gen up a patch documenting this in
> > >>kernel-parameters.txt?
> > >>
> > >>
> > >
> > >You can, assuming you took the patch ;-).
> > >
> > >
> > well how can i find the correct value`s to put in ??
>
> Well, similar method to how you use mem=123@456 parameters. You just
> guess them. [Given kernel messages, it is actually quite easy.]
>

If I understand you, you then just have to mem= with the correct
value reported via, for example:

ducrot@novae:~$ dmesg | grep 'ACPI data'
BIOS-e820: 000000000fef0000 - 000000000feff000 (ACPI data)

Interresting :)

Ok. Here is actually a method:
A phoenix bios (and you have one) will reserved typically 64ko
for ACPI data below ACPI NVS.

ducrot@novae:~$ dmesg | grep -i 'ACPI NVS'
BIOS-e820: 000000000feff000 - 000000000ff00000 (ACPI NVS)
ducrot@novae:~$ python
Python 2.1.1+ (#1, Jan 8 2002, 00:37:12)
[GCC 2.95.4 20011006 (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> 0x000000000feff000 - 65536
267317248

If my bios will be incorrect, I will then pass
mem=267317248#65536
and voila.


But big problem though. It is really really strange that the
BIOS mainteners have broken e820 call, are you sure you have
enabled acpi in BIOS, and/or power management ?

Cheers,

--
Ducrot Bruno

-- Which is worse: ignorance or apathy?
-- Don't know. Don't care.

Subject: Re: [ACPI] Re: mem= option for broken bioses



Pavel Machek schrieb:

>Hi!
>
>
>
>>>>OK, looks reasonable. Can you also gen up a patch documenting this in
>>>>kernel-parameters.txt?
>>>>
>>>>
>>>>
>>>>
>>>You can, assuming you took the patch ;-).
>>>
>>>
>>>
>>>
>>well how can i find the correct value`s to put in ??
>>
>>
>
>Well, similar method to how you use mem=123@456 parameters. You just
>guess them. [Given kernel messages, it is actually quite easy.]
>
>
>
well .. wow ... what a accurate solution `????
...
..
.
well cant you tell me more ?

>
>
>>>--- clean/Documentation/kernel-parameters.txt 2003-02-11
>>>17:40:28.000000000 +0100
>>>+++ linux/Documentation/kernel-parameters.txt 2003-02-26
>>>23:43:21.000000000 +0100
>>>@@ -516,6 +516,10 @@
>>> [KNL,BOOT] Force usage of a specific region of memory
>>> Region of memory to be used, from ss to ss+nn.
>>>
>>>+ mem=nn[KMG]#ss[KMG]
>>>+ [KNL,BOOT,ACPI] Mark specific memory as ACPI data.
>>>+ Region of memory to be used, from ss to ss+nn.
>>>+
>>> mem=nopentium [BUGS=IA-32] Disable usage of 4MB pages for kernel
>>> memory.
>>>
>>>
>>>
>
>
>
>

--
_____________________________________
*Robert Woerle
**Technical Support | Linux
PaceBlade Technology Europe SA*
phone: +49 89 552 99935
fax: +49 89 552 99910
mobile: +49 179 474 45 27
email: [email protected] <mailto:[email protected]>
web: http://www.paceblade.com
_____________________________________





2003-02-27 16:01:46

by Pavel Machek

[permalink] [raw]
Subject: Re: [ACPI] Re: mem= option for broken bioses

Hi!

> > > >>OK, looks reasonable. Can you also gen up a patch documenting this in
> > > >>kernel-parameters.txt?
> > > >>
> > > >>
> > > >
> > > >You can, assuming you took the patch ;-).
> > > >
> > > >
> > > well how can i find the correct value`s to put in ??
> >
> > Well, similar method to how you use mem=123@456 parameters. You just
> > guess them. [Given kernel messages, it is actually quite easy.]
> >
>
> If I understand you, you then just have to mem= with the correct
> value reported via, for example:
>
> ducrot@novae:~$ dmesg | grep 'ACPI data'
> BIOS-e820: 000000000fef0000 - 000000000feff000 (ACPI data)

Well, for you bios map is okay and you don't need mem= parameter.

> But big problem though. It is really really strange that the
> BIOS mainteners have broken e820 call, are you sure you have
> enabled acpi in BIOS, and/or power management ?

Yes, what I needed was bios update. If you downgrade your bios you can
provoke same bug I saw.

--
Horseback riding is like software...
...vgf orggre jura vgf serr.

2003-02-27 16:06:00

by Pavel Machek

[permalink] [raw]
Subject: Re: [ACPI] Re: mem= option for broken bioses

Hi!

> >Well, similar method to how you use mem=123@456 parameters. You just
> >guess them. [Given kernel messages, it is actually quite easy.]
> >
> >
> >
> well .. wow ... what a accurate solution `????
> ...
> ..
> .
> well cant you tell me more ?

Well, you know where acpi tables start from dmesg. You can only guess
how long tables are, through.
Pavel
--
Horseback riding is like software...
...vgf orggre jura vgf serr.

2003-02-27 23:38:02

by H. Peter Anvin

[permalink] [raw]
Subject: Re: mem= option for broken bioses

Followup to: <[email protected]>
By author: "Grover, Andrew" <[email protected]>
In newsgroup: linux.dev.kernel
>
> > From: Pavel Machek [mailto:[email protected]]
> > I've seen broken bios that did not mark acpi tables in e820
> > tables. This allows user to override it. Please apply,
>
> OK, looks reasonable. Can you also gen up a patch documenting this in
> kernel-parameters.txt?
>

This is very much *NOT* reasonable. In fact, screwing around with the
syntax of the mem= parameter is poison. I know it has already
happened, and those changes need to be reverted and the new stuff
moved to a different option.

The mem= option is unique in that it is an option that affects both
the boot loader and the kernel. Therefore, ITS SYNTAX MUST NOT
CHANGE.

-hpa
--
<[email protected]> at work, <[email protected]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: cris ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

2003-03-04 10:09:36

by Pavel Machek

[permalink] [raw]
Subject: Re: mem= option for broken bioses

Hi!

> > > I've seen broken bios that did not mark acpi tables in e820
> > > tables. This allows user to override it. Please apply,
> >
> > OK, looks reasonable. Can you also gen up a patch documenting this in
> > kernel-parameters.txt?
> >
>
> This is very much *NOT* reasonable. In fact, screwing around with the
> syntax of the mem= parameter is poison. I know it has already
> happened, and those changes need to be reverted and the new stuff
> moved to a different option.
>
> The mem= option is unique in that it is an option that affects both
> the boot loader and the kernel. Therefore, ITS SYNTAX MUST NOT
> CHANGE.

This should be commented, somewhere.
Why is mem= option used by boot loader?
Does your bootloader really parse stuff
like mem=exactmap?
--
Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...

2003-03-04 14:11:34

by H. Peter Anvin

[permalink] [raw]
Subject: Re: mem= option for broken bioses

Pavel Machek wrote:
>
> This should be commented, somewhere.

It's commented in Documentation/i386/boot.txt as well as the
kernel-options file. *ALL* i386 boot loaders need to obey this,
unfortunately, because of how the initrd protocol was defined.

> Why is mem= option used by boot loader?
> Does your bootloader really parse stuff
> like mem=exactmap?

No, and that's exactly the problem. A whole bunch of crap was added to
mem= retroactively (over my explicit objections), and that broke the
boot protocol.

-hpa