From patchwork Mon Jun 30 12:55:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Caraman X-Patchwork-Id: 365589 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C81411400D4 for ; Mon, 30 Jun 2014 22:56:41 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id A2A401A0852 for ; Mon, 30 Jun 2014 22:56:41 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2lp0206.outbound.protection.outlook.com [207.46.163.206]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id E9CD11A069E for ; Mon, 30 Jun 2014 22:55:42 +1000 (EST) Received: from BLUPR03CA034.namprd03.prod.outlook.com (10.141.30.27) by BY2PR03MB507.namprd03.prod.outlook.com (10.141.143.21) with Microsoft SMTP Server (TLS) id 15.0.974.11; Mon, 30 Jun 2014 12:55:35 +0000 Received: from BY2FFO11FD014.protection.gbl (2a01:111:f400:7c0c::178) by BLUPR03CA034.outlook.office365.com (2a01:111:e400:879::27) with Microsoft SMTP Server (TLS) id 15.0.974.11 via Frontend Transport; Mon, 30 Jun 2014 12:55:34 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD014.mail.protection.outlook.com (10.1.14.76) with Microsoft SMTP Server (TLS) id 15.0.969.12 via Frontend Transport; Mon, 30 Jun 2014 12:55:33 +0000 Received: from fsr-fed1764-012.ea.freescale.net (fsr-fed1764-012-010171073213.ea.freescale.net [10.171.73.213]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s5UCtVej018914; Mon, 30 Jun 2014 05:55:32 -0700 From: Mihai Caraman To: Subject: [PATCH] KVM: PPC: e500: Emulate power management control SPR Date: Mon, 30 Jun 2014 15:55:29 +0300 Message-ID: <1404132929-27308-1-git-send-email-mihai.caraman@freescale.com> X-Mailer: git-send-email 1.7.11.7 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(199002)(189002)(83322001)(79102001)(77982001)(85852003)(33646001)(76482001)(85306003)(95666004)(68736004)(74502001)(19580405001)(69596002)(19580395003)(44976005)(62966002)(46102001)(50986999)(21056001)(99396002)(83072002)(97736001)(89996001)(50226001)(4396001)(88136002)(48376002)(77156001)(50466002)(81542001)(105606002)(81342001)(74662001)(104166001)(31966008)(92566001)(92726001)(26826002)(86362001)(93916002)(102836001)(36756003)(84676001)(81156004)(87286001)(104016002)(6806004)(106466001)(87936001)(107046002)(64706001)(80022001)(2351001)(20776003)(47776003)(229853001); DIR:OUT; SFP:; SCL:1; SRVR:BY2PR03MB507; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 0258E7CCD4 Received-SPF: Fail (: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=mihai.caraman@freescale.com; X-OriginatorOrg: freescale.com Cc: Mihai Caraman , linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" For FSL e6500 core the kernel uses power management SPR register (PWRMGTCR0) to enable idle power down for cores and devices by setting up the idle count period at boot time. With the host already controlling the power management configuration the guest could simply benefit from it, so emulate guest request as nop. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/e500_emulate.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c index 002d517..98a22e5 100644 --- a/arch/powerpc/kvm/e500_emulate.c +++ b/arch/powerpc/kvm/e500_emulate.c @@ -250,6 +250,10 @@ int kvmppc_core_emulate_mtspr_e500(struct kvm_vcpu *vcpu, int sprn, ulong spr_va spr_val); break; + case SPRN_PWRMGTCR0: + /* Guest relies on host power management configurations */ + break; + /* extra exceptions */ case SPRN_IVOR32: vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL] = spr_val; @@ -355,6 +359,10 @@ int kvmppc_core_emulate_mfspr_e500(struct kvm_vcpu *vcpu, int sprn, ulong *spr_v *spr_val = 0; break; + case SPRN_PWRMGTCR0: + *spr_val = 0; + break; + case SPRN_MMUCFG: *spr_val = vcpu->arch.mmucfg; break;