From patchwork Tue Jun 11 16:38:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 250574 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 319642C0097 for ; Wed, 12 Jun 2013 02:38:39 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754954Ab3FKQii (ORCPT ); Tue, 11 Jun 2013 12:38:38 -0400 Received: from co1ehsobe006.messaging.microsoft.com ([216.32.180.189]:59600 "EHLO co1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754847Ab3FKQih (ORCPT ); Tue, 11 Jun 2013 12:38:37 -0400 Received: from mail132-co1-R.bigfish.com (10.243.78.247) by CO1EHSOBE013.bigfish.com (10.243.66.76) with Microsoft SMTP Server id 14.1.225.23; Tue, 11 Jun 2013 16:38:36 +0000 Received: from mail132-co1 (localhost [127.0.0.1]) by mail132-co1-R.bigfish.com (Postfix) with ESMTP id A7087120565; Tue, 11 Jun 2013 16:38:36 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e23h1155h) Received: from mail132-co1 (localhost.localdomain [127.0.0.1]) by mail132-co1 (MessageSwitch) id 1370968714974934_24401; Tue, 11 Jun 2013 16:38:34 +0000 (UTC) Received: from CO1EHSMHS029.bigfish.com (unknown [10.243.78.239]) by mail132-co1.bigfish.com (Postfix) with ESMTP id EAA33AC006A; Tue, 11 Jun 2013 16:38:34 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS029.bigfish.com (10.243.66.39) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 11 Jun 2013 16:38:34 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.2.328.11; Tue, 11 Jun 2013 16:38:33 +0000 Received: from snotra.am.freescale.net ([10.214.81.141]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r5BGcW2B029307; Tue, 11 Jun 2013 09:38:32 -0700 From: Scott Wood To: Alexander Graf , Gleb Natapov , Paolo Bonzini CC: Mihai Caraman , , , Scott Wood Subject: [PATCH v2] kvm/ppc/booke: Delay kvmppc_lazy_ee_enable Date: Tue, 11 Jun 2013 11:38:31 -0500 Message-ID: <1370968711-9357-1-git-send-email-scottwood@freescale.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org kwmppc_lazy_ee_enable() 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_lazy_ee_enable(). Signed-off-by: Scott Wood --- Rebased without patches 5 and 6 in the previous patchset. arch/powerpc/kvm/booke.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 5cd7ad0..1a1b511 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -673,7 +673,6 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) ret = s; goto out; } - kvmppc_lazy_ee_enable(); kvm_guest_enter(); @@ -699,6 +698,8 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) kvmppc_load_guest_fp(vcpu); #endif + kvmppc_lazy_ee_enable(); + ret = __kvmppc_vcpu_run(kvm_run, vcpu); /* No need for kvm_guest_exit. It's done in handle_exit.