aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-02-19 05:00:32 -0500
committerAvi Kivity <avi@redhat.com>2010-04-25 05:34:50 -0400
commit3c402a75ea66e7aafa212077d1f93f1b560d0bd0 (patch)
tree9495dd20f1621db0c02f79b71b29053ce6ed4292
parent37f5bca64e206ed97e53f734d7de5b7c5ade3578 (diff)
KVM: PPC: Add hidden flag for paired singles
The Gekko implements an extension called paired singles. When the guest wants to use that extension, we need to make sure we're not running the host FPU, because all FPU instructions need to get emulated to accomodate for additional operations that occur. This patch adds an hflag to track if we're in paired single mode or not. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/powerpc/include/asm/kvm_asm.h1
-rw-r--r--arch/powerpc/kvm/book3s.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_asm.h b/arch/powerpc/include/asm/kvm_asm.h
index aadf2dd6f84e..7238c048e5bb 100644
--- a/arch/powerpc/include/asm/kvm_asm.h
+++ b/arch/powerpc/include/asm/kvm_asm.h
@@ -88,6 +88,7 @@
88 88
89#define BOOK3S_HFLAG_DCBZ32 0x1 89#define BOOK3S_HFLAG_DCBZ32 0x1
90#define BOOK3S_HFLAG_SLB 0x2 90#define BOOK3S_HFLAG_SLB 0x2
91#define BOOK3S_HFLAG_PAIRED_SINGLE 0x4
91 92
92#define RESUME_FLAG_NV (1<<0) /* Reload guest nonvolatile state? */ 93#define RESUME_FLAG_NV (1<<0) /* Reload guest nonvolatile state? */
93#define RESUME_FLAG_HOST (1<<1) /* Resume host? */ 94#define RESUME_FLAG_HOST (1<<1) /* Resume host? */
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 6416f227d345..8cb9f5a67464 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -639,6 +639,10 @@ static int kvmppc_handle_ext(struct kvm_vcpu *vcpu, unsigned int exit_nr,
639 u64 *thread_fpr = (u64*)t->fpr; 639 u64 *thread_fpr = (u64*)t->fpr;
640 int i; 640 int i;
641 641
642 /* When we have paired singles, we emulate in software */
643 if (vcpu->arch.hflags & BOOK3S_HFLAG_PAIRED_SINGLE)
644 return RESUME_GUEST;
645
642 if (!(vcpu->arch.msr & msr)) { 646 if (!(vcpu->arch.msr & msr)) {
643 kvmppc_book3s_queue_irqprio(vcpu, exit_nr); 647 kvmppc_book3s_queue_irqprio(vcpu, exit_nr);
644 return RESUME_GUEST; 648 return RESUME_GUEST;