[PATCH] kvm tools: Fix serial port probing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The process of probing the 8250 serial port is as follows:

1. Start detecting IRQs
2. Enable the IER register [At this point, the port is supposed to light
the INTR].
3. Stop detecting IRQs [At this point, the driver detects which IRQ belongs
to that port].
4. Disable IER register.

Since we weren't enabling and disabling the IRQ based on IER writes,
we would often fail the probing since the driver couldn't detect
which IRQ is used by the port, and would just default that to 0.

This would cause slowness and may have caused hangs. For me there is a
significant increase in speed of the terminal after this patch.

Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx>
---
 tools/kvm/hw/serial.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/hw/serial.c b/tools/kvm/hw/serial.c
index 67a2007..8cd47cf 100644
--- a/tools/kvm/hw/serial.c
+++ b/tools/kvm/hw/serial.c
@@ -233,6 +233,7 @@ static bool serial8250_out(struct ioport *ioport, struct kvm *kvm, u16 port, voi
 			break;
 		case UART_IER:
 			dev->ier	= ioport__read8(data) & 0x3f;
+			kvm__irq_line(kvm, dev->irq, dev->ier?1:0);
 			break;
 		case UART_LCR:
 			dev->lcr	= ioport__read8(data);
-- 
1.7.8

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux