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

« back to all changes in this revision

Viewing changes to arch/powerpc/kvm/powerpc.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:
175
175
        int r;
176
176
 
177
177
        switch (ext) {
 
178
#ifdef CONFIG_BOOKE
 
179
        case KVM_CAP_PPC_BOOKE_SREGS:
 
180
#else
178
181
        case KVM_CAP_PPC_SEGSTATE:
 
182
#endif
179
183
        case KVM_CAP_PPC_PAIRED_SINGLES:
180
184
        case KVM_CAP_PPC_UNSET_IRQ:
181
185
        case KVM_CAP_PPC_IRQ_LEVEL:
284
288
        tasklet_init(&vcpu->arch.tasklet, kvmppc_decrementer_func, (ulong)vcpu);
285
289
        vcpu->arch.dec_timer.function = kvmppc_decrementer_wakeup;
286
290
 
 
291
#ifdef CONFIG_KVM_EXIT_TIMING
 
292
        mutex_init(&vcpu->arch.exit_timing_lock);
 
293
#endif
 
294
 
287
295
        return 0;
288
296
}
289
297
 
294
302
 
295
303
void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
296
304
{
 
305
#ifdef CONFIG_BOOKE
 
306
        /*
 
307
         * vrsave (formerly usprg0) isn't used by Linux, but may
 
308
         * be used by the guest.
 
309
         *
 
310
         * On non-booke this is associated with Altivec and
 
311
         * is handled by code in book3s.c.
 
312
         */
 
313
        mtspr(SPRN_VRSAVE, vcpu->arch.vrsave);
 
314
#endif
297
315
        kvmppc_core_vcpu_load(vcpu, cpu);
298
316
}
299
317
 
300
318
void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
301
319
{
302
320
        kvmppc_core_vcpu_put(vcpu);
 
321
#ifdef CONFIG_BOOKE
 
322
        vcpu->arch.vrsave = mfspr(SPRN_VRSAVE);
 
323
#endif
303
324
}
304
325
 
305
326
int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,