From patchwork Fri Jun 7 00:16:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 249569 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 2D8252C0095 for ; Fri, 7 Jun 2013 10:17:21 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754127Ab3FGARB (ORCPT ); Thu, 6 Jun 2013 20:17:01 -0400 Received: from co9ehsobe004.messaging.microsoft.com ([207.46.163.27]:35924 "EHLO co9outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754357Ab3FGAQt (ORCPT ); Thu, 6 Jun 2013 20:16:49 -0400 Received: from mail43-co9-R.bigfish.com (10.236.132.235) by CO9EHSOBE035.bigfish.com (10.236.130.98) with Microsoft SMTP Server id 14.1.225.23; Fri, 7 Jun 2013 00:16:48 +0000 Received: from mail43-co9 (localhost [127.0.0.1]) by mail43-co9-R.bigfish.com (Postfix) with ESMTP id 8D62DA40306; Fri, 7 Jun 2013 00:16:48 +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(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dfeh1dffh1e23h1155h) Received: from mail43-co9 (localhost.localdomain [127.0.0.1]) by mail43-co9 (MessageSwitch) id 137056420410555_27746; Fri, 7 Jun 2013 00:16:44 +0000 (UTC) Received: from CO9EHSMHS009.bigfish.com (unknown [10.236.132.253]) by mail43-co9.bigfish.com (Postfix) with ESMTP id ECE8430004A; Fri, 7 Jun 2013 00:16:43 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO9EHSMHS009.bigfish.com (10.236.130.19) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 7 Jun 2013 00:16:42 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.328.11; Fri, 7 Jun 2013 00:17:59 +0000 Received: from snotra.am.freescale.net ([10.214.84.112]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r570GbSQ025380; Thu, 6 Jun 2013 17:16:41 -0700 From: Scott Wood To: Alexander Graf , Gleb Natapov , Paolo Bonzini CC: Mihai Caraman , , , Scott Wood Subject: [PATCH 4/8] kvm/ppc/booke64: Fix lazy ee handling in kvmppc_handle_exit() Date: Thu, 6 Jun 2013 19:16:32 -0500 Message-ID: <1370564196-3821-5-git-send-email-scottwood@freescale.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1370564196-3821-1-git-send-email-scottwood@freescale.com> References: <1370564196-3821-1-git-send-email-scottwood@freescale.com> 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 EE is hard-disabled on entry to kvmppc_handle_exit(), so call hard_irq_disable() so that PACA_IRQ_HARD_DIS is set, and soft_enabled is unset. Without this, we get warnings such as arch/powerpc/kernel/time.c:300, and sometimes host kernel hangs. Signed-off-by: Scott Wood --- arch/powerpc/kvm/booke.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index ecbe908..5cd7ad0 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -834,6 +834,17 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, int s; int idx; +#ifdef CONFIG_PPC64 + WARN_ON(local_paca->irq_happened != 0); +#endif + + /* + * We enter with interrupts disabled in hardware, but + * we need to call hard_irq_disable anyway to ensure that + * the software state is kept in sync. + */ + hard_irq_disable(); + /* update before a new last_exit_type is rewritten */ kvmppc_update_timing_stats(vcpu);