From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Shiv1-0004WZ-Cp for qemu-devel@nongnu.org; Thu, 21 Jun 2012 11:03:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Shiuu-0000Td-Rt for qemu-devel@nongnu.org; Thu, 21 Jun 2012 11:03:34 -0400 Received: from thoth.sbs.de ([192.35.17.2]:16795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Shiuu-0000So-Hp for qemu-devel@nongnu.org; Thu, 21 Jun 2012 11:03:28 -0400 Message-ID: <4FE337A2.4030802@siemens.com> Date: Thu, 21 Jun 2012 17:02:58 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1340290158-11036-1-git-send-email-qemulist@gmail.com> <1340290158-11036-3-git-send-email-qemulist@gmail.com> In-Reply-To: <1340290158-11036-3-git-send-email-qemulist@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] kvm: use per-cpu lock to free vcpu thread out of the big lock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Ping Fan Cc: Liu Ping Fan , qemu-devel , "Anthony.Liguori.anthony@codemonkey.ws" On 2012-06-21 16:49, Liu Ping Fan wrote: > In order to break the big lock, using per-cpu_lock in kvm_cpu_exec() > to protect the race from other cpu's access to env->apic_state & related > field in env. > Also, we need to protect agaist run_on_cpu(). > > Race condition can be like this: > 1. vcpu-1 IPI vcpu-2 > vcpu-3 IPI vcpu-2 > Open window exists for accessing to vcpu-2's apic_state & env > > 2. run_on_cpu() write env->queued_work_last, while flush_queued_work() > read > How much of this is still relevant with the (nowadays default-on) in-kernel irqchips? Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux