From patchwork Tue May 14 00:44:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Wood X-Patchwork-Id: 243552 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 D5A512C00BB for ; Tue, 14 May 2013 10:45:03 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755604Ab3ENApC (ORCPT ); Mon, 13 May 2013 20:45:02 -0400 Received: from ch1ehsobe006.messaging.microsoft.com ([216.32.181.186]:20845 "EHLO ch1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754815Ab3ENAoz (ORCPT ); Mon, 13 May 2013 20:44:55 -0400 Received: from mail105-ch1-R.bigfish.com (10.43.68.250) by CH1EHSOBE006.bigfish.com (10.43.70.56) with Microsoft SMTP Server id 14.1.225.23; Tue, 14 May 2013 00:44:54 +0000 Received: from mail105-ch1 (localhost [127.0.0.1]) by mail105-ch1-R.bigfish.com (Postfix) with ESMTP id 3BE4D1002E2; Tue, 14 May 2013 00:44:54 +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(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1155h) Received: from mail105-ch1 (localhost.localdomain [127.0.0.1]) by mail105-ch1 (MessageSwitch) id 1368492292353620_28763; Tue, 14 May 2013 00:44:52 +0000 (UTC) Received: from CH1EHSMHS012.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.243]) by mail105-ch1.bigfish.com (Postfix) with ESMTP id 53BCF3E0077; Tue, 14 May 2013 00:44:52 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS012.bigfish.com (10.43.70.12) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 14 May 2013 00:44:49 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.328.11; Tue, 14 May 2013 00:44:48 +0000 Received: from snotra.am.freescale.net ([10.214.85.128]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r4E0ig53004956; Mon, 13 May 2013 17:44:47 -0700 From: Scott Wood To: Alexander Graf CC: , , Scott Wood Subject: [PATCH v3 1/3] kvm/ppc/booke64: Fix lazy ee handling in kvmppc_handle_exit() Date: Mon, 13 May 2013 19:44:39 -0500 Message-ID: <1368492281-30473-2-git-send-email-scottwood@freescale.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1368492281-30473-1-git-send-email-scottwood@freescale.com> References: <1368492281-30473-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 --- v3: Add comment requested by Tiejun --- 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 1020119..83f84c5 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -833,6 +833,17 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, int r = RESUME_HOST; int s; +#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);