From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A8A5C8D2 for ; Wed, 11 Oct 2023 05:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C25C19D; Tue, 10 Oct 2023 22:56:13 -0700 (PDT) Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-58e119bb28eso487263a12.1; Tue, 10 Oct 2023 22:56:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697003773; x=1697608573; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S9baY0raJWT0UxO3DXGBjth97e+wvq2TLwcz5cGk19I=; b=UPwf7yQGKT89ATne28cV4g2h0fepAhtI7Wy1h6Cq5CwJVCm03i6CtCLBbqX5DucvsF EZYZzCtyuHi8iwTnlOV85AsoTmm3eUqKiNuyhMOU/Ee93pWcaiZaPimbqTYf3PC/iPjl WWbwgaaPOk4ZEw3KwiH1ZHYiolwL38SM5X6K3hvPY28dltkIzwnzKs6GH2wi8HaN5OqH 8Re93PvtfDj1t+u/yHTN8oYqlThn3IPrS6YOiImrGlgc8Z1GTn6QOnRyA3rAeINhOvqn Eg+q2rccC75Lg6YpuGhkXWqgsF5bU3vxvd9zgvCRUt5OS0I/+1hqJ42ZGzqPTp0aMu9x /zTg== X-Gm-Message-State: AOJu0Yw8KkLIX146h1o3xyOOeXeDHbzC6F2NUnMx6EKdiT8vmo6KmTBe kk8WzY1rPZ1xlV0QkxHMAMJfAprX+8/rVP6Bi/A= X-Google-Smtp-Source: AGHT+IGucUyht1bByNKOC94VYeNc/FSTLZAd6PXQOBPgJeXOrs4i/XQzSfmEcCzVhRvUVUxj3XkdAavcAaancrUUYvs= X-Received: by 2002:a17:90a:4892:b0:27c:ecec:8854 with SMTP id b18-20020a17090a489200b0027cecec8854mr5722823pjh.7.1697003772775; Tue, 10 Oct 2023 22:56:12 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231002221909.2958708-1-irogers@google.com> <93afcf44-5f8b-49c1-abc5-5304cba5f991@intel.com> In-Reply-To: From: Namhyung Kim Date: Tue, 10 Oct 2023 22:56:01 -0700 Message-ID: Subject: Re: [PATCH v1] perf intel-pt: pkt-decoder: Fix alignment issues To: Ian Rogers Cc: Adrian Hunter , Alexander Shishkin , Ingo Molnar , Arnaldo Carvalho de Melo , Peter Zijlstra , Jiri Olsa , Miguel Ojeda , Liam Howlett , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Mon, Oct 9, 2023 at 8:31=E2=80=AFAM Ian Rogers wrot= e: > > On Sun, Oct 8, 2023 at 10:29=E2=80=AFPM Namhyung Kim wrote: > > > > On Thu, Oct 5, 2023 at 2:24=E2=80=AFPM Ian Rogers = wrote: > > > > > > On Thu, Oct 5, 2023 at 12:06=E2=80=AFPM Adrian Hunter wrote: > > > > > > > > On 5/10/23 18:48, Ian Rogers wrote: > > > > > On Mon, Oct 2, 2023 at 3:19=E2=80=AFPM Ian Rogers wrote: > > > > >> > > > > >> The byte aligned buffer is cast to large types and dereferenced > > > > >> causing misaligned pointer warnings from undefined behavior sani= tizer. > > > > >> Fix the alignment issues with memcpy which may require the > > > > >> introduction of temporaries. > > > > >> > > > > >> Signed-off-by: Ian Rogers > > > > >> --- > > > > > > > > > > This is a relatively small change that fixes building with > > > > > -fsanitize=3Dalignment -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? > > I think addressing Arnaldo's comment: > https://lore.kernel.org/lkml/ZR8QnasisGEsaaDR@kernel.org/ > will need some changes to the patch series, and so I was waiting to > see the outcome of that. It seems it's done without further changes. Can I get your Ack's now? Thanks, Namhyung