Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp271216rdg; Thu, 12 Oct 2023 05:28:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUtenhKTevqtDjf1taF16mMBZ/2ChTCPD5z6pOnCQINoKhkfehv5rTFajlNMHJ2hQ6agpX X-Received: by 2002:a05:6a20:3ca9:b0:15d:b243:6131 with SMTP id b41-20020a056a203ca900b0015db2436131mr28219004pzj.44.1697113688685; Thu, 12 Oct 2023 05:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697113688; cv=none; d=google.com; s=arc-20160816; b=dbj1v+tDeowl6bHt74dpyk/MI5qs7oYUASX2wVFh/W4mFmSE6bLdusIp/vLXfOD7ly Rnm9hsRczf62NfoiphGAzbmysSkp3kcHhFBQvGDJ3VJrVtTwKlBtqe8h4xIfsVATW/iR jDXDYVslqfaYyRQw2/1ESl9AlWKRckp4YyZrKZ8NJJsLt54lIUyRnBvzcyTu5qE4RCwP 4Y0roi1z6RXIDW7Usx6LwrqD9yh2oHLVQuyu5gCaeZKamH9OCV61j3/K260pmTHbEB+R Of1F8YCqftnYH8X8ZkVBXh7vBEY63Q5Nt4bfRqp+oBCU/0c24FDmxQ4RtSrz1Jf22J3m mzwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=4kAfZI8h5E6i6pMoHaLq2LNKS+ds4TTnuP8nyW3o3Vk=; fh=dKuKvJjmUN38qjeXP2UpYZ51LKph4lcwXgdbVgcbRrE=; b=CsnMkvxEZst8DFApxo3ioAX7WtAY0IswbbaIVwTXsWt1uekd3IPgiOdYbF0GigoTHD vyXiPafhZtXbqstRHRrFyUSjW5tcqgJTv/BJyX4NRACMwzp2gQofRjUb9/7kM5QKfKwN HQJ5ZjbNhVYrSQ/2JBvZNDXFaHkZc9iQOKA/kfDTyRmRo/R0iRzcjuUzhpiWrb3f14I6 Zx5c2b0B6ed7MfvmRYTOvlrl35dMxYTwpazhBwU7dh0vTRU8CDLRGQpB205Rqi+2qKew Sd9QtZtJySX6VqTZ5fi8Fg7PNeXTECEOJDg29o2hl16ByKMW2i0iF7AZlVd4GsdA1DJP Wd/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AkeSvH2c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id o12-20020a170902d4cc00b001c9b5d2c3fasi2263167plg.523.2023.10.12.05.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 05:28:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AkeSvH2c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 0D134812A631; Thu, 12 Oct 2023 05:28:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378609AbjJLM14 (ORCPT + 99 others); Thu, 12 Oct 2023 08:27:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347226AbjJLM1y (ORCPT ); Thu, 12 Oct 2023 08:27:54 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91E5DBE; Thu, 12 Oct 2023 05:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697113671; x=1728649671; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=AZ7oKYWOBQVcSulh2u8ttvivltav8khjEB1RfHASx+M=; b=AkeSvH2cGnmCqzKrHVQX+SbThceaxvzIa4dh/fSWzA0g1OoOFXpc2MVa NWz1ULRcPgNzXGiSGrHmTKf9a/v+C29b8izmfG8nHldYXjzxVGAkbj5Q8 abg0uT3Bw10mSezkpnGvftNbaVfiEA9uT+5v7S2/LwJe5NGVVD9l65ErO SdsE+lJ06tqc+qXiOpUlCmgFVlDnDkU+NAb8ptBMvvBXMwVUw9ps5ItbD lJRjG6rDf6i/NKOOE9ETpja6id01qTiR81iFR26gP272xIHzJSpPPlWE0 TDm8VHT8JugxymlQFOInlMMERdY6rJK9qoVVkTzsPFpM3ifLZyU4fda86 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="471165615" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="471165615" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 05:27:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10861"; a="789377300" X-IronPort-AV: E=Sophos;i="6.03,218,1694761200"; d="scan'208";a="789377300" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.41.84]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2023 05:27:47 -0700 Message-ID: <6452eca3-e8de-40b5-8e04-2e37892880f7@intel.com> Date: Thu, 12 Oct 2023 15:27:43 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] perf intel-pt: pkt-decoder: Fix alignment issues Content-Language: en-US To: Ian Rogers , Namhyung Kim Cc: 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 References: <20231002221909.2958708-1-irogers@google.com> <93afcf44-5f8b-49c1-abc5-5304cba5f991@intel.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 12 Oct 2023 05:28:06 -0700 (PDT) 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.