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: 190957 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 2047E2C0499 for ; Fri, 12 Oct 2012 03:22:54 +1100 (EST) Received: from va3outboundpool.messaging.microsoft.com (va3ehsobe005.messaging.microsoft.com [216.32.180.31]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "Microsoft Secure Server Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D60A82C03EA for ; Fri, 12 Oct 2012 03:14:29 +1100 (EST) Received: from mail29-va3-R.bigfish.com (10.7.14.241) by VA3EHSOBE012.bigfish.com (10.7.40.62) with Microsoft SMTP Server id 14.1.225.23; Thu, 11 Oct 2012 16:14:25 +0000 Received: from mail29-va3 (localhost [127.0.0.1]) by mail29-va3-R.bigfish.com (Postfix) with ESMTP id F3DC32400AF for ; Thu, 11 Oct 2012 16:14:24 +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 mail29-va3 (localhost.localdomain [127.0.0.1]) by mail29-va3 (MessageSwitch) id 134997206437231_14696; Thu, 11 Oct 2012 16:14:24 +0000 (UTC) Received: from VA3EHSMHS008.bigfish.com (unknown [10.7.14.251]) by mail29-va3.bigfish.com (Postfix) with ESMTP id 03275340054 for ; Thu, 11 Oct 2012 16:14:24 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS008.bigfish.com (10.7.99.18) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 11 Oct 2012 16:14:15 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) 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:14 +0000 Received: from mcaraman-VirtualBox.ea.freescale.net ([10.213.130.145]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id q9BGEC6s028142 for ; Thu, 11 Oct 2012 09:14:13 -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: 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 Cc: Mihai Caraman , linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 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" 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;