From patchwork Thu Jan 8 10:45:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 1337 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 n08AgA1K019956 for ; Thu, 8 Jan 2009 02:42:10 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752618AbZAHKpk (ORCPT ); Thu, 8 Jan 2009 05:45:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753777AbZAHKpk (ORCPT ); Thu, 8 Jan 2009 05:45:40 -0500 Received: from mga01.intel.com ([192.55.52.88]:41732 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752618AbZAHKph (ORCPT ); Thu, 8 Jan 2009 05:45:37 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 08 Jan 2009 02:35:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.37,233,1231142400"; d="scan'208";a="420673914" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.176]) by fmsmga002.fm.intel.com with ESMTP; 08 Jan 2009 02:40:34 -0800 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1LKsON-0000eK-MH; Thu, 08 Jan 2009 18:45:35 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, Sheng Yang Subject: [PATCH 6/7] KVM: Split IOAPIC structure Date: Thu, 8 Jan 2009 18:45:34 +0800 Message-Id: <1231411535-2461-7-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1231411535-2461-1-git-send-email-sheng@linux.intel.com> References: <1231411535-2461-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Prepared for reuse ioapic_redir_entry for MSI. Signed-off-by: Sheng Yang --- include/linux/kvm_types.h | 17 +++++++++++++++++ virt/kvm/ioapic.c | 6 +++--- virt/kvm/ioapic.h | 17 +---------------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/include/linux/kvm_types.h b/include/linux/kvm_types.h index 5f4a18c..46e3d8d 100644 --- a/include/linux/kvm_types.h +++ b/include/linux/kvm_types.h @@ -52,4 +52,21 @@ struct kvm_pio_request { int rep; }; +union kvm_ioapic_redirect_entry { + u64 bits; + struct { + u8 vector; + u8 delivery_mode:3; + u8 dest_mode:1; + u8 delivery_status:1; + u8 polarity:1; + u8 remote_irr:1; + u8 trig_mode:1; + u8 mask:1; + u8 reserve:7; + u8 reserved[4]; + u8 dest_id; + } fields; +}; + #endif /* __KVM_TYPES_H__ */ diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index e85a2bc..b6530e9 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c @@ -85,7 +85,7 @@ static unsigned long ioapic_read_indirect(struct kvm_ioapic *ioapic, static void ioapic_service(struct kvm_ioapic *ioapic, unsigned int idx) { - union ioapic_redir_entry *pent; + union kvm_ioapic_redirect_entry *pent; pent = &ioapic->redirtbl[idx]; @@ -277,7 +277,7 @@ void kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level) { u32 old_irr = ioapic->irr; u32 mask = 1 << irq; - union ioapic_redir_entry entry; + union kvm_ioapic_redirect_entry entry; if (irq >= 0 && irq < IOAPIC_NUM_PINS) { entry = ioapic->redirtbl[irq]; @@ -296,7 +296,7 @@ void kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level) static void __kvm_ioapic_update_eoi(struct kvm_ioapic *ioapic, int gsi, int trigger_mode) { - union ioapic_redir_entry *ent; + union kvm_ioapic_redirect_entry *ent; ent = &ioapic->redirtbl[gsi]; diff --git a/virt/kvm/ioapic.h b/virt/kvm/ioapic.h index 49c9581..ee5b0bd 100644 --- a/virt/kvm/ioapic.h +++ b/virt/kvm/ioapic.h @@ -40,22 +40,7 @@ struct kvm_ioapic { u32 id; u32 irr; u32 pad; - union ioapic_redir_entry { - u64 bits; - struct { - u8 vector; - u8 delivery_mode:3; - u8 dest_mode:1; - u8 delivery_status:1; - u8 polarity:1; - u8 remote_irr:1; - u8 trig_mode:1; - u8 mask:1; - u8 reserve:7; - u8 reserved[4]; - u8 dest_id; - } fields; - } redirtbl[IOAPIC_NUM_PINS]; + union kvm_ioapic_redirect_entry redirtbl[IOAPIC_NUM_PINS]; struct kvm_io_device dev; struct kvm *kvm; void (*ack_notifier)(void *opaque, int irq);