From patchwork Mon Jun 25 12:26:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Caraman X-Patchwork-Id: 167075 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 6DFFC10096B for ; Mon, 25 Jun 2012 22:28:17 +1000 (EST) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe006.messaging.microsoft.com [216.32.181.186]) (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 CAEA6B6FBB for ; Mon, 25 Jun 2012 22:26:49 +1000 (EST) Received: from mail164-ch1-R.bigfish.com (10.43.68.253) by CH1EHSOBE006.bigfish.com (10.43.70.56) with Microsoft SMTP Server id 14.1.225.23; Mon, 25 Jun 2012 12:25:07 +0000 Received: from mail164-ch1 (localhost [127.0.0.1]) by mail164-ch1-R.bigfish.com (Postfix) with ESMTP id AC0A834037B for ; Mon, 25 Jun 2012 12:25:06 +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 mail164-ch1 (localhost.localdomain [127.0.0.1]) by mail164-ch1 (MessageSwitch) id 1340627104722966_12303; Mon, 25 Jun 2012 12:25:04 +0000 (UTC) Received: from CH1EHSMHS007.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.243]) by mail164-ch1.bigfish.com (Postfix) with ESMTP id 9F611A0240 for ; Mon, 25 Jun 2012 12:25:04 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS007.bigfish.com (10.43.70.7) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 25 Jun 2012 12:25:04 +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:40 -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 q5PCQdqo019303 for ; Mon, 25 Jun 2012 05:26:40 -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 q5PCQdtB011611; 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 q5PCQdHQ011610; Mon, 25 Jun 2012 15:26:39 +0300 From: Mihai Caraman To: , , , Subject: [RFC PATCH 03/17] KVM: PPC64: booke: Add EPCR support in sregs Date: Mon, 25 Jun 2012 15:26:21 +0300 Message-ID: <1340627195-11544-4-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 Cc: Mihai Caraman X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15rc1 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 | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index f9fa260..d15c4b5 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -1052,6 +1052,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; @@ -1063,6 +1066,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; +#ifdef CONFIG_64BIT + sregs->u.e.epcr = vcpu->arch.epcr; +#endif } static int set_sregs_base(struct kvm_vcpu *vcpu, @@ -1071,6 +1077,11 @@ static int set_sregs_base(struct kvm_vcpu *vcpu, if (!(sregs->u.e.features & KVM_SREGS_E_BASE)) return 0; +#ifdef CONFIG_64BIT + if (!(sregs->u.e.features & KVM_SREGS_E_64)) + return 0; +#endif + vcpu->arch.csrr0 = sregs->u.e.csrr0; vcpu->arch.csrr1 = sregs->u.e.csrr1; vcpu->arch.mcsr = sregs->u.e.mcsr; @@ -1078,6 +1089,9 @@ 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); +#ifdef CONFIG_64BIT + kvmppc_set_epcr(vcpu, sregs->u.e.epcr); +#endif if (sregs->u.e.update_special & KVM_SREGS_E_UPDATE_DEC) { vcpu->arch.dec = sregs->u.e.dec;