Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp619698rdg; Tue, 10 Oct 2023 23:51:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0scdahoLkaOPlstV9r4FRBRnaFs7S4r9UlHt8rHvbS42UYmyiwdfWZlIFkiI7TWdMZvWS X-Received: by 2002:a17:902:ab12:b0:1c3:868f:5958 with SMTP id ik18-20020a170902ab1200b001c3868f5958mr19938028plb.20.1697007100879; Tue, 10 Oct 2023 23:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697007100; cv=none; d=google.com; s=arc-20160816; b=nGn3JBmwtWbT0GKc3VoXcIfKxodpp3F7iya7DGVdbTQI61Oq5+ps1+Un96ec34zGC0 hNtqtZzGLuI337xxme5S+8/1jENGvY1HzBOcwky3KcdAXt5HqN1FcF3DaKxb5KBR6w/R FjUWBVv+mfnklRj4Iw6cK2oYzb05S6lMWkVXJxcn5i2dbqlkCyfMgo707P9g9m+TKDt/ N66husI5N6xfOyHfmbyJn7G0eu2gjOMDWEYy4wx31HDs33xEXME5NxIQQLemlLhxmUk2 YqDuzOJ2skIqgKB0NbofFYV6mXPnmN8FTy/wq3nM6i+WDKhnqza1jMgZ5rfvqsuXsjIA ueoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=fSdUFdNj96ap5yOzCUQatTJqtRpLC8WshQaaBaUNCbs=; fh=CsY5mSKjxiSEiLQf1ryavu3WWQSE0lidr+7sQO7YFRM=; b=tASx43B/yGriwuJgE+tvCHnOaD+4dRP1IMViJ8PEhT9sbEchYohyb8Np7iVbuCUNDZ 2BbXnYmgDpqKpMXJaqXO4iZDOtzlMB+3bCOlrWYgwzWmaNe4+Xj+FdVu19+183j+9cqz p/lSTNPWL/U+bHGzygmUcUDaHiru0EfehH1I10ljWcRZvwA60qy1yUKKV51DCWQ5qaxa hk7ivQuOkUwN9aZMm4lZRzH5MxW6c0hO9wD0IEF5ym/9M68oH4MeVF5GXKDDKbwnNrbV yr9bzVTn2lUtj7GR0WsP+U2gwjK4O4MTnojgPstv+0Cz4ljhUfEsrX0z8d1cbn2H5jA6 iTmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=oT+THZDf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id w8-20020a63f508000000b00577f65baa3esi13671010pgh.775.2023.10.10.23.51.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 23:51:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=oT+THZDf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E10AD8083B1F; Tue, 10 Oct 2023 23:50:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345533AbjJKGuk (ORCPT + 99 others); Wed, 11 Oct 2023 02:50:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345289AbjJKGuj (ORCPT ); Wed, 11 Oct 2023 02:50:39 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B49D90 for ; Tue, 10 Oct 2023 23:50:38 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-537f07dfe8eso5879a12.1 for ; Tue, 10 Oct 2023 23:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697007037; x=1697611837; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fSdUFdNj96ap5yOzCUQatTJqtRpLC8WshQaaBaUNCbs=; b=oT+THZDf+QDadK0nvojwt9eOmAKznH8i7VGKGiu9W+fhYiI1zeWXZkMlWhrVTfnCaR 3FNm2wLQj3j2BK/18R5KXq8zaX40b/lC/cZNy+Msa7I0zaubRQfuUZvWHxxgvJhT0Sz+ ZKY5eoNJDKzRClYYxCq3oGW0KklCha1lsp2w9Vomzxhmrg1FL7tj9f/swLTDB7YNRGCw ViOBPdfBlHRtITaTgoVx+mnQu8M3EyDYbQp8RdXDjRuiK5lmXefO/xz6hjpn93qSfftU Xs4K89QQE9yEIwIpDdqUMsBKEtrAWl9U9exCIE9yIPGd9eUtGh8qYA0rLj+QDljPK1O4 6M1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697007037; x=1697611837; 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=fSdUFdNj96ap5yOzCUQatTJqtRpLC8WshQaaBaUNCbs=; b=XD6fs57K1w0YDhtDOrea2git4D66k+NDpHUGeoR0Rb4aotEV4SfICY5Trb6NPxuBPV t9mV6d/hn4/g5sYUyytjcHoeKWnTWMYQS2F1VGjoG0zvxMIR9pdeofO2QTvkB1lYfcI1 mKdWNzCgPr74IEHuZmBc4C6KILCVGW8vv3n98Wqiagb+iCyWE7/aevks4WAfPuYqNvil wrWh6ZBO7SEn2/0rPQXZ0B8P7usDcdQ2lvZlDRjZelA8CyhkEwKddE8diS9JXlK2dA77 kOxWBu/bIYa/7udcWTFXIH7NYq5++rrsf38LZi2unic5qnx99JLN2CgBP0MC2KsgiXFz fqRA== X-Gm-Message-State: AOJu0YzN9EAXVKK65bUvmuaBtylcXbtLculVjUNm9Y3MhqGvLIRo9rXI BZtdjpHSKpLHpGWhgbMW7EaLpYi1UlKu6oSkfRQVrQ== X-Received: by 2002:a50:9356:0:b0:538:1d3b:172f with SMTP id n22-20020a509356000000b005381d3b172fmr57065eda.3.1697007036622; Tue, 10 Oct 2023 23:50:36 -0700 (PDT) MIME-Version: 1.0 References: <20231002221909.2958708-1-irogers@google.com> <93afcf44-5f8b-49c1-abc5-5304cba5f991@intel.com> In-Reply-To: From: Ian Rogers Date: Tue, 10 Oct 2023 23:50:25 -0700 Message-ID: Subject: Re: [PATCH v1] perf intel-pt: pkt-decoder: Fix alignment issues To: Namhyung Kim 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=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 10 Oct 2023 23:50:49 -0700 (PDT) On Tue, Oct 10, 2023 at 10:56=E2=80=AFPM Namhyung Kim = wrote: > > On Mon, Oct 9, 2023 at 8:31=E2=80=AFAM Ian Rogers wr= ote: > > > > 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 dereference= d > > > > > >> causing misaligned pointer warnings from undefined behavior sa= nitizer. > > > > > >> 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. Adri= an, 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 th= e > > > 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? With the unaligned.h patch on its own, I think patch 1 of 5 needs dropping. For the rest I'm happy to acked-by. Thanks, Ian > Thanks, > Namhyung