[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 23/57] tcg/ppc: Use full load/store helpers in user-only mode, (continued)
- [PATCH v4 21/57] tcg/i386: Use full load/store helpers in user-only mode, Richard Henderson, 2023/05/03
- [PATCH v4 22/57] tcg/aarch64: Use full load/store helpers in user-only mode, Richard Henderson, 2023/05/03
- [PATCH v4 24/57] tcg/loongarch64: Use full load/store helpers in user-only mode, Richard Henderson, 2023/05/03
- [PATCH v4 25/57] tcg/riscv: Use full load/store helpers in user-only mode, 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 27/57] tcg/arm: Use full load/store helpers in user-only mode, Richard Henderson, 2023/05/03
- [PATCH v4 29/57] tcg/s390x: Use full load/store helpers in user-only mode, Richard Henderson, 2023/05/03
- [PATCH v4 28/57] tcg/mips: Use full load/store helpers in user-only mode, Richard Henderson, 2023/05/03
- [PATCH v4 31/57] tcg/sparc64: Rename tcg_out_movi_imm13 to tcg_out_movi_s13, Richard Henderson, 2023/05/03
- [PATCH v4 30/57] tcg/sparc64: Allocate %g2 as a third temporary, Richard Henderson, 2023/05/03