Received: from eggs.gnu.org ([2001:4830:134:3::10]:56026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wrl1M-0008DT-Lz for qemu-devel@nongnu.org; Tue, 03 Jun 2014 05:29:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wrl15-0000bq-LY for qemu-devel@nongnu.org; Tue, 03 Jun 2014 05:28:40 -0400 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:52128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wrl13-0000Wj-JM for qemu-devel@nongnu.org; Tue, 03 Jun 2014 05:28:23 -0400 Received: from /spool/local by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Jun 2014 19:28:17 +1000 From: Alexey Kardashevskiy Date: Tue, 3 Jun 2014 19:27:50 +1000 Message-Id: <1401787684-31895-16-git-send-email-aik@ozlabs.ru> In-Reply-To: <1401787684-31895-1-git-send-email-aik@ozlabs.ru> References: <1401787684-31895-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH v4 15/29] target-ppc: Make use of gen_spr_book3s_altivec() for POWER7/8 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Tom Musta , qemu-ppc@nongnu.org, Alexander Graf This replaces VRSAVE registration and vscr_init() call with gen_spr_book3s_altivec() which is generic and does the same thing if insns_flags has PPC_ALTIVEC bit set (which POWER7/8 have set). Signed-off-by: Alexey Kardashevskiy --- Here is the function for the reference: static void gen_spr_book3s_altivec(CPUPPCState *env) { if (!(env->insns_flags & PPC_ALTIVEC)) { return; } spr_register(env, SPR_VRSAVE, "SPR_VRSAVE", &spr_read_generic, &spr_write_generic, &spr_read_generic, &spr_write_generic, 0x00000000); /* Can't find information on what this should be on reset. This * value is the one used by 74xx processors. */ vscr_init(env, 0x00010000); } --- target-ppc/translate_init.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 576056c..40c8ce1 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -7778,6 +7778,7 @@ static void init_proc_POWER7 (CPUPPCState *env) { gen_spr_ne_601(env); gen_spr_7xx(env); + gen_spr_book3s_altivec(env); /* Time base */ gen_tbl(env); #if !defined(CONFIG_USER_ONLY) @@ -7801,10 +7802,6 @@ static void init_proc_POWER7 (CPUPPCState *env) gen_spr_power6_common(env); gen_spr_power6_dbg(env); gen_spr_amr(env); - spr_register(env, SPR_VRSAVE, "SPR_VRSAVE", - &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, @@ -7819,9 +7816,6 @@ static void init_proc_POWER7 (CPUPPCState *env) /* Allocate hardware IRQ controller */ ppcPOWER7_irq_init(env); - /* Can't find information on what this should be on reset. This - * value is the one used by 74xx processors. */ - vscr_init(env, 0x00010000); } POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) -- 2.0.0