[IOEMU] Fix Linux smp guest hangs with complaint "BUG: soft lock detected on CPU#0"
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 13 Nov 2006 09:46:05 +0000 (09:46 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 13 Nov 2006 09:46:05 +0000 (09:46 +0000)
commit10967e5464496c90d21bdeec06ed74a6887b0bc1
tree25e2788317b578dcacda96fe46faec707adb9901
parent2fb11436696664b01b06f54224ca2843820424e1
[IOEMU] Fix Linux smp guest hangs with complaint "BUG: soft lock detected on CPU#0"

When console=ttyS0 in guest grub configuration and serial='pty' in vmx
configure file. The root cause to this bug is the characteristic of
PTY emulator in Qemu. PTY has write/read end with some buffer. Write
to a buffer will be failed after the buffer is full until read end
reads the data from buffer.

Previous to changeset 12026, write to serial port would fail quietly
when buffer for pty is full. With changeset 12026, write to serial
port would retry 3 times in 300ms if failed, even without notifying
guest using serial irq. Smp guest will hang, waiting for an
interrupt. For SMP guest, a watchdog thread should be executed
periodically, otherwise soft lockup is detected. With this patch, an
upper threshold of total consecutive retries is added and serial
interrupt would be sent after retry 3 times for each write request,
even if failed.

Signed-off-by: Xinmei Huang <xinmei.huang@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/ioemu/hw/serial.c