diff options
author | Gleb Natapov <gleb@redhat.com> | 2012-08-05 08:58:27 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-08-06 09:20:05 -0400 |
commit | 5dbc8f3fed0b4cb04dfb276150294f21c5f0fc66 (patch) | |
tree | e31e5fd2f39825035985dbd6ee988c870e584245 | |
parent | 8a5a87d9b7aef24bcdba763d8ee14982477b0a2e (diff) |
KVM: use kvm_lapic_set_base() to change apic_base
Do not change apic_base directly. Use kvm_lapic_set_base() instead.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | arch/x86/kvm/lapic.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 0cd431c85d38..49f4ac047f60 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c | |||
@@ -1185,7 +1185,8 @@ void kvm_lapic_reset(struct kvm_vcpu *vcpu) | |||
1185 | update_divide_count(apic); | 1185 | update_divide_count(apic); |
1186 | atomic_set(&apic->lapic_timer.pending, 0); | 1186 | atomic_set(&apic->lapic_timer.pending, 0); |
1187 | if (kvm_vcpu_is_bsp(vcpu)) | 1187 | if (kvm_vcpu_is_bsp(vcpu)) |
1188 | vcpu->arch.apic_base |= MSR_IA32_APICBASE_BSP; | 1188 | kvm_lapic_set_base(vcpu, |
1189 | vcpu->arch.apic_base | MSR_IA32_APICBASE_BSP); | ||
1189 | vcpu->arch.pv_eoi.msr_val = 0; | 1190 | vcpu->arch.pv_eoi.msr_val = 0; |
1190 | apic_update_ppr(apic); | 1191 | apic_update_ppr(apic); |
1191 | 1192 | ||
@@ -1310,8 +1311,7 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu) | |||
1310 | HRTIMER_MODE_ABS); | 1311 | HRTIMER_MODE_ABS); |
1311 | apic->lapic_timer.timer.function = apic_timer_fn; | 1312 | apic->lapic_timer.timer.function = apic_timer_fn; |
1312 | 1313 | ||
1313 | apic->base_address = APIC_DEFAULT_PHYS_BASE; | 1314 | kvm_lapic_set_base(vcpu, APIC_DEFAULT_PHYS_BASE); |
1314 | vcpu->arch.apic_base = APIC_DEFAULT_PHYS_BASE; | ||
1315 | 1315 | ||
1316 | kvm_lapic_reset(vcpu); | 1316 | kvm_lapic_reset(vcpu); |
1317 | kvm_iodevice_init(&apic->dev, &apic_mmio_ops); | 1317 | kvm_iodevice_init(&apic->dev, &apic_mmio_ops); |
@@ -1380,8 +1380,7 @@ void kvm_apic_post_state_restore(struct kvm_vcpu *vcpu) | |||
1380 | { | 1380 | { |
1381 | struct kvm_lapic *apic = vcpu->arch.apic; | 1381 | struct kvm_lapic *apic = vcpu->arch.apic; |
1382 | 1382 | ||
1383 | apic->base_address = vcpu->arch.apic_base & | 1383 | kvm_lapic_set_base(vcpu, vcpu->arch.apic_base); |
1384 | MSR_IA32_APICBASE_BASE; | ||
1385 | kvm_apic_set_version(vcpu); | 1384 | kvm_apic_set_version(vcpu); |
1386 | 1385 | ||
1387 | apic_update_ppr(apic); | 1386 | apic_update_ppr(apic); |