~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/x86/kvm/lapic.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <asm/atomic.h>
37
37
#include "kvm_cache_regs.h"
38
38
#include "irq.h"
39
 
#include <asm/kvm-trace.h>
 
39
#include "trace.h"
40
40
#include "x86.h"
41
41
 
42
42
#ifndef CONFIG_X86_64
417
417
        case APIC_DM_INIT:
418
418
                if (level) {
419
419
                        result = 1;
420
 
                        if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE)
421
 
                                printk(KERN_DEBUG
422
 
                                       "INIT on a runnable vcpu %d\n",
423
 
                                       vcpu->vcpu_id);
424
420
                        vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED;
425
421
                        kvm_make_request(KVM_REQ_EVENT, vcpu);
426
422
                        kvm_vcpu_kick(vcpu);
875
871
 
876
872
        hrtimer_cancel(&vcpu->arch.apic->lapic_timer.timer);
877
873
 
878
 
        if (vcpu->arch.apic->regs_page)
879
 
                __free_page(vcpu->arch.apic->regs_page);
 
874
        if (vcpu->arch.apic->regs)
 
875
                free_page((unsigned long)vcpu->arch.apic->regs);
880
876
 
881
877
        kfree(vcpu->arch.apic);
882
878
}
1065
1061
 
1066
1062
        vcpu->arch.apic = apic;
1067
1063
 
1068
 
        apic->regs_page = alloc_page(GFP_KERNEL|__GFP_ZERO);
1069
 
        if (apic->regs_page == NULL) {
 
1064
        apic->regs = (void *)get_zeroed_page(GFP_KERNEL);
 
1065
        if (!apic->regs) {
1070
1066
                printk(KERN_ERR "malloc apic regs error for vcpu %x\n",
1071
1067
                       vcpu->vcpu_id);
1072
1068
                goto nomem_free_apic;
1073
1069
        }
1074
 
        apic->regs = page_address(apic->regs_page);
1075
1070
        apic->vcpu = vcpu;
1076
1071
 
1077
1072
        hrtimer_init(&apic->lapic_timer.timer, CLOCK_MONOTONIC,