From patchwork Mon Jan 6 18:23:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 307410 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EEEA12C00CD for ; Tue, 7 Jan 2014 05:24:58 +1100 (EST) Received: from localhost ([::1]:36743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0Er8-00038N-Od for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2014 13:24:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0EqS-0002uc-BR for qemu-devel@nongnu.org; Mon, 06 Jan 2014 13:24:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0EqI-0002yY-Qg for qemu-devel@nongnu.org; Mon, 06 Jan 2014 13:24:12 -0500 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:55237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0EqI-0002yF-22 for qemu-devel@nongnu.org; Mon, 06 Jan 2014 13:24:02 -0500 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 Jan 2014 18:24:00 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 6 Jan 2014 18:23:57 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9CD512190059; Mon, 6 Jan 2014 18:23:55 +0000 (GMT) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s06INiBh26411052; Mon, 6 Jan 2014 18:23:44 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s06INuPY017893; Mon, 6 Jan 2014 11:23:56 -0700 Received: from smtp.lab.toulouse-stg.fr.ibm.com (srv01.lab.toulouse-stg.fr.ibm.com [9.101.4.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s06INuCq017886; Mon, 6 Jan 2014 11:23:56 -0700 Received: from bahia.local (sig-9-146-180-150.uk.ibm.com [9.146.180.150]) by smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id 4593B210FFD; Mon, 6 Jan 2014 19:23:55 +0100 (CET) To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org From: Greg Kurz Date: Mon, 06 Jan 2014 19:23:48 +0100 Message-ID: <20140106182221.4294.982.stgit@bahia.local> In-Reply-To: <52CA4FC6.1030801@ozlabs.ru> References: <52CA4FC6.1030801@ozlabs.ru> User-Agent: StGit/0.16 MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14010618-5024-0000-0000-00000852478E X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 195.75.94.107 Cc: aik@ozlabs.ru Subject: [Qemu-devel] [RFC] PPC: KVM: add support for LPCR X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The LPCR special purpose register was introduced with the PowerPC 970MP family. This patch initializes LPCR for the following families: - 970 MP - POWER5+ - POWER7 - POWER8 Signed-off-by: Greg Kurz --- Along with Alexey's fixes for the get/put one reg API, I could drop the target-ppc/kvm.c bits from: http://patchwork.ozlabs.org/patch/300210/ and have cross-endian virtio working. Thanks Alexey. :) target-ppc/translate_init.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 149a932..35470d4 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -2582,7 +2582,6 @@ static void gen_spr_8xx (CPUPPCState *env) * HSRR0 => SPR 314 (Power 2.04 hypv) * HSRR1 => SPR 315 (Power 2.04 hypv) * LPIDR => SPR 317 (970) - * LPCR => SPR 318 (970) * EPR => SPR 702 (Power 2.04 emb) * perf => 768-783 (Power 2.04) * perf => 784-799 (Power 2.04) @@ -6831,6 +6830,11 @@ static void init_proc_970MP (CPUPPCState *env) SPR_NOACCESS, SPR_NOACCESS, &spr_read_hior, &spr_write_hior, 0x00000000); + /* Logical partitionning */ + spr_register_kvm(env, SPR_LPCR, "LPCR", + SPR_NOACCESS, SPR_NOACCESS, + &spr_read_generic, &spr_write_generic, + KVM_REG_PPC_LPCR, 0x00000000); #if !defined(CONFIG_USER_ONLY) env->slb_nr = 32; #endif @@ -6915,6 +6919,11 @@ static void init_proc_power5plus(CPUPPCState *env) &spr_read_generic, &spr_write_generic, &spr_read_generic, &spr_write_generic, 0x00000000); + /* Logical partitionning */ + spr_register_kvm(env, SPR_LPCR, "LPCR", + SPR_NOACCESS, SPR_NOACCESS, + &spr_read_generic, &spr_write_generic, + KVM_REG_PPC_LPCR, 0x00000000); #if !defined(CONFIG_USER_ONLY) env->slb_nr = 64; #endif @@ -7019,6 +7028,11 @@ static void init_proc_POWER7 (CPUPPCState *env) &spr_read_generic, &spr_write_generic, &spr_read_generic, &spr_write_generic, 0x00000000); + /* Logical partitionning */ + spr_register_kvm(env, SPR_LPCR, "LPCR", + SPR_NOACCESS, SPR_NOACCESS, + &spr_read_generic, &spr_write_generic, + KVM_REG_PPC_LPCR, 0x00000000); #if !defined(CONFIG_USER_ONLY) env->slb_nr = 32; #endif