Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp724241rdg; Thu, 12 Oct 2023 21:24:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFfEHP45yHnxxXziOzIG0bfY0Y7yTmrWL8Sn6xMx8i9j4Tq6h+jnDZ8eEvCG1HEUpb6thY X-Received: by 2002:a17:903:2307:b0:1c6:21b4:30bb with SMTP id d7-20020a170903230700b001c621b430bbmr29524943plh.15.1697171087094; Thu, 12 Oct 2023 21:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697171087; cv=none; d=google.com; s=arc-20160816; b=e8apULDfw9P92B+6WLVo5oG/sHfl/sniZJr8LWzHNyfZnEBw0EdRyzhbr7yQIWl1f3 xSBG0/dMZpPrFN4fR3dRRNhtCgy65b0zo1ye31tYlhDsPDSEXhGu7CySS/UEGiL1sHdR 8mV7U0Lr8gUaN6tC+8DxpqrSBnRQ6CR2b+fBiGCeQNvQHxTbbCcFMLPzE4UGf2sztzxA GiG/KoAemChg7NRUP+Hi2y4GzWjuCSo0fKTGvm2AEzlPxTzLQZoPX2mJYQbRltZCIVRo DYCQgBjGftlW5U/gt5hosWI+OWF/Va2Lws/7Upz6LHsmEpCk+7AmzvU6qdu1WsLeBRRf uQFQ== 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; bh=Xo4fOcY1MwVpUS/PcOL9B7TBduoxoKrKSTQjpOyy9uM=; fh=+izpE3dZ9cx46zve/cUSNZa+a6VjlVlMSCjmB4Uxzog=; b=vEzAUFbU6DELawMyVXQoisKF26X5WBmvC3xrOfMRWCsaoKebaYjQuJMBsO+FWyl7RL RWHXQ3AL1kHt8UOjGTBDo5KDdfiCJU0r2LtzG66rYdIgUZMqqqm/Wg48PHk9SIvUca4Z BNGklnpsppCOmtiR4SnMxZKN3/TxpvHAwcMkCZbDUxWiySRyNf4S6oF6LjcFf3XpCsEI Sxyls92kUuJa6q7h5VK12CBIihtXt+NCMuruUnS8VY2RCiGbDW2jgbQLZIpPYIpRIyuq QQujbJOP6D8TbVHPDyqYory3ePEZ6Em7sLS7Fgi1FJinl//N+WoQTnpl9GHIfZDji/36 9z7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id x8-20020a170902ec8800b001c74ae78c7bsi571492plg.377.2023.10.12.21.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 21:24:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 42436809F3A9; Thu, 12 Oct 2023 21:24:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229552AbjJMEYc convert rfc822-to-8bit (ORCPT + 99 others); Fri, 13 Oct 2023 00:24:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbjJMEYX (ORCPT ); Fri, 13 Oct 2023 00:24:23 -0400 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5539133; Thu, 12 Oct 2023 21:24:09 -0700 (PDT) Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-27d0e3d823fso1123037a91.1; Thu, 12 Oct 2023 21:24:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697171049; x=1697775849; 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=OPtXecqRleGGMmT5CUZqBotuwI7hZYRU/fdzYpvoY/g=; b=DDp5ep7b+Bep9TBIv1+r2+2J+vw/wKRdz8zpgxkCdLGy4RM5YkADLyWc9Xzv5BIdKe kAAYnpZjET0/IffDECmpidppJFb6oeUZ+HVqapfdH3Web8B5xXg/X+MYlpuELBLvrEfr GH+2vxLxJW9XCByyIa8rcAJaa48frQVumekaXodSw5mf9aVHw2LEGFYVMAe0i8vAM08w E2cYhz7c/zhgb+Rkt531SnEx+KS3qG/YzNgOfjEASLtY0gI9Zkn9fbKyvKkWdnDk+nWt 2ocRRe1KWA2ZaOj4UupdHg0xbmEFiGAqUdbEy4uru0G1CIVl0+byWJg+KMZaxvuHdA6W HTEw== X-Gm-Message-State: AOJu0YyWvKJGHehkMvpEpo9v95UFcoL6ptbhcLo6o6kVZCroaejYG6ed E40X99wJsIyOp9ErAi1VTSHEJH9FhTmBOMhv6D35SBjS X-Received: by 2002:a17:90a:1dd:b0:27d:10b1:5deb with SMTP id 29-20020a17090a01dd00b0027d10b15debmr5448912pjd.31.1697171049056; Thu, 12 Oct 2023 21:24:09 -0700 (PDT) MIME-Version: 1.0 References: <20231002221909.2958708-1-irogers@google.com> <93afcf44-5f8b-49c1-abc5-5304cba5f991@intel.com> <6452eca3-e8de-40b5-8e04-2e37892880f7@intel.com> In-Reply-To: <6452eca3-e8de-40b5-8e04-2e37892880f7@intel.com> From: Namhyung Kim Date: Thu, 12 Oct 2023 21:23:57 -0700 Message-ID: Subject: Re: [PATCH v1] perf intel-pt: pkt-decoder: Fix alignment issues To: Adrian Hunter Cc: Ian Rogers , 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: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Thu, 12 Oct 2023 21:24:44 -0700 (PDT) On Thu, Oct 12, 2023 at 5:27 AM Adrian Hunter wrote: > > On 11/10/23 09:50, Ian Rogers wrote: > > On Tue, Oct 10, 2023 at 10:56 PM Namhyung Kim wrote: > >> > >> On Mon, Oct 9, 2023 at 8:31 AM Ian Rogers wrote: > >>> > >>> On Sun, Oct 8, 2023 at 10:29 PM Namhyung Kim wrote: > >>>> > >>>> On Thu, Oct 5, 2023 at 2:24 PM Ian Rogers wrote: > >>>>> > >>>>> On Thu, Oct 5, 2023 at 12:06 PM Adrian Hunter wrote: > >>>>>> > >>>>>> On 5/10/23 18:48, Ian Rogers wrote: > >>>>>>> On Mon, Oct 2, 2023 at 3:19 PM Ian Rogers 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 > >>>>>>>> --- > >>>>>>> > >>>>>>> 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? > >>> > >>> 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. > > The new patch is on top of the others, so patch 1 is still needed. I think I can squash it to the patch 1 if needed. Thanks, Namhyung