From patchwork Tue Dec 1 14:36:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Lalancette X-Patchwork-Id: 63973 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB1EbWa3013519 for ; Tue, 1 Dec 2009 14:37:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752809AbZLAOhN (ORCPT ); Tue, 1 Dec 2009 09:37:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753165AbZLAOhL (ORCPT ); Tue, 1 Dec 2009 09:37:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38083 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753462AbZLAOhF (ORCPT ); Tue, 1 Dec 2009 09:37:05 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB1EbBdX020029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Dec 2009 09:37:11 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB1Eb36Q002533; Tue, 1 Dec 2009 09:37:10 -0500 From: Chris Lalancette To: kvm@vger.kernel.org Cc: Chris Lalancette Subject: [PATCH 07/12] Rename kvm_apic_accept_pic_intr Date: Tue, 1 Dec 2009 15:36:36 +0100 Message-Id: <1259678201-11203-8-git-send-email-clalance@redhat.com> In-Reply-To: <1259678201-11203-1-git-send-email-clalance@redhat.com> References: <1259678201-11203-1-git-send-email-clalance@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c index 8285f0d..80d4705 100644 --- a/arch/x86/kvm/i8259.c +++ b/arch/x86/kvm/i8259.c @@ -263,7 +263,7 @@ static void kvm_pic_reset(struct kvm_kpic_state *s) s->init4 = 0; for (irq = 0; irq < PIC_NUM_PINS/2; irq++) { - if (vcpu0 && kvm_apic_accept_pic_intr(vcpu0)) + if (vcpu0 && kvm_apic_in_virtual_wire_mode(vcpu0)) if (irr & (1 << irq) || isr & (1 << irq)) { pic_clear_isr(s, irq); } diff --git a/arch/x86/kvm/irq.c b/arch/x86/kvm/irq.c index 96dfbb6..05721fc 100644 --- a/arch/x86/kvm/irq.c +++ b/arch/x86/kvm/irq.c @@ -53,7 +53,7 @@ int kvm_cpu_has_interrupt(struct kvm_vcpu *v) return v->arch.interrupt.pending; if (kvm_apic_has_interrupt(v) == -1) { /* LAPIC */ - if (kvm_apic_accept_pic_intr(v)) { + if (kvm_apic_in_virtual_wire_mode(v)) { s = pic_irqchip(v->kvm); /* PIC */ return s->output; } else @@ -76,7 +76,7 @@ int kvm_cpu_get_interrupt(struct kvm_vcpu *v) vector = kvm_get_apic_interrupt(v); /* APIC */ if (vector == -1) { - if (kvm_apic_accept_pic_intr(v)) { + if (kvm_apic_in_virtual_wire_mode(v)) { s = pic_irqchip(v->kvm); s->output = 0; /* PIC */ vector = kvm_pic_read_irq(v->kvm); diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index cd60c0b..44acf7c 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -435,7 +435,7 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode, /* * Should only be called by kvm_apic_local_deliver() with LVT0, * before NMI watchdog was enabled. Already handled by - * kvm_apic_accept_pic_intr(). + * kvm_apic_in_virtual_wire_mode(). */ break; @@ -1099,18 +1099,17 @@ int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu) return highest_irr; } -int kvm_apic_accept_pic_intr(struct kvm_vcpu *vcpu) +int kvm_apic_in_virtual_wire_mode(struct kvm_vcpu *vcpu) { u32 lvt0 = apic_get_reg(vcpu->arch.apic, APIC_LVT0); int r = 0; - if (kvm_vcpu_is_bsp(vcpu)) { - if (!apic_hw_enabled(vcpu->arch.apic)) - r = 1; - if ((lvt0 & APIC_LVT_MASKED) == 0 && - GET_APIC_DELIVERY_MODE(lvt0) == APIC_MODE_EXTINT) - r = 1; - } + if (!apic_hw_enabled(vcpu->arch.apic)) + r = 1; + if ((lvt0 & APIC_LVT_MASKED) == 0 && + GET_APIC_DELIVERY_MODE(lvt0) == APIC_MODE_EXTINT) + r = 1; + return r; } diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h index 40010b0..ce4cd2d 100644 --- a/arch/x86/kvm/lapic.h +++ b/arch/x86/kvm/lapic.h @@ -22,7 +22,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu); void kvm_free_lapic(struct kvm_vcpu *vcpu); int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu); -int kvm_apic_accept_pic_intr(struct kvm_vcpu *vcpu); +int kvm_apic_in_virtual_wire_mode(struct kvm_vcpu *vcpu); int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu); void kvm_lapic_reset(struct kvm_vcpu *vcpu); u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu);