Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1971146rdb; Mon, 9 Oct 2023 08:32:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4WeSmPmgft5JnArvy0GqJjXU0poN3CxPdykmsuAe/xZQk6hHn9g+2XIQKpV81m8qoG892 X-Received: by 2002:a05:6a20:4411:b0:15e:1486:1e08 with SMTP id ce17-20020a056a20441100b0015e14861e08mr22164496pzb.19.1696865522903; Mon, 09 Oct 2023 08:32:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696865522; cv=none; d=google.com; s=arc-20160816; b=FjQoHasfN6ERaFXpl9vztLgSG6ECcgwFsSjk3P4N17hWHUt5oYYwzOLeabmjsa+/Ma KNcir5nuViPTIXniTNqK47blqb54rLVBP4WBPiOSjJkmUQYES/wz1ApKFup8zldM3vwE EaF7gAC25xcRAElILVWIPMdyrgFBnH0HNwcdNllbgKuvV69PGGoPVHdHnwONNmT1ALVo Hkwj4LkBJHxKGdFueLhIlHF/TArVRCgc+wxyUDknhexIz/dJfKstbEMKQk8lHT4tvd/o L/j25nqV+WyjJWOsVJI/sSL6a5HB8XdPXfyg5famB3jg3vhsy0HvkSHSIs7I1hs0SBFx qfhA== 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=C9lR87UXDmLmGW5fgYOoK9D3OVG+W1Apjk0vJRi7zLM=; fh=CsY5mSKjxiSEiLQf1ryavu3WWQSE0lidr+7sQO7YFRM=; b=ZVIouzZ6+uW0M90jyjXNa4uYxfIG2w3u7Q91c2DoOgkgGoJBEivhexOO9T+VPaXWsJ FcYKEEwE+SXEq12GZQEXsDtw2XkafcPWXOHsrLjRSaSu0Wt2KlDGftF4O1tJq30xyUtl lblDPSGMiBRg6KQsD2xSx9vRJ76wSoijr4RphK5JS49qCQo9ZwmZSO7NlDuuPG1R74L5 4B48CZaMAnLFbQxl3RzHAozEFV4JW7p6sJTd6nVv/RqM4rnby+Aja+x0E371V1Zb6Vb/ x1DUEaJdqGrM67OqaNPFLDZ2SrSG/1YzRef91IsU6Ct/gZnx8g9MXRMWHABRRSYTSyuf rloA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=1tWV7OGc; 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 o10-20020a056a001bca00b0068fca4405aasi7289488pfw.338.2023.10.09.08.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 08:32:02 -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=1tWV7OGc; 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 6B6C680C4787; Mon, 9 Oct 2023 08:32:00 -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 S1376553AbjJIPbu (ORCPT + 99 others); Mon, 9 Oct 2023 11:31:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376424AbjJIPbt (ORCPT ); Mon, 9 Oct 2023 11:31:49 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DD42AF for ; Mon, 9 Oct 2023 08:31:47 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5068b69f4aeso7526e87.0 for ; Mon, 09 Oct 2023 08:31:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696865505; x=1697470305; 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=C9lR87UXDmLmGW5fgYOoK9D3OVG+W1Apjk0vJRi7zLM=; b=1tWV7OGcc9ERBFbl2dNcxy8q1A0XpAwBL0l/MU9Blu9Vm6az6ft1qpkdtJAiwe4qYK YUZYHGV9S2coLdV5tIbCkPvg5ewylf7VYmM8GgU/4bcMJMbcUu8zT15akCx1XFZI/NT2 ssWU40vzAGlif9Q+Eoq5iA581psoE/EzP7NFixsuZzNm1hfYzolD390CvsraTxxA7uyo h21YpmJUBie4B7uSJ0TIQjoDU3rf4RuzM7xodYvnrJlMUtesDgyPnbWLFMjgUWq7Sgzh gz9eINt4BOHJr3hS0bTDOGtDslDgV6GXsCeIXAegQQdHxRS/E/g6NE9tay8z7Qg5vw+5 DZiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696865505; x=1697470305; 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=C9lR87UXDmLmGW5fgYOoK9D3OVG+W1Apjk0vJRi7zLM=; b=ScnL5KvivSpPYoMiN7os4pO3V0FbWCLRateqcea7cmqiIhRC92dLuJHs6olFcOt/n4 M5QUw8do+Yg7VkcFEZcuvQ0NMRcBlBV2HeFYHtyjzpC082Q27/Yy9tk9J1GZdxeyHpTd P5/tV1AGTEhmjLSunCU5lmGsKTrpVZ3XDxEBWH3QQ3yYX9rTiwdIkPKkkv1nQMraj0IR qPwSQ7fP6MO7SYD1hlPNiQv9FyMQuUfHRZ/5pX5sRSotoOxCSZD+pRo9NILSeZtvIa1f im69glA3fOXsUbZ6lpzbeqeEPJ4C8UOsM04MQw2DPBGL4dN12D48LSNt1Y1jC3/NaNCK OIMg== X-Gm-Message-State: AOJu0YxuApgEC+/czxnLfEnfIK64lRBjkanefOvFeY/Iwq3OgwjoFyMd XxqpigZTjoOpGBXVMLYsTxNhDPcXmK1UXXxb5T+iDg== X-Received: by 2002:a05:6512:4801:b0:502:a55e:fec0 with SMTP id eo1-20020a056512480100b00502a55efec0mr231745lfb.6.1696865505263; Mon, 09 Oct 2023 08:31:45 -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: Mon, 9 Oct 2023 08:31:33 -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]); Mon, 09 Oct 2023 08:32:00 -0700 (PDT) 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 wr= ote: > > > > 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 saniti= zer. > > > >> 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. Thanks, Ian > Thanks, > Namhyung