[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 26/57] tcg/arm: Adjust constraints on qemu_ld/st
From: |
Peter Maydell |
Subject: |
Re: [PATCH v4 26/57] tcg/arm: Adjust constraints on qemu_ld/st |
Date: |
Fri, 5 May 2023 13:14:18 +0100 |
On Wed, 3 May 2023 at 08:10, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Always reserve r3 for tlb softmmu lookup. Fix a bug in user-only
> ALL_QLDST_REGS, in that r14 is clobbered by the BLNE that leads
> to the misaligned trap.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> /*
> - * r0-r2 will be overwritten when reading the tlb entry (softmmu only)
> - * and r0-r1 doing the byte swapping, so don't use these.
> - * r3 is removed for softmmu to avoid clashes with helper arguments.
> + * r0-r3 will be overwritten when reading the tlb entry (softmmu only);
> + * r14 will be overwritten by the BLNE branching to the slow path.
> */
> #ifdef CONFIG_SOFTMMU
> -#define ALL_QLOAD_REGS \
> +#define ALL_QLDST_REGS \
> (ALL_GENERAL_REGS & ~((1 << TCG_REG_R0) | (1 << TCG_REG_R1) | \
> (1 << TCG_REG_R2) | (1 << TCG_REG_R3) | \
> (1 << TCG_REG_R14)))
> -#define ALL_QSTORE_REGS \
> - (ALL_GENERAL_REGS & ~((1 << TCG_REG_R0) | (1 << TCG_REG_R1) | \
> - (1 << TCG_REG_R2) | (1 << TCG_REG_R14) | \
> - ((TARGET_LONG_BITS == 64) << TCG_REG_R3)))
> #else
> -#define ALL_QLOAD_REGS ALL_GENERAL_REGS
> -#define ALL_QSTORE_REGS \
> - (ALL_GENERAL_REGS & ~((1 << TCG_REG_R0) | (1 << TCG_REG_R1)))
> +#define ALL_QLDST_REGS (ALL_GENERAL_REGS & ~(1 << TCG_REG_R14))
> #endif
Why is it OK not to remove r0 and r1 from this any more ?
The commit message doesn't say anything about this bit of the change.
-- PMM
- Re: [PATCH v4 36/57] tcg/loongarch64: Assert the host supports unaligned accesses, (continued)
- [PATCH v4 35/57] accel/tcg: Remove helper_unaligned_{ld,st}, Richard Henderson, 2023/05/03
- [PATCH v4 32/57] tcg/sparc64: Rename tcg_out_movi_imm32 to tcg_out_movi_u32, Richard Henderson, 2023/05/03
- [PATCH v4 38/57] tcg/riscv: Support softmmu unaligned accesses, Richard Henderson, 2023/05/03
- [PATCH v4 26/57] tcg/arm: Adjust constraints on qemu_ld/st, Richard Henderson, 2023/05/03
- Re: [PATCH v4 26/57] tcg/arm: Adjust constraints on qemu_ld/st,
Peter Maydell <=
- [PATCH v4 39/57] tcg: Introduce tcg_target_has_memory_bswap, Richard Henderson, 2023/05/03
- [PATCH v4 34/57] tcg/sparc64: Use standard slow path for softmmu, Richard Henderson, 2023/05/03
- [PATCH v4 37/57] tcg/loongarch64: Support softmmu unaligned accesses, Richard Henderson, 2023/05/03
- [PATCH v4 42/57] tcg: Introduce atom_and_align_for_opc, Richard Henderson, 2023/05/03
- [PATCH v4 40/57] tcg: Add INDEX_op_qemu_{ld,st}_i128, Richard Henderson, 2023/05/03