aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-02-19 05:00:35 -0500
committerAvi Kivity <avi@redhat.com>2010-04-25 05:34:59 -0400
commitd1bab74c51eb13cf860ea2f0cd1d4d4605deb292 (patch)
tree3182adf9a58d8454ee844d08c8518fb332218861 /arch/powerpc/kvm
parentc8c0b6f2f7db22a340f1311602182a25a2378996 (diff)
KVM: PPC: Preload FPU when possible
There are some situations when we're pretty sure the guest will use the FPU soon. So we can save the churn of going into the guest, finding out it does want to use the FPU and going out again. This patch adds preloading of the FPU when it's reasonable. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/book3s.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index b18415fc0188..55c38e598280 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -138,6 +138,10 @@ void kvmppc_set_msr(struct kvm_vcpu *vcpu, u64 msr)
138 kvmppc_mmu_flush_segments(vcpu); 138 kvmppc_mmu_flush_segments(vcpu);
139 kvmppc_mmu_map_segment(vcpu, vcpu->arch.pc); 139 kvmppc_mmu_map_segment(vcpu, vcpu->arch.pc);
140 } 140 }
141
142 /* Preload FPU if it's enabled */
143 if (vcpu->arch.msr & MSR_FP)
144 kvmppc_handle_ext(vcpu, BOOK3S_INTERRUPT_FP_UNAVAIL, MSR_FP);
141} 145}
142 146
143void kvmppc_inject_interrupt(struct kvm_vcpu *vcpu, int vec, u64 flags) 147void kvmppc_inject_interrupt(struct kvm_vcpu *vcpu, int vec, u64 flags)
@@ -1196,6 +1200,10 @@ int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
1196 /* XXX we get called with irq disabled - change that! */ 1200 /* XXX we get called with irq disabled - change that! */
1197 local_irq_enable(); 1201 local_irq_enable();
1198 1202
1203 /* Preload FPU if it's enabled */
1204 if (vcpu->arch.msr & MSR_FP)
1205 kvmppc_handle_ext(vcpu, BOOK3S_INTERRUPT_FP_UNAVAIL, MSR_FP);
1206
1199 ret = __kvmppc_vcpu_entry(kvm_run, vcpu); 1207 ret = __kvmppc_vcpu_entry(kvm_run, vcpu);
1200 1208
1201 local_irq_disable(); 1209 local_irq_disable();