[SeaBIOS] wrong memsize in smbios_init()
herbszt at gmx.de
Thu Jan 7 21:52:57 CET 2010
Gleb Natapov wrote:
> On Wed, Jan 06, 2010 at 05:48:29PM -0500, Kevin O'Connor wrote:
>> On Wed, Jan 06, 2010 at 09:13:13PM +0100, Sebastian Herbszt wrote:
>> > RamSizeOver4G = "total ram" - "start of pci hole" (e.g. 0xe0000000
>> > in qemu, 0xc0000000 in bochs)
>> The intent of RamSizeOver4G is to list the amount of ram mapped above
>> 0x100000000. So, if one specified 4096MB of ram, I'd expect qemu to
>> map it so that SeaBIOS had RamSize=0xe0000000 and
>> >Adding 4GB is wrong. With 33 GB of RAM
>> > i end up with 16+16+2 instead of 16+16+1 in smbios tables.
>> > The patch below fixes it for me.
>> I'm not sure what smbios is expecting - if it's looking for the
>> addresses of mapped memory then the current code looks correct (in the
>> scenario above, memory is mapped up to 0x110000000). If it's looking
>> for the total memory, then I agree your change makes sense (in the
>> above scenario, the total ram is 0x100000000).
> It looks like different tables looks for different things,
> Table 16 describes how much memory board supports (should be
> bigger or equal to RamSizeOver4G+RamSize if hot plug memory is not
> supported I guess). Just picking a big enough number is good enough.
I would assume it should be RamSizeOver4G+RamSize if no spare memory
device slots are available (e.g. hotplugging not supported). Else picking a "big
enough number" is good enough indeed, 128 GB or something like that maybe.
Then it needs to define spare memory device slots tho, e.g. with 16 GB max. per
slot we end up with 8 slots. In a 4GB config it would be slot 1 with 4GB and slots
2-8 with 0 GB.
Might as well change the location value from "Other" to "System board or memory" too.
> Table 17 describes how much memory installed in each DIMM. Sum of all
> sizes should be equal to RamSizeOver4G+RamSize.
This currently is wrong in SeaBIOS (16+16+2 in my config). Even if memory consumed
by the pci hole is mapped above 4 GB it does not affect the physical memory layout.
Could also fix the error information handle value from invalid 0x0 to 0xfffe.
More information about the SeaBIOS