Rebased to version 1.7.5

Support for obtaining SMBIOS tables directly from QEMU.
XHCI USB controller fixes for real hardware
seavgabios: New driver for coreboot native vga support
seavgabios: Improved detection of x86emu versions with incorrect
emulation.
Several bug fixes and code cleanups
This commit is contained in:
Cole Robinson 2014-05-31 13:35:30 -04:00
parent 699be187e4
commit e43370956f
3 changed files with 11 additions and 133 deletions

View File

@ -1,54 +0,0 @@
From 5f2d17d35b2339526f3b3d580b279ea78e406a25 Mon Sep 17 00:00:00 2001
Message-Id: <5f2d17d35b2339526f3b3d580b279ea78e406a25.1394734933.git.crobinso@redhat.com>
From: Laszlo Ersek <lersek@redhat.com>
Date: Wed, 15 Jan 2014 02:48:40 +0100
Subject: [PATCH] init_virtio_scsi(): reset the HBA before freeing its virtio
ring
When init_virtio_scsi() finds no SCSI targets connected to the HBA, it
frees the virtio ring. Other code in SeaBIOS proceeds to overwrite the
area. However, the ring is in use by qemu at that point -- not only did we
report the (ACK|DRIVER|DRIVER_OK) status earlier, we even communicated
over the ring.
Of course SeaBIOS doesn't "kick" the HBA ever again, hence qemu has no
reason to look at the ring. However, when qemu uses KVM acceleration, and
ioeventfd is enabled for the HBA, then a vmstate change to "running"
(including stop->cont monitor commands and incoming migration) "forces" a
kick (see qemu commit 25db9ebe). Qemu then tries to interpret whatever
unrelated guest data is in the HBA's original ring area, as virtio
protocol. Qemu exits upon seeing the garbage.
init_virtio_scsi() should reset the HBA before allowing the virtio ring
memory to be reused. Device reset causes the hypervisor to drop its
references.
This change is justified / underpinned by pure virtio-spec compliance as
well.
Related RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1013418
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
src/hw/virtio-scsi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c
index 4b4ec7b..48fb3e1 100644
--- a/src/hw/virtio-scsi.c
+++ b/src/hw/virtio-scsi.c
@@ -158,8 +158,10 @@ init_virtio_scsi(struct pci_device *pci)
for (tot = 0, i = 0; i < 256; i++)
tot += virtio_scsi_scan_target(pci, ioaddr, vq, i);
- if (!tot)
+ if (!tot) {
+ vp_reset(ioaddr);
goto fail;
+ }
return;
--
1.8.5.3

View File

@ -1,6 +1,6 @@
Name: seabios
Version: 1.7.4
Release: 5%{?dist}
Version: 1.7.5
Release: 1%{?dist}
Summary: Open-source legacy BIOS implementation
Group: Applications/Emulators
@ -19,12 +19,6 @@ Source16: config.coreboot
Source17: config.seabios-128k
Source18: config.seabios-256k
# Fix kvm migration with empty virtio-scsi controller (bz #1032208)
Patch0001: 0001-init_virtio_scsi-reset-the-HBA-before-freeing-its-vi.patch
# Fix freebsd problem
Patch0002: vgabios-attempt-to-detect-old-x86emu-and-force-a-fault.diff
BuildRequires: python iasl
BuildRequires: binutils-x86_64-linux-gnu gcc-x86_64-linux-gnu
@ -77,11 +71,6 @@ SeaVGABIOS is an open-source VGABIOS implementation.
%prep
%setup -q
# Fix kvm migration with empty virtio-scsi controller (bz #1032208)
%patch0001 -p1
# Fix running freebsd (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737142)
%patch0002 -p1
# Makefile changes version to include date and buildhost
sed -i 's,VERSION=%{version}.*,VERSION=%{version},g' Makefile
@ -148,6 +137,15 @@ install -m 0644 binaries/vgabios*.bin $RPM_BUILD_ROOT%{_datadir}/seavgabios
%changelog
* Sat May 31 2014 Cole Robinson <crobinso@redhat.com> - 1.7.5-1
- Rebased to version 1.7.5
- Support for obtaining SMBIOS tables directly from QEMU.
- XHCI USB controller fixes for real hardware
- seavgabios: New driver for "coreboot native vga" support
- seavgabios: Improved detection of x86emu versions with incorrect
emulation.
- Several bug fixes and code cleanups
* Wed Mar 26 2014 Matthias Clasen <mclasen@redhat.com> 1.7.4-5
- Fix booting FreeBSD VMs in virt-manager

View File

@ -1,66 +0,0 @@
From: Kevin O'Connor <kevin@koconnor.net>
Date: Wed Feb 5 22:47:29 2014 -0500
Subject: vgabios: Attempt to detect old x86emu and force a fault.
Upstream-Commit: 8032b8a0fec550de5cb2f7d37aa031cebc2200c3
Bug-Debian: http://bugs.debian.org/737142
Check for cases where the leal instruction does not work. This
instruction is known to not be emulated properly on old versions of
x86emu. If a broken version of x86emu is found, force a fault that
x86emu will easily detect. This should help prevent soft failures
when running old software.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
diff --git a/vgasrc/vgaentry.S b/vgasrc/vgaentry.S
index 9854448..6e31c4e 100644
--- a/vgasrc/vgaentry.S
+++ b/vgasrc/vgaentry.S
@@ -45,9 +45,26 @@ _rom_header_signature:
* Entry points
****************************************************************/
- // This macro is the same as ENTRY_ARG except the "calll"
- // instruction is avoided to work around known issues in the
- // emulation of some versions of x86emu.
+ // Force a fault if found to be running on broken x86emu versions.
+ DECLFUNC x86emu_fault
+x86emu_fault:
+1: hlt
+ jmp 1b
+
+ // This macro implements a call while avoiding instructions
+ // that old versions of x86emu have problems with.
+ .macro VGA_CALLL cfunc
+ // Make sure leal instruction works.
+ movl $0x8000, %ecx
+ leal (%ecx, %ecx, 1), %ecx
+ cmpl $0x10000, %ecx
+ jne x86emu_fault
+ // Use callw instead of calll
+ push %ax
+ callw \cfunc
+ .endm
+
+ // This macro is the same as ENTRY_ARG except VGA_CALLL is used.
.macro ENTRY_ARG_VGA cfunc
cli
cld
@@ -57,7 +74,7 @@ _rom_header_signature:
movl %esp, %ebx // Backup %esp, then zero high bits
movzwl %sp, %esp
movl %esp, %eax // First arg is pointer to struct bregs
- pushw %ax ; callw \cfunc
+ VGA_CALLL \cfunc
movl %ebx, %esp // Restore %esp (including high bits)
POPBREGS
.endm
@@ -103,7 +120,7 @@ entry_10_extrastack:
movw %ds, %dx // Setup %ss/%esp and call function
movw %dx, %ss
movl %eax, %esp
- pushw %ax ; callw handle_10
+ VGA_CALLL handle_10
movl %esp, %eax // Restore registers and return
movw BREGS_size+4(%eax), %ss