On Sun, 1 May 2022 at 07:00, Richard Henderson
<[email protected]> wrote:
>
> The new_key field is always non-zero -- drop the if.
>
> Signed-off-by: Richard Henderson <[email protected]>
> ---
> @@ -5933,19 +5935,16 @@ static void
> define_arm_vh_e2h_redirects_aliases(ARMCPU *cpu)
> g_assert(src_reg->opaque == NULL);
>
> /* Create alias before redirection so we dup the right data. */
> - if (a->new_key) {
> - ARMCPRegInfo *new_reg = g_memdup(src_reg, sizeof(ARMCPRegInfo));
> - uint32_t *new_key = g_memdup(&a->new_key, sizeof(uint32_t));
> - bool ok;
> + new_reg = g_memdup(src_reg, sizeof(ARMCPRegInfo));
> + new_key = g_memdup(&a->new_key, sizeof(uint32_t));
>
> - new_reg->name = a->new_name;
> - new_reg->type |= ARM_CP_ALIAS;
> - /* Remove PL1/PL0 access, leaving PL2/PL3 R/W in place. */
> - new_reg->access &= PL2_RW | PL3_RW;
> + new_reg->name = a->new_name;
> + new_reg->type |= ARM_CP_ALIAS;
> + /* Remove PL1/PL0 access, leaving PL2/PL3 R/W in place. */
> + new_reg->access &= PL2_RW;
This has lost the "| PL3_RW" somehow.
>
> - ok = g_hash_table_insert(cpu->cp_regs, new_key, new_reg);
> - g_assert(ok);
> - }
> + ok = g_hash_table_insert(cpu->cp_regs, new_key, new_reg);
> + g_assert(ok);
Otherwise
Reviewed-by: Peter Maydell <[email protected]>
thanks
-- PMM