Re: [PATCH 1/11] QEMU/KVM: Fix deadlocks in monitor and debugger

Avi Kivity
2008-05-27T13:09:05Z

Jan Kiszka wrote:
> Avi Kivity wrote:
>
>> Jan Kiszka wrote:
>>
>>> Some monitor commands as well as the vm_stop() issued by the gdbstub on
>>> external interruption so far deadlock on vcpu locks in the kernel. Patch
>>> below resolves the issue by temporarily or permanently stopping all vcpu
>>> threads before issuing the related KVM IOCTLs. It enables, e.g., to
>>> break into guest code spinning in the vcpu and to use things like "info
>>> cpus" in the monitor.
>>>
>>>
>> I implemented the alternative on_vcpu() approach for this (similar to
>> smp_call_function_single in the kernel) which solves the livelock
>> without resorting to stopping the VM.
>>
>
> I assume this pattern should then be applied to kvm_guest_debug (and
> later on kvm_set_guest_debug) as well? You missed to fix that bug.
>

Yeah, I just patched the register stuff so I could test on_vcpu().

> Here is a quick patch to complete the work, will post rebased versions
> of my remaining patches later today:
> -----------
>
> Use on_vcpu to call into kvm_guest_debug.

Applied that, thanks.

> Fix on_vpuc usage in
> kvm_load_registers.
>

How embarrasing. I had that queued already, though.

--
error compiling committee.c: too many arguments to function