On Sun, Feb 21, 2010 at 04:18:38PM -0700, Brandon Bennett wrote:
> > On Sat, Feb 20, 2010 at 9:05 PM, Kevin O'Connor <kevin(a)koconnor.net> wrote:
> >> Should a kernel fail during boot, I'd suspect it doesn't like one of
> >> the apm/pcibios callbacks, or it doesn't like one of the
> >> smbios/mptable/acpi tables. You could try compiling the SeaBIOS code
> >> (see http://seabios.org/Download ) and increasing the debugging by
> >> modifying src/config.h. Specifically, you could increase
> >> CONFIG_DEBUG_LEVEL, and set DEBUG_HDL_pcibios32 and DEBUG_HDL_apm to
> >> 1. Also, you could try disabling some of the features to see if that
> >> prevents the fault (eg, disabling CONFIG_ACPI / CONFIG_SMBIOS /
> >> CONFIG_MPTABLE).
> >
>
> I have narrowed it down to SMBIOS. If I disable CONFIG_SMBIOS the
> image boots up fine.
Gleb, have you seen this thread?
Some of the recent changes to smbios that look like possible culprits
are:
Make SMBIOS table pass MS SVVP test
Use MaxCountCPUs during building of per cpu tables.
Add malloc_high/fseg() and rework bios table creation to use them.
There were other changes, but the comments indicate they were only
ports of changes already in bochs. I suppose it's also possible the
lack of smbios is turning off some other feature in the guest (eg,
acpi) that's the real culprit.
-Kevin
Without this BIOS fails to remap 0xf0000 memory from ROM to RAM so writes
to F-segment modify ROM content instead of memory copy. Since QEMU does
not reloads ROMs during reset on next boot modified copy of BIOS is used.
Signed-off-by: Gleb Natapov <gleb(a)redhat.com>
diff --git a/hw/piix_pci.c b/hw/piix_pci.c
index 933ad86..0bf435d 100644
--- a/hw/piix_pci.c
+++ b/hw/piix_pci.c
@@ -99,10 +99,6 @@ static void i440fx_update_memory_mappings(PCII440FXState *d)
int i, r;
uint32_t smram, addr;
- if (kvm_enabled()) {
- /* FIXME: Support remappings and protection changes. */
- return;
- }
update_pam(d, 0xf0000, 0x100000, (d->dev.config[I440FX_PAM] >> 4) & 3);
for(i = 0; i < 12; i++) {
r = (d->dev.config[(i >> 1) + (I440FX_PAM + 1)] >> ((i & 1) * 4)) & 3;
--
Gleb.
On 09/25/2010 09:55 AM, Kevin O'Connor wrote:
> Enable rom size to be over 128K.
>
> Apparently, only the first 128K of the rom are mirrored to the
> 0xc0000-0xfffff area under qemu, so make sure to copy the rom (via
> make_bios_writable) in the non-init part of the startup code. This
> ensure the copy code is itself available.
This is pretty typical... the BIOS is supposed to fit within the
0xe0000..0xfffff area during actual execution.
-hpa
Enable rom size to be over 128K.
Apparently, only the first 128K of the rom are mirrored to the
0xc0000-0xfffff area under qemu, so make sure to copy the rom (via
make_bios_writable) in the non-init part of the startup code. This
ensure the copy code is itself available.
---
src/post.c | 13 ++++++-------
tools/checkrom.py | 2 ++
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/post.c b/src/post.c
index 4a75f51..a72b8cd 100644
--- a/src/post.c
+++ b/src/post.c
@@ -321,18 +321,11 @@ reloc_init(void)
func();
}
-static int HaveRunPost;
-
// Start of Power On Self Test (POST) - the BIOS initilization phase.
// This function sets up for and attempts relocation of the init code.
void VISIBLE32INIT
post(void)
{
- // Allow writes to modify bios area (0xf0000)
- make_bios_writable();
-
- HaveRunPost = 1;
-
// Detect ram and setup internal malloc.
memmap_setup();
qemu_cfg_port_probe();
@@ -347,6 +340,8 @@ post(void)
* POST entry point
****************************************************************/
+static int HaveRunPost;
+
// Attempt to invoke a hard-reboot.
static void
tryReboot(void)
@@ -385,6 +380,10 @@ _start(void)
// This is a soft reboot - invoke a hard reboot.
tryReboot();
+ // Allow writes to modify bios area (0xf0000)
+ make_bios_writable();
+ HaveRunPost = 1;
+
// Perform main setup code.
post();
}
diff --git a/tools/checkrom.py b/tools/checkrom.py
index 42cf2df..6309528 100755
--- a/tools/checkrom.py
+++ b/tools/checkrom.py
@@ -24,6 +24,8 @@ def main():
finalsize = 64*1024
if datasize > 64*1024:
finalsize = 128*1024
+ if datasize > 128*1024:
+ finalsize = 256*1024
# Sanity checks
start = symbols['code32flat_start'].offset
--
1.7.2.3
Patches pending:
Eduard - Gabriel Munteanu: 20100828:
iommu: introduce AMD IOMMU support, initialize it
* Likely for post v0.6.1 release
Isaku Yamahata: 20100722:
acpi: allow qemu to load dsdt as external acpi table.
* Needs resolution on acpi patches
Isaku Yamahata: 20100819:
seabios: acpi: add mcfg table.
* Needs resolution on acpi patches
Patches pending with author:
Isaku Yamahata: 20100726:
seabios: pciinit: fix overflow when bar allocation.
* Isaku was looking at another approach
Sebastian Herbszt: 20100731:
EDD fixes
* Initial patch looked like it may break backwards compatibility; I
haven't seen a new patch.
Patches not applied:
Arseny Klimovsky: 20100621:
Added ACPI SLIC table
* There was no explicit patch sent, and approach (eg, recompile
seabios) doesn't look scalable.
Eduardo Habkost: 20100618:
Allow acpi and smbios default strings to be set on config.h
* Should no longer be needed now that smbios strings can be passed
in via fwcfg.
Christopher Gautier: 20100723:
Impossible to distinguish between two '/' keys
* No explicit patch sent, and I didn't understand the description.
Gleb Natapov: 20100614:
load hpet info for HPET ACPI table from qemu
* Gleb withdrew this patch due to a bug. Concept is pending ACPI
resolution.
Please let me know if I've missed any thing.
-Kevin
This patch series enables SeaBIOS to relocate itself out of the
e-segment, which enables that space to be used by optionroms.
Before this patch series, SeaBIOS would typically use about half of
the e-segment. A full debugging build could use nearly all of the
e-segment. With this series, SeaBIOS shouldn't need anything beyond
the standard f-segment. Future features can likely be added without
fear of limiting optionroms.
To support relocation, the build determines which parts of the 32bit
code is one-time initialization code. It separates that out and
stores relocation information for it. The run-time code can then copy
the initialization code to high memory and run it at that location.
The one-time init code could be called again on a soft-reboot, but
SeaBIOS now detects this case and attempts a hard-reboot.
Unfortunately, both qemu and kvm don't appear to have a reliable way
to hard-reboot - normal reboots don't reset the 0xc0000-0xfffff
memory. I've worked around this on qemu by manually resetting that
memory. However, kvm doesn't keep a pristine copy of the bios at
0xffff0000. Until this is fixed, this patch series will cause a
soft-reboot on kvm to result in a shutdown instead of a reboot.
Some details on the patches: Patches 1-4 enhance the build scripts.
Patches 5-7 handle soft-reboots. Patches 8-11 enhance the runtime to
support relocation.
-Kevin
Kevin O'Connor (11):
Use str.startswith() in python scripts.
Modify tools/layoutrom.py to use classes instead of tuples.
Separate out init code from the rest of the 32bit flat code.
Enhance build to emit relocation information.
Try to hard-reboot processor on rerun of post under coreboot.
Don't do shadow copying of optionroms when
CONFIG_OPTIONROMS_DEPLOYED.
Try to hard-reboot on rerun of post even on emulators.
Add memalign_tmp() helper function.
Move init code from _start() to post().
Move the 32bit init code to high memory at runtime.
Enable optionroms to use freed space due to CONFIG_RELOCATE_INIT.
Makefile | 6 +-
src/apm.c | 14 +-
src/config.h | 2 +
src/ioport.h | 1 +
src/optionroms.c | 18 ++-
src/pci.c | 10 +
src/pci.h | 1 +
src/pmm.c | 8 -
src/post.c | 164 +++++++++++++++---
src/ps2port.c | 16 ++-
src/ps2port.h | 3 +-
src/shadow.c | 40 +++--
src/stacks.c | 4 +-
src/types.h | 10 +-
src/util.h | 13 ++-
tools/checkrom.py | 9 +-
tools/checkstack.py | 14 +-
tools/layoutrom.py | 465 ++++++++++++++++++++++++++++++++-------------------
18 files changed, 535 insertions(+), 263 deletions(-)
--
1.7.2.3