Add pvpanic device driver

pvpanic device is used to notify host(qemu) when guest panic happens.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Minor - explicitly close files in buildrom.py.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Minor - move "tracked memory alloc" code in pmm.c.

Move the "pmm_malloc" code closer to the low level alloc functions it
calls.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Introduce and convert pmm code to use standard list helpers.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Minor - relocate code in stacks.c to keep low-level thread code together.

Just code movement - no actual code changes.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Introduce helper function have_threads() in stacks.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert stacks.c to use standard list manipulation code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert boot.c to use standard list manipulation code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert pciinit.c to use standard list manipulation code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert PCIDevices list to use standard list manipultion code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
config: allow DEBUG_IO for !QEMU

Make DEBUG_IO depend on QEMU_HARDWARE instead of QEMU, so
it can be enabled for seabios builds running indirectly
(coreboot, csm) on qemu.

Add runtime check for PF_QEMU to debug port console to make
sure we don't poke on random ports on physical hardware.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
coreboot: add qemu detection
Revert "Convert pciinit.c to use standard list manipulation code."

This reverts commit aab42152881dc62b37f1833e79cbdb3dfa51603b.
Fix error in hlist_for_each_entry_safe macro.

Fix broken macro - it did not work correctly at all.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert pciinit.c to use standard list manipulation code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
tweak coreboot qemu detection

I have patches for coreboot in the queue adding q35 support there,
which will change the mainboard names (adding the detected chipset).
Make SeaBIOS check the mainboard name starts with "QEMU" instead of
doing a full string match to handle this.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
make qemu_cfg_init depend on QEMU_HARDWARE instead of QEMU

Gets qemu features like direct kernel boot and boot
ordering going when seabios runs on coreboot.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Another fix for hlist_for_each_entry_safe.

Although the previous patch does fix hlist_for_each_entry_safe for the
common case, it doesn't work correctly when deleting the current
node.  To fix this, introduce two macros - hlist_for_each_entry_safe
for iterating through a list that can be modified, and
hlist_for_each_entry_pprev for those users that only need access to
the "pprev" pointer.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Minor - remove debugging dprintf added to pciinit.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Fix USB EHCI detection that was broken in hlist conversion of PCIDevices.

Make sure the PCI device list is ordered in bus order.

Don't iterate past the end of the list when detecting EHCI devices.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>