From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 07/12] Rename kvm_apic_accept_pic_intr Date: Wed, 2 Dec 2009 18:12:49 +0200 Message-ID: <20091202161249.GB20102@redhat.com> References: <1259678201-11203-1-git-send-email-clalance@redhat.com> <1259678201-11203-8-git-send-email-clalance@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Chris Lalancette Return-path: Received: from mx1.redhat.com ([209.132.183.28]:32345 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbZLBQMo (ORCPT ); Wed, 2 Dec 2009 11:12:44 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB2GCoxo003014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Dec 2009 11:12:51 -0500 Content-Disposition: inline In-Reply-To: <1259678201-11203-8-git-send-email-clalance@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Dec 01, 2009 at 03:36:36PM +0100, Chris Lalancette wrote: > Call it kvm_apic_in_virtual_wire_mode, which is more > correct. Also change it to not only operate properly > on the boot CPU, but on any CPU. > Currently it is assumed that if kvm_cpu_has_interrupt() returns true kvm_cpu_get_interrupt() will return valid interrupt. After this change it may not be the case any more. Suppose there are more then one vcpus in a virtual wire mode. Pic receives interrupt and multiple cpus try to inject it simultaneously. They all check that interrupt is pending by calling kvm_cpu_has_interrupt() and then try to get the vector by calling kvm_cpu_get_interrupt(). Only one vcpu will get correct value, others will get spurious interrupt. -- Gleb.