From e57448f11cb29c9b36acd117349070fe290465fa Mon Sep 17 00:00:00 2001 From: j_mayer Date: Thu, 4 Oct 2007 01:50:03 +0000 Subject: [PATCH] More cache tuning fixes: * fix the tunable cache line size probe for PowerPC 970. * initialize HID5 so cache line is 32 bytes long when running in user-mode only git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3322 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-ppc/op_helper_mem.h | 2 +- target-ppc/translate_init.c | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/target-ppc/op_helper_mem.h b/target-ppc/op_helper_mem.h index f5cb6970c4..4b0bb841e5 100644 --- a/target-ppc/op_helper_mem.h +++ b/target-ppc/op_helper_mem.h @@ -324,7 +324,7 @@ void glue(do_dcbz_64, MEMSUFFIX) (void) int dcache_line_size = env->dcache_line_size; /* XXX: should be 970 specific (?) */ - if (((env->spr[SPR_970_HID5] >> 7) & 0x3) == 1) + if (((env->spr[SPR_970_HID5] >> 6) & 0x3) == 0x2) dcache_line_size = 32; glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0); glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0); diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 445cb58186..606a04f254 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -4063,6 +4063,16 @@ static void init_proc_970 (CPUPPCState *env) SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, 0x00000000); + /* XXX : not implemented */ + spr_register(env, SPR_970_HID5, "HID5", + SPR_NOACCESS, SPR_NOACCESS, + &spr_read_generic, &spr_write_generic, +#if defined(CONFIG_USER_ONLY) + 0x00000080 +#else + 0x00000000 +#endif + ); /* Memory management */ /* XXX: not correct */ gen_low_BATs(env); @@ -4116,7 +4126,12 @@ static void init_proc_970FX (CPUPPCState *env) spr_register(env, SPR_970_HID5, "HID5", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, - 0x00000000); +#if defined(CONFIG_USER_ONLY) + 0x00000080 +#else + 0x00000000 +#endif + ); /* Memory management */ /* XXX: not correct */ gen_low_BATs(env); @@ -4170,7 +4185,12 @@ static void init_proc_970GX (CPUPPCState *env) spr_register(env, SPR_970_HID5, "HID5", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, - 0x00000000); +#if defined(CONFIG_USER_ONLY) + 0x00000080 +#else + 0x00000000 +#endif + ); /* Memory management */ /* XXX: not correct */ gen_low_BATs(env); -- 2.11.0