Emulated serial port does not work with FreeBSD 8.0 guest
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kvm (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: kvm
I'm running a handful of Jaunty systems and this bug appears in kvm 1:84+dfsg-
Host:
$ lsb_release -rd
Description: Ubuntu 9.04
Release: 9.04
$
Description of bug:
If you start a FreeBSD 8.0 guest with "-serial telnet:
This is specific to FreeBSD 8.0. FreeBSD 7.1 and 7.2 guests did not exhibit this problem.
FreeBSD 8.0 uses a new uart(4) driver (/dev/ttyu0). Prior versions used sio(4) (/dev/ttyd0).
Proposed fix:
There is an upstream QEMU patch that fixes this.
I've rolled this patch into my PPA for kvm (among other changes): https:/
A debdiff for just this specific issue that fixes the problem is:
diff -u kvm-84+
--- kvm-84+
+++ kvm-84+
@@ -1,3 +1,11 @@
+kvm (1:84+dfsg-
+
+ * debian/
+ cherry-pick from upstream
+ - Fixes qemu serial vs. FreeBSD 8.0 uart(4) not working properly
+
+ -- Garry Dolley <email address hidden> Wed, 09 Dec 2009 03:53:31 -0800
+
kvm (1:84+dfsg-
* debian/
diff -u kvm-84+
diff -u kvm-84+
--- kvm-84+
+++ kvm-84+
@@ -17,0 +18 @@
+qemu-serial-
only in patch2:
unchanged:
--- kvm-84+
+++ kvm-84+
@@ -0,0 +1,37 @@
+commit 2d6ee8e7e17227d
+Author: Juergen Lock <email address hidden>
+Date: Sat Sep 12 18:52:22 2009 +0200
+
+ qemu serial: lost tx irqs (affecting FreeBSD's new uart(4) driver)
+
+ Well one problem seems to be the rx condition,
+ ... if ((s->ier & UART_IER_RDI) && (s->lsr & UART_LSR_DR))
+ is not enough to trigger an irq, yet still causes the following
+ conditions not to be checked anymore at all.
+
+ Signed-off-by: Juergen Lock <email address hidden>
+ Acked-by: Jan Kiszka <email address hidden>
+ Acked-by: Stefano Stabellini <email address hidden>
+ Signed-off-by: Aurelien Jarno <email address hidden>
+
+diff --git a/qemu/hw/serial.c b/qemu/hw/serial.c
+index 1f4ce77..a22770f 100644
+--- a/qemu/hw/serial.c
++++ b/qemu/hw/serial.c
+@@ -197,12 +197,10 @@ static void serial_
+ * this is not in the specification but is observed on existing
+ * hardware. */
+ tmp_iir = UART_IIR_CTI;
+- } else if ((s->ier & UART_IER_RDI) && (s->lsr & UART_LSR_DR)) {
+- if (!(s->fcr & UART_FCR_FE)) {
+- tmp_iir = UART_IIR_RDI;
+- } else if (s->recv_fifo.count >= s->recv_fifo.itl) {
+- tmp_iir = UART_IIR_RDI;
+- }
++ } else if ((s->ier & UART_IER_RDI) && (s->lsr & UART_LSR_DR) &&
++ (!(s->fcr & UART_FCR_FE) ||
++ s->recv_fifo.count >= s->recv_fifo.itl)) {
++ tmp_iir = UART_IIR_RDI;
+ } else if ((s->ier & UART_IER_THRI) && s->thr_ipending) {
+ tmp_iir = UART_IIR_THRI;
+ } else if ((s->ier & UART_IER_MSI) && (s->msr & UART_MSR_
My modified kvm package with the above patch runs about 80 production virtual machines of the following flavors: FreeBSD 7.1, 7.2, and 8.0; OpenBSD 4.5 and 4.6; Ubuntu 9.04; Debian 5.02; ArchLinux; and Gentoo. None of these have had any serial port problems after the above patch was applied.
Might be worth applying to Karmic or Lucid kvm packages if the QEMU upstream in those kvm packages do not already include it.
Hi,
This has been fixed on lucid already it might be a good candidate for an SRU.
Regards
chuck