aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-01-04 16:19:25 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 10:35:46 -0500
commit97c4cfbe890a4ad82dde8660008d42b7b05dc488 (patch)
tree9efc0daf1ec644291a10e8e6c91ff212f91732e1 /arch/powerpc/kvm/book3s.c
parentb480f780f071a068810ccd0e49c1daa210bfbeab (diff)
KVM: PPC: Enable lightweight exits again
The PowerPC C ABI defines that registers r14-r31 need to be preserved across function calls. Since our exit handler is written in C, we can make use of that and don't need to reload r14-r31 on every entry/exit cycle. This technique is also used in the BookE code and is called "lightweight exits" there. To follow the tradition, it's called the same in Book3S. So far this optimization was disabled though, as the code didn't do what it was expected to do, but failed to work. This patch fixes and enables lightweight exits again. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/book3s.c')
-rw-r--r--arch/powerpc/kvm/book3s.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 492dcc198dd3..fd2a4d531582 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -539,8 +539,6 @@ int kvmppc_handle_pagefault(struct kvm_run *run, struct kvm_vcpu *vcpu,
539 r = kvmppc_emulate_mmio(run, vcpu); 539 r = kvmppc_emulate_mmio(run, vcpu);
540 if ( r == RESUME_HOST_NV ) 540 if ( r == RESUME_HOST_NV )
541 r = RESUME_HOST; 541 r = RESUME_HOST;
542 if ( r == RESUME_GUEST_NV )
543 r = RESUME_GUEST;
544 } 542 }
545 543
546 return r; 544 return r;
@@ -645,7 +643,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
645 er = kvmppc_emulate_instruction(run, vcpu); 643 er = kvmppc_emulate_instruction(run, vcpu);
646 switch (er) { 644 switch (er) {
647 case EMULATE_DONE: 645 case EMULATE_DONE:
648 r = RESUME_GUEST; 646 r = RESUME_GUEST_NV;
649 break; 647 break;
650 case EMULATE_FAIL: 648 case EMULATE_FAIL:
651 printk(KERN_CRIT "%s: emulation at %lx failed (%08x)\n", 649 printk(KERN_CRIT "%s: emulation at %lx failed (%08x)\n",