Commit e57448f11cb29c9b36acd117349070fe290465fa

Authored by j_mayer
1 parent d63001d1

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
... ... @@ -324,7 +324,7 @@ void glue(do_dcbz_64, MEMSUFFIX) (void)
324 324 int dcache_line_size = env->dcache_line_size;
325 325  
326 326 /* XXX: should be 970 specific (?) */
327   - if (((env->spr[SPR_970_HID5] >> 7) & 0x3) == 1)
  327 + if (((env->spr[SPR_970_HID5] >> 6) & 0x3) == 0x2)
328 328 dcache_line_size = 32;
329 329 glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x00), 0);
330 330 glue(stl, MEMSUFFIX)((uint64_t)(T0 + 0x04), 0);
... ...
target-ppc/translate_init.c
... ... @@ -4063,6 +4063,16 @@ static void init_proc_970 (CPUPPCState *env)
4063 4063 SPR_NOACCESS, SPR_NOACCESS,
4064 4064 &spr_read_generic, &spr_write_generic,
4065 4065 0x00000000);
  4066 + /* XXX : not implemented */
  4067 + spr_register(env, SPR_970_HID5, "HID5",
  4068 + SPR_NOACCESS, SPR_NOACCESS,
  4069 + &spr_read_generic, &spr_write_generic,
  4070 +#if defined(CONFIG_USER_ONLY)
  4071 + 0x00000080
  4072 +#else
  4073 + 0x00000000
  4074 +#endif
  4075 + );
4066 4076 /* Memory management */
4067 4077 /* XXX: not correct */
4068 4078 gen_low_BATs(env);
... ... @@ -4116,7 +4126,12 @@ static void init_proc_970FX (CPUPPCState *env)
4116 4126 spr_register(env, SPR_970_HID5, "HID5",
4117 4127 SPR_NOACCESS, SPR_NOACCESS,
4118 4128 &spr_read_generic, &spr_write_generic,
4119   - 0x00000000);
  4129 +#if defined(CONFIG_USER_ONLY)
  4130 + 0x00000080
  4131 +#else
  4132 + 0x00000000
  4133 +#endif
  4134 + );
4120 4135 /* Memory management */
4121 4136 /* XXX: not correct */
4122 4137 gen_low_BATs(env);
... ... @@ -4170,7 +4185,12 @@ static void init_proc_970GX (CPUPPCState *env)
4170 4185 spr_register(env, SPR_970_HID5, "HID5",
4171 4186 SPR_NOACCESS, SPR_NOACCESS,
4172 4187 &spr_read_generic, &spr_write_generic,
4173   - 0x00000000);
  4188 +#if defined(CONFIG_USER_ONLY)
  4189 + 0x00000080
  4190 +#else
  4191 + 0x00000000
  4192 +#endif
  4193 + );
4174 4194 /* Memory management */
4175 4195 /* XXX: not correct */
4176 4196 gen_low_BATs(env);
... ...