From patchwork Thu Oct 11 16:13:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Caraman X-Patchwork-Id: 1582591 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 74FA23FCFC for ; Thu, 11 Oct 2012 16:14:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757734Ab2JKQOo (ORCPT ); Thu, 11 Oct 2012 12:14:44 -0400 Received: from va3ehsobe002.messaging.microsoft.com ([216.32.180.12]:25429 "EHLO va3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754920Ab2JKQOX (ORCPT ); Thu, 11 Oct 2012 12:14:23 -0400 Received: from mail223-va3-R.bigfish.com (10.7.14.249) by VA3EHSOBE001.bigfish.com (10.7.40.21) with Microsoft SMTP Server id 14.1.225.23; Thu, 11 Oct 2012 16:14:22 +0000 Received: from mail223-va3 (localhost [127.0.0.1]) by mail223-va3-R.bigfish.com (Postfix) with ESMTP id 9DE13B00070; Thu, 11 Oct 2012 16:14:22 +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(zzzz1202h1d1ah1d2ahzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1155h) Received: from mail223-va3 (localhost.localdomain [127.0.0.1]) by mail223-va3 (MessageSwitch) id 1349972060115729_17908; Thu, 11 Oct 2012 16:14:20 +0000 (UTC) Received: from VA3EHSMHS004.bigfish.com (unknown [10.7.14.235]) by mail223-va3.bigfish.com (Postfix) with ESMTP id 177CB180047; Thu, 11 Oct 2012 16:14:20 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS004.bigfish.com (10.7.99.14) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 11 Oct 2012 16:14:16 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.2.309.3; Thu, 11 Oct 2012 16:14:15 +0000 Received: from mcaraman-VirtualBox.ea.freescale.net ([10.213.130.145]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id q9BGEDJC003790; Thu, 11 Oct 2012 09:14:15 -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 q9BGE9wi023119; Thu, 11 Oct 2012 19:14:09 +0300 Received: (from mcaraman@localhost) by mcaraman-VirtualBox.ea.freescale.net (8.14.4/8.14.4/Submit) id q9BGE9eY023118; Thu, 11 Oct 2012 19:14:09 +0300 From: Mihai Caraman To: CC: , , Mihai Caraman Subject: [PATCH 11/12] KVM: PPC: booke: Add EPCR support in sregs Date: Thu, 11 Oct 2012 19:13:28 +0300 Message-ID: <1349972009-23027-12-git-send-email-mihai.caraman@freescale.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1349972009-23027-1-git-send-email-mihai.caraman@freescale.com> References: <1349972009-23027-1-git-send-email-mihai.caraman@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.net Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Add KVM_SREGS_E_64 feature and EPCR spr support in get/set sregs for 64-bit hosts. Signed-off-by: Mihai Caraman --- arch/powerpc/kvm/booke.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index e6159f5..d396374 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -1215,6 +1215,9 @@ static void get_sregs_base(struct kvm_vcpu *vcpu, u64 tb = get_tb(); sregs->u.e.features |= KVM_SREGS_E_BASE; +#ifdef CONFIG_64BIT + sregs->u.e.features |= KVM_SREGS_E_64; +#endif sregs->u.e.csrr0 = vcpu->arch.csrr0; sregs->u.e.csrr1 = vcpu->arch.csrr1; @@ -1226,6 +1229,9 @@ static void get_sregs_base(struct kvm_vcpu *vcpu, sregs->u.e.dec = kvmppc_get_dec(vcpu, tb); sregs->u.e.tb = tb; sregs->u.e.vrsave = vcpu->arch.vrsave; +#if defined(CONFIG_64BIT) && defined(CONFIG_KVM_BOOKE_HV) + sregs->u.e.epcr = vcpu->arch.epcr; +#endif } static int set_sregs_base(struct kvm_vcpu *vcpu, @@ -1241,6 +1247,7 @@ static int set_sregs_base(struct kvm_vcpu *vcpu, set_guest_dear(vcpu, sregs->u.e.dear); vcpu->arch.vrsave = sregs->u.e.vrsave; kvmppc_set_tcr(vcpu, sregs->u.e.tcr); + kvmppc_set_epcr(vcpu, sregs->u.e.epcr); if (sregs->u.e.update_special & KVM_SREGS_E_UPDATE_DEC) { vcpu->arch.dec = sregs->u.e.dec;