[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 75/85] target/hppa: Add pa2.0 cpu local tlb flushes
|
From: |
Peter Maydell |
|
Subject: |
Re: [PULL 75/85] target/hppa: Add pa2.0 cpu local tlb flushes |
|
Date: |
Thu, 9 Nov 2023 15:12:10 +0000 |
On Tue, 7 Nov 2023 at 03:17, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> From: Helge Deller <deller@gmx.de>
>
> The previous decoding misnamed the bit it called "local".
> Other than the name, the implementation was correct for pa1.x.
> Rename this field to "tlbe".
>
> PA2.0 adds (a real) local bit to PxTLB, and also adds a range
> of pages to flush in GR[b].
>
> Signed-off-by: Helge Deller <deller@gmx.de>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Hi; Coverity points out a potential overflow in this code:
> -/* Purge (Insn/Data) TLB. This is explicitly page-based, and is
> - synchronous across all processors. */
> +/* Purge (Insn/Data) TLB. */
> static void ptlb_work(CPUState *cpu, run_on_cpu_data data)
> {
> CPUHPPAState *env = cpu_env(cpu);
> - target_ulong addr = (target_ulong) data.target_ptr;
> + vaddr start = data.target_ptr;
> + vaddr end;
>
> - hppa_flush_tlb_range(env, addr, addr);
> + /*
> + * PA2.0 allows a range of pages encoded into GR[b], which we have
> + * copied into the bottom bits of the otherwise page-aligned address.
> + * PA1.x will always provide zero here, for a single page flush.
> + */
> + end = start & 0xf;
> + start &= TARGET_PAGE_MASK;
> + end = TARGET_PAGE_SIZE << (2 * end);
Here 2 * end can be 30, but TARGET_PAGE_SIZE is only a 32-bit
type, so the shift might overflow. Cast TARGET_PAGE_SIZE to vaddr
before doing the shift? (CID 1523902)
> + end = start + end - 1;
> +
> + hppa_flush_tlb_range(env, start, end);
> }
thanks
-- PMM
- [PULL 63/85] target/hppa: Implement HAVG, (continued)
- [PULL 63/85] target/hppa: Implement HAVG, Richard Henderson, 2023/11/06
- [PULL 70/85] target/hppa: Return zero for r0 from load_gpr, Richard Henderson, 2023/11/06
- [PULL 66/85] target/hppa: Implement MIXH, MIXW, Richard Henderson, 2023/11/06
- [PULL 68/85] target/hppa: Fix interruption based on default PSW, Richard Henderson, 2023/11/06
- [PULL 69/85] target/hppa: Precompute zero into DisasContext, Richard Henderson, 2023/11/06
- [PULL 73/85] linux-user/hppa: Drop EXCP_DUMP from handled exceptions, Richard Henderson, 2023/11/06
- [PULL 72/85] hw/hppa: Translate phys addresses for the cpu, Richard Henderson, 2023/11/06
- [PULL 78/85] target/hppa: Add unwind_breg to CPUHPPAState, Richard Henderson, 2023/11/06
- [PULL 77/85] target/hppa: Clear upper bits in mtctl for pa1.x, Richard Henderson, 2023/11/06
- [PULL 75/85] target/hppa: Add pa2.0 cpu local tlb flushes, Richard Henderson, 2023/11/06
- Re: [PULL 75/85] target/hppa: Add pa2.0 cpu local tlb flushes,
Peter Maydell <=
- [PULL 71/85] include/hw/elf: Remove truncating signed casts, Richard Henderson, 2023/11/06
- [PULL 65/85] target/hppa: Implement HSHLADD, HSHRADD, Richard Henderson, 2023/11/06
- [PULL 61/85] target/hppa: Implement HADD, Richard Henderson, 2023/11/06
- [PULL 76/85] target/hppa: Avoid async_safe_run_on_cpu on uniprocessor system, Richard Henderson, 2023/11/06
- [PULL 79/85] target/hppa: Create raise_exception_with_ior, Richard Henderson, 2023/11/06
- [PULL 82/85] hw/pci-host/astro: Map Astro chip into 64-bit I/O memory region, Richard Henderson, 2023/11/06
- [PULL 84/85] hw/hppa: Turn on 64-bit CPU for C3700 machine, Richard Henderson, 2023/11/06
- [PULL 85/85] hw/hppa: Allow C3700 with 64-bit and B160L with 32-bit CPU only, Richard Henderson, 2023/11/06
- [PULL 81/85] target/hppa: Improve interrupt logging, Richard Henderson, 2023/11/06
- [PULL 80/85] target/hppa: Update IIAOQ, IIASQ for pa2.0, Richard Henderson, 2023/11/06