From: Pekka Enberg Date: Mon, 10 Jan 2011 19:46:37 +0000 (+0200) Subject: kvm,8250: Fix "too much work for irq4" problems X-Git-Tag: next-20110824~3^2~523 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c7344091badfdb8fd3a23a4bfa2d22be8c84515e;p=karo-tx-linux.git kvm,8250: Fix "too much work for irq4" problems This patch fixes the "too much work for irq4" problems caused by the fact that we never set the UART_IIR_NO_INT flag in the emulation layer. This makes the interrupt handler in the guest kernel process as much as possible which triggers a warning. Signed-off-by: Pekka Enberg --- diff --git a/tools/kvm/8250-serial.c b/tools/kvm/8250-serial.c index 6056ed6b30d0..834c523f4cff 100644 --- a/tools/kvm/8250-serial.c +++ b/tools/kvm/8250-serial.c @@ -23,6 +23,8 @@ struct serial8250_device { uint8_t mcr; uint8_t lsr; uint8_t scr; + + uint8_t counter; }; static struct serial8250_device devices[] = { @@ -37,11 +39,15 @@ static struct serial8250_device devices[] = { [1] = { .iobase = 0x2f8, .irq = 3, + + .iir = UART_IIR_NO_INT, }, /* ttyS2 */ [2] = { .iobase = 0x3e8, .irq = 4, + + .iir = UART_IIR_NO_INT, }, }; @@ -158,6 +164,11 @@ static bool serial8250_out(struct kvm *self, uint16_t port, void *data, int size } fflush(stdout); + if (dev->counter++ > 10) { + dev->iir = UART_IIR_NO_INT; + dev->counter = 0; + } + break; } case UART_IER: @@ -200,6 +211,8 @@ static bool serial8250_in(struct kvm *self, uint16_t port, void *data, int size, switch (offset) { case UART_TX: if (dev->lsr & UART_LSR_DR) { + dev->iir = UART_IIR_NO_INT; + dev->lsr &= ~UART_LSR_DR; ioport__write8(data, dev->thr); }