aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm
diff options
context:
space:
mode:
authorZhang Xiantao <xiantao.zhang@intel.com>2007-12-13 21:17:34 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:58:10 -0500
commitd7deeeb02cf73fd98cb71a6a0a5dffab9ef79556 (patch)
treed1f1d1bf5ae822ddf1d91caf484366ebabf11217 /drivers/kvm
parentf05e70ac03a6614af12194a014b338ec5594cb5c (diff)
KVM: Portability: move vpic and vioapic to kvm_arch
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>
Diffstat (limited to 'drivers/kvm')
-rw-r--r--drivers/kvm/ioapic.c4
-rw-r--r--drivers/kvm/irq.h4
-rw-r--r--drivers/kvm/kvm.h2
-rw-r--r--drivers/kvm/x86.c14
-rw-r--r--drivers/kvm/x86.h2
5 files changed, 13 insertions, 13 deletions
diff --git a/drivers/kvm/ioapic.c b/drivers/kvm/ioapic.c
index 04910368c251..f8236774c1b4 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)
271 271
272void kvm_ioapic_update_eoi(struct kvm *kvm, int vector) 272void kvm_ioapic_update_eoi(struct kvm *kvm, int vector)
273{ 273{
274 struct kvm_ioapic *ioapic = kvm->vioapic; 274 struct kvm_ioapic *ioapic = kvm->arch.vioapic;
275 union ioapic_redir_entry *ent; 275 union ioapic_redir_entry *ent;
276 int gsi; 276 int gsi;
277 277
@@ -390,7 +390,7 @@ int kvm_ioapic_init(struct kvm *kvm)
390 ioapic = kzalloc(sizeof(struct kvm_ioapic), GFP_KERNEL); 390 ioapic = kzalloc(sizeof(struct kvm_ioapic), GFP_KERNEL);
391 if (!ioapic) 391 if (!ioapic)
392 return -ENOMEM; 392 return -ENOMEM;
393 kvm->vioapic = ioapic; 393 kvm->arch.vioapic = ioapic;
394 kvm_ioapic_reset(ioapic); 394 kvm_ioapic_reset(ioapic);
395 ioapic->dev.read = ioapic_mmio_read; 395 ioapic->dev.read = ioapic_mmio_read;
396 ioapic->dev.write = ioapic_mmio_write; 396 ioapic->dev.write = ioapic_mmio_write;
diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h
index a688c51d0a39..6e023dc3f848 100644
--- a/drivers/kvm/irq.h
+++ b/drivers/kvm/irq.h
@@ -148,12 +148,12 @@ do { \
148 148
149static inline struct kvm_pic *pic_irqchip(struct kvm *kvm) 149static inline struct kvm_pic *pic_irqchip(struct kvm *kvm)
150{ 150{
151 return kvm->vpic; 151 return kvm->arch.vpic;
152} 152}
153 153
154static inline struct kvm_ioapic *ioapic_irqchip(struct kvm *kvm) 154static inline struct kvm_ioapic *ioapic_irqchip(struct kvm *kvm)
155{ 155{
156 return kvm->vioapic; 156 return kvm->arch.vioapic;
157} 157}
158 158
159static inline int irqchip_in_kernel(struct kvm *kvm) 159static inline int irqchip_in_kernel(struct kvm *kvm)
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 65de5e4225f7..d9ce916e98ab 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -124,8 +124,6 @@ struct kvm {
124 struct file *filp; 124 struct file *filp;
125 struct kvm_io_bus mmio_bus; 125 struct kvm_io_bus mmio_bus;
126 struct kvm_io_bus pio_bus; 126 struct kvm_io_bus pio_bus;
127 struct kvm_pic *vpic;
128 struct kvm_ioapic *vioapic;
129 int round_robin_prev_vcpu; 127 int round_robin_prev_vcpu;
130 unsigned int tss_addr; 128 unsigned int tss_addr;
131 struct page *apic_access_page; 129 struct page *apic_access_page;
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index c0e95fb9f46c..b37c0093d728 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -1386,12 +1386,12 @@ long kvm_arch_vm_ioctl(struct file *filp,
1386 } 1386 }
1387 case KVM_CREATE_IRQCHIP: 1387 case KVM_CREATE_IRQCHIP:
1388 r = -ENOMEM; 1388 r = -ENOMEM;
1389 kvm->vpic = kvm_create_pic(kvm); 1389 kvm->arch.vpic = kvm_create_pic(kvm);
1390 if (kvm->vpic) { 1390 if (kvm->arch.vpic) {
1391 r = kvm_ioapic_init(kvm); 1391 r = kvm_ioapic_init(kvm);
1392 if (r) { 1392 if (r) {
1393 kfree(kvm->vpic); 1393 kfree(kvm->arch.vpic);
1394 kvm->vpic = NULL; 1394 kvm->arch.vpic = NULL;
1395 goto out; 1395 goto out;
1396 } 1396 }
1397 } else 1397 } else
@@ -1409,7 +1409,7 @@ long kvm_arch_vm_ioctl(struct file *filp,
1409 kvm_pic_set_irq(pic_irqchip(kvm), 1409 kvm_pic_set_irq(pic_irqchip(kvm),
1410 irq_event.irq, 1410 irq_event.irq,
1411 irq_event.level); 1411 irq_event.level);
1412 kvm_ioapic_set_irq(kvm->vioapic, 1412 kvm_ioapic_set_irq(kvm->arch.vioapic,
1413 irq_event.irq, 1413 irq_event.irq,
1414 irq_event.level); 1414 irq_event.level);
1415 mutex_unlock(&kvm->lock); 1415 mutex_unlock(&kvm->lock);
@@ -3084,8 +3084,8 @@ static void kvm_free_vcpus(struct kvm *kvm)
3084 3084
3085void kvm_arch_destroy_vm(struct kvm *kvm) 3085void kvm_arch_destroy_vm(struct kvm *kvm)
3086{ 3086{
3087 kfree(kvm->vpic); 3087 kfree(kvm->arch.vpic);
3088 kfree(kvm->vioapic); 3088 kfree(kvm->arch.vioapic);
3089 kvm_free_vcpus(kvm); 3089 kvm_free_vcpus(kvm);
3090 kvm_free_physmem(kvm); 3090 kvm_free_physmem(kvm);
3091 kfree(kvm); 3091 kfree(kvm);
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h
index 5cdc3666e212..ef23a30bf048 100644
--- a/drivers/kvm/x86.h
+++ b/drivers/kvm/x86.h
@@ -275,6 +275,8 @@ struct kvm_arch{
275 * Hash table of struct kvm_mmu_page. 275 * Hash table of struct kvm_mmu_page.
276 */ 276 */
277 struct list_head active_mmu_pages; 277 struct list_head active_mmu_pages;
278 struct kvm_pic *vpic;
279 struct kvm_ioapic *vioapic;
278}; 280};
279 281
280struct kvm_vcpu_stat { 282struct kvm_vcpu_stat {