[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] system/physmem: Where we assume we have a RAM MR, assert it
From: |
Peter Maydell |
Subject: |
Re: [PATCH] system/physmem: Where we assume we have a RAM MR, assert it |
Date: |
Mon, 29 Jul 2024 17:04:03 +0100 |
On Tue, 23 Jul 2024 at 18:05, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> In the functions invalidate_and_set_dirty() and
> cpu_physical_memory_snapshot_and_clear_dirty(), we assume that we
> are dealing with RAM memory regions. In this case we know that
> memory_region_get_ram_addr() will succeed. Assert this before we
> use the returned ram_addr_t in arithmetic.
>
> This makes Coverity happier about these functions: it otherwise
> complains that we might have an arithmetic overflow that stems
> from the possible -1 return from memory_region_get_ram_addr().
>
> Resolves: Coverity CID 1547629, 1547715
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> --
I'm doing a target-arm pullreq so I'll take this patch
through that, unless you'd prefer otherwise.
thanks
-- PMM