Re: [PATCH 1/3] perf cs-etm: Initialize the Thumb instruction buffer
From: Namhyung Kim
Date: Wed Nov 25 2026 - 14:14:42 EST
On Fri, Nov 13, 2026 at 08:30:59AM -0800, Ian Rogers wrote:
> On Fri, Nov 13, 2026 at 2:55 AM Leo Yan <leo.yan@xxxxxxx> wrote:
> >
> > cs_etm__frontend_mem_access() can return zero or a short read without
> > fully initializing instrBytes. cs_etm__t32_instr_size() nevertheless
> > inspects its second byte. With CORESIGHT=1 and -O3, GCC 15.2.0 reports:
> >
> > error: 'instrBytes' may be used uninitialized
> >
> > Zero-initialize the buffer to avoid reading uninitialized stack data
> > when instruction memory is unavailable and fix the build failure.
> >
> > Reported-by: Ian Rogers <irogers@xxxxxxxxxx>
> > Closes: https://lore.kernel.org/linux-perf-users/20261030-perf_cs_etm_fix_non_taken-v3-0-7629b52ab047@xxxxxxx/T/#m64fb81c665214b79883d9be815b40ac5f6669628
> > Fixes: a7ee4d625ede ("perf cs-etm: Support for ARM A32/T32 instruction sets in CoreSight trace")
> > Signed-off-by: Leo Yan <leo.yan@xxxxxxx>
>
> Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>
Applied this one to perf-tools-next, thanks!
Best regards
Namhyung