Commit 76525988 authored by Marc Zyngier's avatar Marc Zyngier Committed by Will Deacon
Browse files

kvm tools: console: unconditionally output to any console



Kvmtool suppresses any output to a console that has not been elected
as *the* console.

While this makes sense on the input side (we want the input to be sent
to one console driver only), it seems to be the wrong thing to do on
the output side, as it effectively prevents the guest from switching
from one console to another (think earlyprintk using 8250 to virtio
console).

After all, the guest *does* poke this device and outputs something
there.

Just remove the kvm->cfg.active_console test from the output paths.

Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent d8bd1e1f
......@@ -100,8 +100,7 @@ static void serial8250_flush_tx(struct kvm *kvm, struct serial8250_device *dev)
dev->lsr |= UART_LSR_TEMT | UART_LSR_THRE;
if (dev->txcnt) {
if (kvm->cfg.active_console == CONSOLE_8250)
term_putc(dev->txbuf, dev->txcnt, dev->id);
term_putc(dev->txbuf, dev->txcnt, dev->id);
dev->txcnt = 0;
}
}
......
......@@ -50,10 +50,7 @@ static unsigned long h_put_term_char(struct kvm_cpu *vcpu, unsigned long opcode,
do {
int ret;
if (vcpu->kvm->cfg.active_console == CONSOLE_HV)
ret = term_putc_iov(&iov, 1, 0);
else
ret = 0;
ret = term_putc_iov(&iov, 1, 0);
if (ret < 0) {
die("term_putc_iov error %d!\n", errno);
}
......
......@@ -53,8 +53,7 @@ static void rtas_put_term_char(struct kvm_cpu *vcpu,
{
char c = rtas_ld(vcpu->kvm, args, 0);
if (vcpu->kvm->cfg.active_console == CONSOLE_HV)
term_putc(&c, 1, 0);
term_putc(&c, 1, 0);
rtas_st(vcpu->kvm, rets, 0, 0);
}
......
......@@ -102,10 +102,7 @@ static void virtio_console_handle_callback(struct kvm *kvm, void *param)
while (virt_queue__available(vq)) {
head = virt_queue__get_iov(vq, iov, &out, &in, kvm);
if (kvm->cfg.active_console == CONSOLE_VIRTIO)
len = term_putc_iov(iov, out, 0);
else
len = 0;
len = term_putc_iov(iov, out, 0);
virt_queue__set_used_elem(vq, head, len);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment