[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 10/45] target/arm: Drop always-true test in define_arm_vh_
From: |
Peter Maydell |
Subject: |
Re: [PATCH v4 10/45] target/arm: Drop always-true test in define_arm_vh_e2h_redirects_aliases |
Date: |
Tue, 3 May 2022 16:59:35 +0100 |
On Sun, 1 May 2022 at 07:00, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> The new_key field is always non-zero -- drop the if.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> @@ -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 <peter.maydell@linaro.org>
thanks
-- PMM
- [PATCH v4 00/45] target/arm: Cleanups, new features, new cpus, Richard Henderson, 2022/05/01
- [PATCH v4 02/45] target/arm: Reorg CPAccessResult and access_check_cp_reg, Richard Henderson, 2022/05/01
- [PATCH v4 04/45] target/arm: Make some more cpreg data static const, Richard Henderson, 2022/05/01
- [PATCH v4 01/45] target/arm: Split out cpregs.h, Richard Henderson, 2022/05/01
- [PATCH v4 06/45] target/arm: Avoid bare abort() or assert(0), Richard Henderson, 2022/05/01
- [PATCH v4 08/45] target/arm: Name CPState type, Richard Henderson, 2022/05/01
- [PATCH v4 03/45] target/arm: Replace sentinels with ARRAY_SIZE in cpregs.h, Richard Henderson, 2022/05/01
- [PATCH v4 10/45] target/arm: Drop always-true test in define_arm_vh_e2h_redirects_aliases, Richard Henderson, 2022/05/01
- Re: [PATCH v4 10/45] target/arm: Drop always-true test in define_arm_vh_e2h_redirects_aliases,
Peter Maydell <=
- [PATCH v4 15/45] target/arm: Use bool for is64 and ns in add_cpreg_to_hashtable, Richard Henderson, 2022/05/01
- [PATCH v4 13/45] target/arm: Hoist computation of key in add_cpreg_to_hashtable, Richard Henderson, 2022/05/01
- [PATCH v4 27/45] target/arm: Set ID_DFR0.PerfMon for qemu-system-arm -cpu max, Richard Henderson, 2022/05/01
- [PATCH v4 20/45] target/arm: Handle cpreg registration for missing EL, Richard Henderson, 2022/05/01
- [PATCH v4 07/45] target/arm: Change cpreg access permissions to enum, Richard Henderson, 2022/05/01