From patchwork Mon Jun 25 12:26:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Caraman X-Patchwork-Id: 167074 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 A5E911008AA for ; Mon, 25 Jun 2012 22:27:28 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756215Ab2FYM1T (ORCPT ); Mon, 25 Jun 2012 08:27:19 -0400 Received: from ch1ehsobe002.messaging.microsoft.com ([216.32.181.182]:1234 "EHLO ch1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756279Ab2FYM0t (ORCPT ); Mon, 25 Jun 2012 08:26:49 -0400 Received: from mail21-ch1-R.bigfish.com (10.43.68.244) by CH1EHSOBE008.bigfish.com (10.43.70.58) with Microsoft SMTP Server id 14.1.225.23; Mon, 25 Jun 2012 12:25:09 +0000 Received: from mail21-ch1 (localhost [127.0.0.1]) by mail21-ch1-R.bigfish.com (Postfix) with ESMTP id 9B34F4601C4; Mon, 25 Jun 2012 12:25:09 +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(zzzz1202hzz8275bhz2dh2a8h668h839hd24he5bhf0ah) Received: from mail21-ch1 (localhost.localdomain [127.0.0.1]) by mail21-ch1 (MessageSwitch) id 1340627107602479_6491; Mon, 25 Jun 2012 12:25:07 +0000 (UTC) Received: from CH1EHSMHS009.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.240]) by mail21-ch1.bigfish.com (Postfix) with ESMTP id 911B360047; Mon, 25 Jun 2012 12:25:07 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS009.bigfish.com (10.43.70.9) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 25 Jun 2012 12:25:07 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.298.5; Mon, 25 Jun 2012 07:26:43 -0500 Received: from mcaraman-VirtualBox.ea.freescale.net ([10.213.130.145]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id q5PCQgHv019353; Mon, 25 Jun 2012 05:26:43 -0700 Received: from mcaraman-VirtualBox.ea.freescale.net (localhost [127.0.0.1]) by mcaraman-VirtualBox.ea.freescale.net (8.14.4/8.14.4/Debian-2ubuntu1) with ESMTP id q5PCQdGf011615; Mon, 25 Jun 2012 15:26:39 +0300 Received: (from mcaraman@localhost) by mcaraman-VirtualBox.ea.freescale.net (8.14.4/8.14.4/Submit) id q5PCQdnh011614; Mon, 25 Jun 2012 15:26:39 +0300 From: Mihai Caraman To: , , , CC: Mihai Caraman Subject: [RFC PATCH 04/17] KVM: PPC64: booke: Add guest computation mode for irq delivery Date: Mon, 25 Jun 2012 15:26:22 +0300 Message-ID: <1340627195-11544-5-git-send-email-mihai.caraman@freescale.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1340627195-11544-1-git-send-email-mihai.caraman@freescale.com> References: <1340627195-11544-1-git-send-email-mihai.caraman@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.net Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org When delivering guest IRQs, update MSR computaion mode according to guest interrupt computation mode found in EPCR. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/booke.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index d15c4b5..93b48e0 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -287,6 +287,7 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu, bool crit; bool keep_irq = false; enum int_class int_class; + ulong msr_cm = 0; /* Truncate crit indicators in 32 bit mode */ if (!(vcpu->arch.shared->msr & MSR_SF)) { @@ -299,6 +300,10 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu, /* ... and we're in supervisor mode */ crit = crit && !(vcpu->arch.shared->msr & MSR_PR); +#ifdef CONFIG_64BIT + msr_cm = vcpu->arch.epcr & SPRN_EPCR_ICM ? MSR_CM : 0; +#endif + if (priority == BOOKE_IRQPRIO_EXTERNAL_LEVEL) { priority = BOOKE_IRQPRIO_EXTERNAL; keep_irq = true; @@ -381,7 +386,8 @@ static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu, set_guest_esr(vcpu, vcpu->arch.queued_esr); if (update_dear == true) set_guest_dear(vcpu, vcpu->arch.queued_dear); - kvmppc_set_msr(vcpu, vcpu->arch.shared->msr & msr_mask); + kvmppc_set_msr(vcpu, (vcpu->arch.shared->msr & msr_mask) + | msr_cm); if (!keep_irq) clear_bit(priority, &vcpu->arch.pending_exceptions);