|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] About SIG_IPI handler |
Date: | Fri, 18 Apr 2014 00:46:41 -0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
Il 17/04/2014 01:51, Jan Kiszka ha scritto:
On 2014-04-17 07:46, Shiru Ren wrote:Hi, all I’m trying to figure out how do_savevm works in QEMU. But there is one thing has bothered me quite a lot. I found that vm_stop invoke qemu_cpu_kick_thread to send SIG_IPI to a vcpu thread, and I have understand that in TCG mode, the cpu_signal() function will be invoked as the SIG_IPI handler. But I don’t know what happens in KVM mode. Actually I can’t find the signal handler function. I only find a function named dummy_signal, and it doesn't do anything.This signal is handled synchronously in KVM mode, see qemu_kvm_eat_signals in cpus.c.
In addition to this, the signal is blocked in the VCPU thread always except during the KVM_RUN ioctl; see kvm_set_signal_mask which invokes the KVM_SET_SIGNAL_MASK ioctl and sets the different signal mask used for KVM_RUN. So the signal indeed causes the CPU thread to exit the vcpu thread even in KVM mode, but this happens inside the kernel module. QEMU doesn't have anything to do, it just "eats" the signal with sigwaitinfo.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |