From: "Bjørn Mork" <bjorn@mork.no>
To: Kevin O'Connor <kevin@koconnor.net>
Cc: Brandon Bennett <bennetb@gmail.com>,
seabios@seabios.org, qemu-devel@nongnu.org,
Gleb Natapov <gleb@redhat.com>
Subject: Re: [Qemu-devel] SeaBIOS error with Juniper FreeBSD kernel
Date: Fri, 08 Jul 2011 09:46:32 +0200 [thread overview]
Message-ID: <87fwmh9puv.fsf@nemi.mork.no> (raw)
In-Reply-To: <20110707235009.GB12991@morn.localdomain> (Kevin O'Connor's message of "Thu, 7 Jul 2011 19:50:09 -0400")
"Kevin O'Connor" <kevin@koconnor.net> writes:
> On Thu, Jul 07, 2011 at 05:45:02PM +0200, Bjørn Mork wrote:
>> It's been a while with little work and little progress on my side... But
>> I looked at this again today, and found that it may be related to the
>> SMBIOS table being allocated with malloc_high(). Does that make sense?
>>
>> Anyway, the problematic OS boots without problems with current seabios
>> from git if I make this change:
>>
>> diff --git a/src/smbios.c b/src/smbios.c
>> index 8df0f2d..c96deb5 100644
>> --- a/src/smbios.c
>> +++ b/src/smbios.c
>> @@ -17,7 +17,7 @@ smbios_entry_point_init(u16 max_structure_size,
>> u16 number_of_structures)
>> {
>> struct smbios_entry_point *ep = malloc_fseg(sizeof(*ep));
>> - void *finaltable = malloc_high(structure_table_length);
>> + void *finaltable = malloc_fseg(structure_table_length);
>> if (!ep || !finaltable) {
>> warn_noalloc();
>> free(ep);
>
> Thanks.
>
> It's possible that the OS has an error in handling the SMBIOS when it
> is in high-memory (located above 1meg). (For example, older versions
> of Linux crash when the mptable is in high memory.)
I looked at a couple of physical machines with vendor BIOSes, and they
seem to put the table in low memory:
# dmidecode 2.9
SMBIOS 2.4 present.
71 structures occupying 2506 bytes.
Table at 0x000F06F0.
# dmidecode 2.9
SMBIOS 2.4 present.
80 structures occupying 2858 bytes.
Table at 0x000E0010.
Makes me think that this would be the safest approach for SeaBIOS as
well. With the patch above, I get this location:
# dmidecode 2.9
SMBIOS 2.4 present.
10 structures occupying 263 bytes.
Table at 0x000FDA00.
Without it, I get:
# dmidecode 2.9
SMBIOS 2.4 present.
10 structures occupying 263 bytes.
Table at 0x1FFFFEF0.
> However, it would be really odd for the OS to work some times with the
> SMBIOS in high memory and sometimes fail.
Yes. Just to be perfectly clear: The crash with SMBIOS in high memory
happens every time with "recent" (anything from 2009 or later) SeaBIOS
versions.
I must admit that I right now am wondering whether I somehow screwed up
the previous testing of older versions. I am not at all sure under what
circumstances older SeaBIOS would work with SMBIOS enabled.
>> I tried malloc_low() too, and that works as well. But malloc_fseg()
>> seems appropriate, unless I've misunderstood something here. Which very
>> well can be. I am not going to claim any understanding at all.
>
> malloc_low and malloc_fseg would both put the table in the first
> megabyte of physical ram. Of the two, malloc_fseg would be
> preferable.
That's what I thought. Glad I could be right about something :-)
>> Does the above make any sense, or is this just another example of
>> "tickling the underlying bug"?
>
> I have to wonder if the reorganization of memory just caused the bug
> to not pop up. If you disable SMBIOS, can you confirm the problem
> reliably goes away on multiple versions of SeaBIOS?
Yes. Tested with current HEAD and with a number of revisions around the
beginning of 2009, i.e. version 0.4.0. Just to be sure, I selected an
intermediate version as well: 0.5.1. And I can confirm that the problem
goes away there too when I disable SMBIOS.
Bjørn
next prev parent reply other threads:[~2011-07-08 7:46 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-21 0:23 [Qemu-devel] SeaBIOS error with Juniper FreeBSD kernel Brandon Bennett
2010-02-21 4:05 ` Kevin O'Connor
2010-02-21 23:04 ` Brandon Bennett
2010-02-21 23:18 ` Brandon Bennett
2010-02-22 2:56 ` [Qemu-devel] SeaBIOS error with Nextstep bootloader Natalia Portillo
2010-02-28 19:51 ` Kevin O'Connor
2010-03-01 2:00 ` Natalia Portillo
2010-03-11 9:44 ` Natalia Portillo
2010-03-12 1:59 ` Kevin O'Connor
2010-03-12 9:05 ` Natalia Portillo
2010-03-13 6:30 ` Roy Tam
2010-03-13 14:42 ` [Qemu-devel] PS/2 mouse emulation problems Natalia Portillo
2010-03-13 14:44 ` [Qemu-devel] " Roy Tam
2010-03-13 20:23 ` Kevin O'Connor
2010-03-14 2:49 ` Roy Tam
2010-03-14 3:11 ` Roy Tam
2010-03-14 3:43 ` Kevin O'Connor
2010-03-14 5:28 ` Roy Tam
2010-03-14 7:11 ` Kevin O'Connor
2010-03-13 16:52 ` [Qemu-devel] SeaBIOS error with Nextstep bootloader Kevin O'Connor
2010-02-28 19:39 ` [Qemu-devel] SeaBIOS error with Juniper FreeBSD kernel Kevin O'Connor
2010-02-28 20:41 ` Gleb Natapov
2010-04-13 18:48 ` [Qemu-devel] " Bjørn Mork
2010-04-14 1:27 ` Kevin O'Connor
2010-04-14 10:51 ` Bjørn Mork
2011-07-07 15:45 ` [Qemu-devel] " Bjørn Mork
2011-07-07 23:50 ` Kevin O'Connor
2011-07-08 7:46 ` Bjørn Mork [this message]
2011-07-10 20:41 ` Kevin O'Connor
2011-07-10 21:25 ` [Qemu-devel] [SeaBIOS] " Sebastian Herbszt
2011-07-11 23:33 ` Brandon Bennett
2011-08-01 13:49 ` Bjørn Mork
2011-08-02 0:36 ` Kevin O'Connor
2011-08-02 9:33 ` Bjørn Mork
2011-08-02 12:41 ` Kevin O'Connor
2011-08-03 12:42 ` Bjørn Mork
2011-08-03 13:31 ` Avi Kivity
2011-08-03 13:48 ` Bjørn Mork
2011-08-03 14:03 ` Avi Kivity
2011-08-03 23:48 ` Kevin O'Connor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fwmh9puv.fsf@nemi.mork.no \
--to=bjorn@mork.no \
--cc=bennetb@gmail.com \
--cc=gleb@redhat.com \
--cc=kevin@koconnor.net \
--cc=qemu-devel@nongnu.org \
--cc=seabios@seabios.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.