Re: [PATCH v1] perf intel-pt: pkt-decoder: Fix alignment issues

From: Namhyung Kim
Date: Mon Oct 09 2023 - 01:29:19 EST


On Thu, Oct 5, 2023 at 2:24 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>
> On Thu, Oct 5, 2023 at 12:06 PM Adrian Hunter <adrian.hunter@xxxxxxxxx> wrote:
> >
> > On 5/10/23 18:48, Ian Rogers wrote:
> > > On Mon, Oct 2, 2023 at 3:19 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
> > >>
> > >> The byte aligned buffer is cast to large types and dereferenced
> > >> causing misaligned pointer warnings from undefined behavior sanitizer.
> > >> Fix the alignment issues with memcpy which may require the
> > >> introduction of temporaries.
> > >>
> > >> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
> > >> ---
> > >
> > > This is a relatively small change that fixes building with
> > > -fsanitize=alignment -fsanitize-undefined-trap-on-error. Adrian, as
> > > this is Intel-PT could you take a look?
> >
> > Thanks! This has been down my list of things to do for ages,
> > but using get_unaligned_le16() etc seems nicer. I sent a patch
> > set for that.
>
> Thanks Adrian! Your patch set looks good and I think after Arnaldo's
> comment is addressed we should go with it.

I think it can be done as a later step as long as the interface is the
same. Can I add your Ack's to the Adrian's patchset?

Thanks,
Namhyung