Patchwork [7/8] kvm/ppc/booke: Delay kvmppc_fix_ee_before_entry

login
register
mail settings
Submitter Scott Wood
Date June 7, 2013, 12:16 a.m.
Message ID <1370564196-3821-8-git-send-email-scottwood@freescale.com>
Download mbox | patch
Permalink /patch/249565/
State New
Headers show

Comments

Scott Wood - June 7, 2013, 12:16 a.m.
kwmppc_fix_ee_before_entry() should be called as late as possible,
or else we get things like WARN_ON(preemptible()) in enable_kernel_fp()
in configurations where preemptible() works.

Note that book3s_pr already waits until just before __kvmppc_vcpu_run
to call kvmppc_fix_ee_before_entry().

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 arch/powerpc/kvm/booke.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index c5270a3..f953324 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -671,7 +671,6 @@  int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
 		ret = s;
 		goto out;
 	}
-	kvmppc_fix_ee_before_entry();
 
 	kvm_guest_enter();
 
@@ -697,6 +696,8 @@  int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
 	kvmppc_load_guest_fp(vcpu);
 #endif
 
+	kvmppc_fix_ee_before_entry();
+
 	ret = __kvmppc_vcpu_run(kvm_run, vcpu);
 
 	/* No need for kvm_guest_exit. It's done in handle_exit.