mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: linux-kernel@vger.kernel.org, kvm-devel@lists.sourceforge.net
Cc: Zhang Xiantao <xiantao.zhang@intel.com>
Subject: [PATCH 11/33] KVM: Portability: move vpic and vioapic to kvm_arch
Date: Sun,  6 Jan 2008 16:39:17 +0200	[thread overview]
Message-ID: <1199630379-28638-12-git-send-email-avi@qumranet.com> (raw)
In-Reply-To: <1199630379-28638-1-git-send-email-avi@qumranet.com>

From: Zhang Xiantao <xiantao.zhang@intel.com>

This patches moves two fields vpid and vioapic to kvm_arch

Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
Acked-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
---
 drivers/kvm/ioapic.c |    4 ++--
 drivers/kvm/irq.h    |    4 ++--
 drivers/kvm/kvm.h    |    2 --
 drivers/kvm/x86.c    |   14 +++++++-------
 drivers/kvm/x86.h    |    2 ++
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/kvm/ioapic.c b/drivers/kvm/ioapic.c
index 0491036..f823677 100644
--- a/drivers/kvm/ioapic.c
+++ b/drivers/kvm/ioapic.c
@@ -271,7 +271,7 @@ static int get_eoi_gsi(struct kvm_ioapic *ioapic, int vector)
 
 void kvm_ioapic_update_eoi(struct kvm *kvm, int vector)
 {
-	struct kvm_ioapic *ioapic = kvm->vioapic;
+	struct kvm_ioapic *ioapic = kvm->arch.vioapic;
 	union ioapic_redir_entry *ent;
 	int gsi;
 
@@ -390,7 +390,7 @@ int kvm_ioapic_init(struct kvm *kvm)
 	ioapic = kzalloc(sizeof(struct kvm_ioapic), GFP_KERNEL);
 	if (!ioapic)
 		return -ENOMEM;
-	kvm->vioapic = ioapic;
+	kvm->arch.vioapic = ioapic;
 	kvm_ioapic_reset(ioapic);
 	ioapic->dev.read = ioapic_mmio_read;
 	ioapic->dev.write = ioapic_mmio_write;
diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h
index a688c51..6e023dc 100644
--- a/drivers/kvm/irq.h
+++ b/drivers/kvm/irq.h
@@ -148,12 +148,12 @@ do {									\
 
 static inline struct kvm_pic *pic_irqchip(struct kvm *kvm)
 {
-	return kvm->vpic;
+	return kvm->arch.vpic;
 }
 
 static inline struct kvm_ioapic *ioapic_irqchip(struct kvm *kvm)
 {
-	return kvm->vioapic;
+	return kvm->arch.vioapic;
 }
 
 static inline int irqchip_in_kernel(struct kvm *kvm)
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 65de5e4..d9ce916 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -124,8 +124,6 @@ struct kvm {
 	struct file *filp;
 	struct kvm_io_bus mmio_bus;
 	struct kvm_io_bus pio_bus;
-	struct kvm_pic *vpic;
-	struct kvm_ioapic *vioapic;
 	int round_robin_prev_vcpu;
 	unsigned int tss_addr;
 	struct page *apic_access_page;
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index c0e95fb..b37c009 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -1386,12 +1386,12 @@ long kvm_arch_vm_ioctl(struct file *filp,
 	}
 	case KVM_CREATE_IRQCHIP:
 		r = -ENOMEM;
-		kvm->vpic = kvm_create_pic(kvm);
-		if (kvm->vpic) {
+		kvm->arch.vpic = kvm_create_pic(kvm);
+		if (kvm->arch.vpic) {
 			r = kvm_ioapic_init(kvm);
 			if (r) {
-				kfree(kvm->vpic);
-				kvm->vpic = NULL;
+				kfree(kvm->arch.vpic);
+				kvm->arch.vpic = NULL;
 				goto out;
 			}
 		} else
@@ -1409,7 +1409,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
 				kvm_pic_set_irq(pic_irqchip(kvm),
 					irq_event.irq,
 					irq_event.level);
-			kvm_ioapic_set_irq(kvm->vioapic,
+			kvm_ioapic_set_irq(kvm->arch.vioapic,
 					irq_event.irq,
 					irq_event.level);
 			mutex_unlock(&kvm->lock);
@@ -3084,8 +3084,8 @@ static void kvm_free_vcpus(struct kvm *kvm)
 
 void kvm_arch_destroy_vm(struct kvm *kvm)
 {
-	kfree(kvm->vpic);
-	kfree(kvm->vioapic);
+	kfree(kvm->arch.vpic);
+	kfree(kvm->arch.vioapic);
 	kvm_free_vcpus(kvm);
 	kvm_free_physmem(kvm);
 	kfree(kvm);
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h
index 5cdc366..ef23a30 100644
--- a/drivers/kvm/x86.h
+++ b/drivers/kvm/x86.h
@@ -275,6 +275,8 @@ struct kvm_arch{
 	 * Hash table of struct kvm_mmu_page.
 	 */
 	struct list_head active_mmu_pages;
+	struct kvm_pic *vpic;
+	struct kvm_ioapic *vioapic;
 };
 
 struct kvm_vcpu_stat {
-- 
1.5.3.7


  parent reply	other threads:[~2008-01-06 14:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-06 14:39 [PATCH 00/33] KVM patch queue review for 2.6.25 merge window (part V) Avi Kivity
2008-01-06 14:39 ` [PATCH 01/33] KVM: SVM: support writing 0 to K8 performance counter control registers Avi Kivity
2008-01-06 14:39 ` [PATCH 02/33] KVM: MMU: emulated cmpxchg8b should be atomic on i386 Avi Kivity
2008-01-06 18:57   ` [kvm-devel] " Carlo Marcelo Arenas Belon
2008-01-07  9:24     ` Avi Kivity
2008-01-06 14:39 ` [PATCH 03/33] KVM: Portability: Move kvm{pic,ioapic} accesors to x86 specific code Avi Kivity
2008-01-06 14:39 ` [PATCH 04/33] KVM: Portability: Introduce kvm_vcpu_arch Avi Kivity
2008-01-06 14:39 ` [PATCH 05/33] KVM: Portability: Split mmu-related static inline functions to mmu.h Avi Kivity
2008-01-06 14:39 ` [PATCH 06/33] KVM: Portability: Move kvm_vcpu definition back to kvm.h Avi Kivity
2008-01-06 14:39 ` [PATCH 07/33] KVM: Portability: Expand the KVM_VCPU_COMM in kvm_vcpu structure Avi Kivity
2008-01-06 14:39 ` [PATCH 08/33] KVM: Portability: Move kvm_vcpu_stat to x86.h Avi Kivity
2008-01-06 14:39 ` [PATCH 09/33] KVM: Portability: Move memslot aliases to new struct kvm_arch Avi Kivity
2008-01-06 14:39 ` [PATCH 10/33] KVM: Portability: Move mmu-related fields to kvm_arch Avi Kivity
2008-01-06 14:39 ` Avi Kivity [this message]
2008-01-06 14:39 ` [PATCH 12/33] KVM: Portability: Move round_robin_prev_vcpu and tss_addr " Avi Kivity
2008-01-06 14:39 ` [PATCH 13/33] KVM: Portability: Move kvm_vm_stat to x86.h Avi Kivity
2008-01-06 14:39 ` [PATCH 14/33] KVM: VMX: Add printk_ratelimit in vmx_intr_assist Avi Kivity
2008-01-06 14:39 ` [PATCH 15/33] KVM: Move arch dependent files to new directory arch/x86/kvm/ Avi Kivity
2008-01-06 14:39 ` [PATCH 16/33] KVM: Move drivers/kvm/* to virt/kvm/ Avi Kivity
2008-01-06 14:39 ` [PATCH 17/33] KVM: Move irqchip declarations into new ioapic.h and lapic.h Avi Kivity
2008-01-06 14:39 ` [PATCH 18/33] KVM: Move ioapic code to common directory Avi Kivity
2008-01-06 14:39 ` [PATCH 19/33] KVM: Move kvm_vcpu_kick() to x86.c Avi Kivity
2008-01-06 14:39 ` [PATCH 20/33] KVM: Expose ioapic to ia64 save/restore APIs Avi Kivity
2008-01-06 14:39 ` [PATCH 21/33] KVM: MMU: Coalesce remote tlb flushes Avi Kivity
2008-01-06 14:39 ` [PATCH 22/33] KVM: MMU: Add cache miss statistic Avi Kivity
2008-01-06 14:39 ` [PATCH 23/33] KVM: Print data for unimplemented wrmsr Avi Kivity
2008-01-06 14:39 ` [PATCH 24/33] KVM: local APIC TPR access reporting facility Avi Kivity
2008-01-06 14:39 ` [PATCH 25/33] KVM: Accelerated apic support Avi Kivity
2008-01-06 14:39 ` [PATCH 26/33] KVM: Disable vapic support on Intel machines with FlexPriority Avi Kivity
2008-01-06 14:39 ` [PATCH 27/33] KVM: MMU: Concurrent guest walkers Avi Kivity
2008-01-06 14:39 ` [PATCH 28/33] KVM: Add kvm_read_guest_atomic() Avi Kivity
2008-01-06 14:39 ` [PATCH 29/33] KVM: MMU: Avoid calling gfn_to_page() in mmu_set_spte() Avi Kivity
2008-01-06 14:39 ` [PATCH 30/33] KVM: MMU: Switch to mmu spinlock Avi Kivity
2008-01-06 14:39 ` [PATCH 31/33] KVM: MMU: Move kvm_free_some_pages() into critical section Avi Kivity
2008-01-06 14:39 ` [PATCH 32/33] KVM: MMU: Merge shadow level check in FNAME(fetch) Avi Kivity
2008-01-06 14:39 ` [PATCH 33/33] KVM: x86 emulator: Only allow VMCALL/VMMCALL trapped by #UD Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1199630379-28638-12-git-send-email-avi@qumranet.com \
    --to=avi@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiantao.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®