diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-04 20:07:28 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-04 20:07:28 -0400 |
| commit | 8dcf5782848600ecfd0df3a45c521b5ad0fcb42e (patch) | |
| tree | 72821491c1ca5b0660599b4c06a27770d6800cd3 /arch/powerpc | |
| parent | e73b65f1db7e3baa3db43951476b7d2d2381ba35 (diff) | |
| parent | b8ba5f10c5956d2b297766fda8f4f5ab8ad1e2cc (diff) | |
Merge branch 'kvm-updates-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm
* 'kvm-updates-2.6.26' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm:
x86: KVM geust: make setup_secondary_clock definition dependent on local apic
KVM: MMU: Allow more than PAGES_PER_HPAGE write protections per large page
KVM: avoid fx_init() schedule in atomic
KVM: Avoid spurious execeptions after setting registers
KVM: PIT: support mode 4
KVM: x86 emulator: disable writeback on lmsw
KVM: ppc: deliver INTERRUPT_FP_UNAVAIL to the guest
KVM: ppc: Handle guest idle by emulating MSR[WE] writes
KVM: x86: task switch: fix wrong bit setting for the busy flag
KVM: VMX: Enable EPT feature for KVM
KVM: VMX: Prepare an identity page table for EPT in real mode
KVM: Export necessary function for EPT
KVM: MMU: Remove #ifdef CONFIG_X86_64 to support 4 level EPT
KVM: MMU: Add EPT support
KVM: Add kvm_x86_ops get_tdp_level()
KVM: MMU: Move some definitions to a header file
KVM: VMX: EPT Feature Detection
Diffstat (limited to 'arch/powerpc')
| -rw-r--r-- | arch/powerpc/kvm/booke_guest.c | 6 | ||||
| -rw-r--r-- | arch/powerpc/kvm/powerpc.c | 20 |
2 files changed, 23 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/booke_guest.c b/arch/powerpc/kvm/booke_guest.c index 6d9884a6884a..712d89a28c46 100644 --- a/arch/powerpc/kvm/booke_guest.c +++ b/arch/powerpc/kvm/booke_guest.c | |||
| @@ -49,6 +49,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
| 49 | { "inst_emu", VCPU_STAT(emulated_inst_exits) }, | 49 | { "inst_emu", VCPU_STAT(emulated_inst_exits) }, |
| 50 | { "dec", VCPU_STAT(dec_exits) }, | 50 | { "dec", VCPU_STAT(dec_exits) }, |
| 51 | { "ext_intr", VCPU_STAT(ext_intr_exits) }, | 51 | { "ext_intr", VCPU_STAT(ext_intr_exits) }, |
| 52 | { "halt_wakeup", VCPU_STAT(halt_wakeup) }, | ||
| 52 | { NULL } | 53 | { NULL } |
| 53 | }; | 54 | }; |
| 54 | 55 | ||
| @@ -338,6 +339,11 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
| 338 | } | 339 | } |
| 339 | break; | 340 | break; |
| 340 | 341 | ||
| 342 | case BOOKE_INTERRUPT_FP_UNAVAIL: | ||
| 343 | kvmppc_queue_exception(vcpu, exit_nr); | ||
| 344 | r = RESUME_GUEST; | ||
| 345 | break; | ||
| 346 | |||
| 341 | case BOOKE_INTERRUPT_DATA_STORAGE: | 347 | case BOOKE_INTERRUPT_DATA_STORAGE: |
| 342 | vcpu->arch.dear = vcpu->arch.fault_dear; | 348 | vcpu->arch.dear = vcpu->arch.fault_dear; |
| 343 | vcpu->arch.esr = vcpu->arch.fault_esr; | 349 | vcpu->arch.esr = vcpu->arch.fault_esr; |
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index bad40bd2d3ac..777e0f34e0ea 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
| @@ -36,13 +36,12 @@ gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn) | |||
| 36 | 36 | ||
| 37 | int kvm_cpu_has_interrupt(struct kvm_vcpu *v) | 37 | int kvm_cpu_has_interrupt(struct kvm_vcpu *v) |
| 38 | { | 38 | { |
| 39 | /* XXX implement me */ | 39 | return !!(v->arch.pending_exceptions); |
| 40 | return 0; | ||
| 41 | } | 40 | } |
| 42 | 41 | ||
| 43 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *v) | 42 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *v) |
| 44 | { | 43 | { |
| 45 | return 1; | 44 | return !(v->arch.msr & MSR_WE); |
| 46 | } | 45 | } |
| 47 | 46 | ||
| 48 | 47 | ||
| @@ -214,6 +213,11 @@ static void kvmppc_decrementer_func(unsigned long data) | |||
| 214 | struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; | 213 | struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; |
| 215 | 214 | ||
| 216 | kvmppc_queue_exception(vcpu, BOOKE_INTERRUPT_DECREMENTER); | 215 | kvmppc_queue_exception(vcpu, BOOKE_INTERRUPT_DECREMENTER); |
| 216 | |||
| 217 | if (waitqueue_active(&vcpu->wq)) { | ||
| 218 | wake_up_interruptible(&vcpu->wq); | ||
| 219 | vcpu->stat.halt_wakeup++; | ||
| 220 | } | ||
| 217 | } | 221 | } |
| 218 | 222 | ||
| 219 | int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) | 223 | int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) |
| @@ -339,6 +343,8 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) | |||
| 339 | int r; | 343 | int r; |
| 340 | sigset_t sigsaved; | 344 | sigset_t sigsaved; |
| 341 | 345 | ||
| 346 | vcpu_load(vcpu); | ||
| 347 | |||
| 342 | if (vcpu->sigset_active) | 348 | if (vcpu->sigset_active) |
| 343 | sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved); | 349 | sigprocmask(SIG_SETMASK, &vcpu->sigset, &sigsaved); |
| 344 | 350 | ||
| @@ -363,12 +369,20 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) | |||
| 363 | if (vcpu->sigset_active) | 369 | if (vcpu->sigset_active) |
| 364 | sigprocmask(SIG_SETMASK, &sigsaved, NULL); | 370 | sigprocmask(SIG_SETMASK, &sigsaved, NULL); |
| 365 | 371 | ||
| 372 | vcpu_put(vcpu); | ||
| 373 | |||
| 366 | return r; | 374 | return r; |
| 367 | } | 375 | } |
| 368 | 376 | ||
| 369 | int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, struct kvm_interrupt *irq) | 377 | int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, struct kvm_interrupt *irq) |
| 370 | { | 378 | { |
| 371 | kvmppc_queue_exception(vcpu, BOOKE_INTERRUPT_EXTERNAL); | 379 | kvmppc_queue_exception(vcpu, BOOKE_INTERRUPT_EXTERNAL); |
| 380 | |||
| 381 | if (waitqueue_active(&vcpu->wq)) { | ||
| 382 | wake_up_interruptible(&vcpu->wq); | ||
| 383 | vcpu->stat.halt_wakeup++; | ||
| 384 | } | ||
| 385 | |||
| 372 | return 0; | 386 | return 0; |
| 373 | } | 387 | } |
| 374 | 388 | ||
