aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2012-07-15 08:56:52 -0400
committerAvi Kivity <avi@redhat.com>2012-07-16 05:51:44 -0400
commit90536664063641bf87d8ac9e109f3f109f804d3e (patch)
tree8d874bb18ad235f5fee429c3c7e5b36d50d625c7
parent1551df646dd42122e17401013dba7a509d0f1b0d (diff)
KVM guest: switch to apic_set_eoi_write, apic_write
Use apic_set_eoi_write, apic_write to avoid meedling in core apic driver data structures directly. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/x86/kernel/kvm.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 299cf1470923..c1d61ee4b4f1 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -299,7 +299,7 @@ static void kvm_guest_apic_eoi_write(u32 reg, u32 val)
299 */ 299 */
300 if (__test_and_clear_bit(KVM_PV_EOI_BIT, &__get_cpu_var(kvm_apic_eoi))) 300 if (__test_and_clear_bit(KVM_PV_EOI_BIT, &__get_cpu_var(kvm_apic_eoi)))
301 return; 301 return;
302 apic->write(APIC_EOI, APIC_EOI_ACK); 302 apic_write(APIC_EOI, APIC_EOI_ACK);
303} 303}
304 304
305void __cpuinit kvm_guest_cpu_init(void) 305void __cpuinit kvm_guest_cpu_init(void)
@@ -466,15 +466,8 @@ void __init kvm_guest_init(void)
466 pv_time_ops.steal_clock = kvm_steal_clock; 466 pv_time_ops.steal_clock = kvm_steal_clock;
467 } 467 }
468 468
469 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI)) { 469 if (kvm_para_has_feature(KVM_FEATURE_PV_EOI))
470 struct apic **drv; 470 apic_set_eoi_write(kvm_guest_apic_eoi_write);
471
472 for (drv = __apicdrivers; drv < __apicdrivers_end; drv++) {
473 /* Should happen once for each apic */
474 WARN_ON((*drv)->eoi_write == kvm_guest_apic_eoi_write);
475 (*drv)->eoi_write = kvm_guest_apic_eoi_write;
476 }
477 }
478 471
479#ifdef CONFIG_SMP 472#ifdef CONFIG_SMP
480 smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu; 473 smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu;