diff options
author | Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> | 2011-03-04 22:40:20 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2011-03-17 12:08:33 -0400 |
commit | afc20184b7d24693a934f652e135598a497c9448 (patch) | |
tree | ae400e86dd91278c54489de0bb7e82212e11fd42 /arch/x86/kvm/lapic.c | |
parent | c8ce057eafd49da6a7afe7791bd84163f65f6132 (diff) |
KVM: x86: Remove useless regs_page pointer from kvm_lapic
Access to this page is mostly done through the regs member which holds
the address to this page. The exceptions are in vmx_vcpu_reset() and
kvm_free_lapic() and these both can easily be converted to using regs.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-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 0171e66e9994..2b2255b1f04b 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c | |||
@@ -871,8 +871,8 @@ void kvm_free_lapic(struct kvm_vcpu *vcpu) | |||
871 | 871 | ||
872 | hrtimer_cancel(&vcpu->arch.apic->lapic_timer.timer); | 872 | hrtimer_cancel(&vcpu->arch.apic->lapic_timer.timer); |
873 | 873 | ||
874 | if (vcpu->arch.apic->regs_page) | 874 | if (vcpu->arch.apic->regs) |
875 | __free_page(vcpu->arch.apic->regs_page); | 875 | free_page((unsigned long)vcpu->arch.apic->regs); |
876 | 876 | ||
877 | kfree(vcpu->arch.apic); | 877 | kfree(vcpu->arch.apic); |
878 | } | 878 | } |
@@ -1061,13 +1061,12 @@ int kvm_create_lapic(struct kvm_vcpu *vcpu) | |||
1061 | 1061 | ||
1062 | vcpu->arch.apic = apic; | 1062 | vcpu->arch.apic = apic; |
1063 | 1063 | ||
1064 | apic->regs_page = alloc_page(GFP_KERNEL|__GFP_ZERO); | 1064 | apic->regs = (void *)get_zeroed_page(GFP_KERNEL); |
1065 | if (apic->regs_page == NULL) { | 1065 | if (!apic->regs) { |
1066 | printk(KERN_ERR "malloc apic regs error for vcpu %x\n", | 1066 | printk(KERN_ERR "malloc apic regs error for vcpu %x\n", |
1067 | vcpu->vcpu_id); | 1067 | vcpu->vcpu_id); |
1068 | goto nomem_free_apic; | 1068 | goto nomem_free_apic; |
1069 | } | 1069 | } |
1070 | apic->regs = page_address(apic->regs_page); | ||
1071 | apic->vcpu = vcpu; | 1070 | apic->vcpu = vcpu; |
1072 | 1071 | ||
1073 | hrtimer_init(&apic->lapic_timer.timer, CLOCK_MONOTONIC, | 1072 | hrtimer_init(&apic->lapic_timer.timer, CLOCK_MONOTONIC, |