From patchwork Mon Jun 21 15:29:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Lalancette X-Patchwork-Id: 107203 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5LFW6Kd004092 for ; Mon, 21 Jun 2010 15:32:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932808Ab0FUPcD (ORCPT ); Mon, 21 Jun 2010 11:32:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29386 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932797Ab0FUPcB (ORCPT ); Mon, 21 Jun 2010 11:32:01 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5LFW1tP026418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 Jun 2010 11:32:01 -0400 Received: from localhost.localdomain (dhcp-100-19-171.bos.redhat.com [10.16.19.171]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5LFW0Nt026887; Mon, 21 Jun 2010 11:32:00 -0400 From: Chris Lalancette To: kvm@vger.kernel.org Cc: Chris Lalancette Subject: [PATCH] Search the LAPIC's for one that will accept a PIC interrupt. Date: Mon, 21 Jun 2010 11:29:40 -0400 Message-Id: <1277134180-9806-1-git-send-email-clalance@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 21 Jun 2010 15:32:07 +0000 (UTC) diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c index 2c73f44..85ecabc 100644 --- a/arch/x86/kvm/i8259.c +++ b/arch/x86/kvm/i8259.c @@ -44,16 +44,25 @@ static void pic_unlock(struct kvm_pic *s) __releases(&s->lock) { bool wakeup = s->wakeup_needed; - struct kvm_vcpu *vcpu; + struct kvm_vcpu *vcpu, *found = NULL; + int i; s->wakeup_needed = false; raw_spin_unlock(&s->lock); if (wakeup) { - vcpu = s->kvm->bsp_vcpu; - if (vcpu) - kvm_vcpu_kick(vcpu); + kvm_for_each_vcpu(i, vcpu, s->kvm) { + if (kvm_apic_accept_pic_intr(vcpu)) { + found = vcpu; + break; + } + } + + if (!found) + found = s->kvm->bsp_vcpu; + + kvm_vcpu_kick(found); } }