[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 34/35] target/ppc: Use probe_write for DCBZ
From: |
Greg Kurz |
Subject: |
Re: [PULL 34/35] target/ppc: Use probe_write for DCBZ |
Date: |
Wed, 12 Feb 2020 19:48:25 +0100 |
On Mon, 3 Feb 2020 17:11:22 +1100
David Gibson <address@hidden> wrote:
> From: Richard Henderson <address@hidden>
>
> Using probe_write instead of tlb_vaddr_to_host means that we
> process watchpoints and notdirty pages more efficiently.
>
> Signed-off-by: Richard Henderson <address@hidden>
> Message-Id: <address@hidden>
> Tested-by: Howard Spoelstra <address@hidden>
> Signed-off-by: David Gibson <address@hidden>
> ---
> target/ppc/mem_helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/ppc/mem_helper.c b/target/ppc/mem_helper.c
> index 0cb78777e7..98f589552b 100644
> --- a/target/ppc/mem_helper.c
> +++ b/target/ppc/mem_helper.c
> @@ -298,7 +298,7 @@ static void dcbz_common(CPUPPCState *env, target_ulong
> addr,
> }
>
> /* Try fast path translate */
> - haddr = tlb_vaddr_to_host(env, addr, MMU_DATA_STORE, mmu_idx);
> + haddr = probe_write(env, addr, dcbz_size, mmu_idx, retaddr);
Hi Richard,
This one is making coverity unhappy.
** CID 1419390: Memory - corruptions (OVERRUN)
______________________________________________________________________________________________________
*** CID 1419390: Memory - corruptions (OVERRUN)
/target/ppc/mem_helper.c: 301 in dcbz_common()
295 /* Check reservation */
296 if ((env->reserve_addr & mask) == addr) {
297 env->reserve_addr = (target_ulong)-1ULL;
298 }
299
300 /* Try fast path translate */
>>> CID 1419390: Memory - corruptions (OVERRUN)
>>> Overrunning callee's array of size 9 by passing argument "mmu_idx"
>>> (which evaluates to 9) in call to "probe_write".
301 haddr = probe_write(env, addr, dcbz_size, mmu_idx, retaddr);
302 if (haddr) {
303 memset(haddr, 0, dcbz_size);
304 } else {
305 /* Slow path */
306 for (i = 0; i < dcbz_size; i += 8) {
Can you have a look ?
Cheers,
--
Greg
> if (haddr) {
> memset(haddr, 0, dcbz_size);
> } else {
- [PULL 25/35] ppc: spapr: Introduce FWNMI capability, (continued)
- [PULL 25/35] ppc: spapr: Introduce FWNMI capability, David Gibson, 2020/02/03
- [PULL 15/35] tpm_spapr: Support TPM for ppc64 using CRQ based interface, David Gibson, 2020/02/03
- [PULL 18/35] docs/specs/tpm: reST-ify TPM documentation, David Gibson, 2020/02/03
- [PULL 23/35] target/ppc/cpu.h: Put macro parameter in parentheses, David Gibson, 2020/02/03
- [PULL 24/35] Wrapper function to wait on condition for the main loop mutex, David Gibson, 2020/02/03
- [PULL 21/35] ppc/pnv: change the PowerNV machine devices to be non user creatable, David Gibson, 2020/02/03
- [PULL 04/35] hw/ppc/prep: Remove the deprecated "prep" machine and the OpenHackware BIOS, David Gibson, 2020/02/03
- [PULL 32/35] target/ppc: Use probe_access for LMW, STMW, David Gibson, 2020/02/03
- [PULL 28/35] ppc: spapr: Handle "ibm, nmi-register" and "ibm, nmi-interlock" RTAS calls, David Gibson, 2020/02/03
- [PULL 34/35] target/ppc: Use probe_write for DCBZ, David Gibson, 2020/02/03
- Re: [PULL 34/35] target/ppc: Use probe_write for DCBZ,
Greg Kurz <=
- [PULL 27/35] target/ppc: Build rtas error log upon an MCE, David Gibson, 2020/02/03
- [PULL 30/35] ppc: spapr: Activate the FWNMI functionality, David Gibson, 2020/02/03
- [PULL 29/35] migration: Include migration support for machine check handling, David Gibson, 2020/02/03
- [PULL 35/35] tests: Silence various warnings with pseries, David Gibson, 2020/02/03
- [PULL 20/35] ppc/pnv: Add models for POWER8 PHB3 PCIe Host bridge, David Gibson, 2020/02/03
- [PULL 33/35] target/ppc: Remove redundant mask in DCBZ, David Gibson, 2020/02/03
- [PULL 26/35] target/ppc: Handle NMI guest exit, David Gibson, 2020/02/03
- [PULL 31/35] target/ppc: Use probe_access for LSW, STSW, David Gibson, 2020/02/03
- [PULL 19/35] ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge, David Gibson, 2020/02/03