Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1696375rdb; Sun, 8 Oct 2023 22:29:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGlCm5ztJCG401LP/DRhe2lEPEvocuq34ITCasnrYeaZxKabyxrGcKaEqTi7pddGe4f5trG X-Received: by 2002:a05:6808:1310:b0:3a9:e8e2:5799 with SMTP id y16-20020a056808131000b003a9e8e25799mr19009483oiv.14.1696829366838; Sun, 08 Oct 2023 22:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696829366; cv=none; d=google.com; s=arc-20160816; b=af7BjR++nVKkCdPq66TYcC8KdYgfqGDjtJSZT2c3S3kfKNpuCcOgo+jMKUj3vljyM5 vuS/Re4RVgzrF/yizUhXmFK38X8aNyNaiMltJXKMVOVsYvqOxVVyZMgbGgHNr2Axc6p3 dbNXka/5fikjAOZIvgIIWGdN84XLGS8BbkJn/DRXc7GLOI3Uj2p9TVx0zcwKdD6PBscy 43sOEOKd1OxY2iEhni2VT75NBkclzmhnciO/to3/A514I3KfL7Z2RswACiBhFaTTcDiL mDeYkF2EDG64cgY2HJTh+6SAIZVDEbaCj6qMUF1MjNDHnVdydiPVr76iDvS3D7juJF8u nKnw== 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=FvBuPfgsmv8KK8XM5dOXON4whGz0Ww6/E1o4KcHY79E=; fh=7YzaLIWJ082zMt1MakRLURIZqx0q9emTVIdpaOJx0l0=; b=JR+GluLnzdUspXqrIK5lRrPPG75E7RZNQjevzCCI5dQuf1kd5+gJ0G7agHkUptXCoX 9WuodSKBOa8Sq0+I1TC0mGIbU4SMQAmtDKC32AOng95d24LsqnVwhDnJQQHPhoIByIsD l9JR02BmTMVncR1DB3avdpUA/D8dR2+Lolvl/yvSor+r9BH5k8/lPv9cCXcWTmjgb3Dk FM//dIcPrDW8Kv9vE9zcCo5OHwQMNJ80BQv8gzeQLQrNfQW4aFLDELys42hfpYO6Kc0u MqBTYcm2pWEiEq1g99cxUGX2O7GWPdOeoDRx6iKvCcaU6LKSlr0N6xx05ZuQXZBZiLFS bSPA== 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 t2-20020a632242000000b00578dfa28bedsi8733338pgm.238.2023.10.08.22.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 22:29:26 -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 72FDD802CE68; Sun, 8 Oct 2023 22:29:24 -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 S1345109AbjJIF3R convert rfc822-to-8bit (ORCPT + 99 others); Mon, 9 Oct 2023 01:29:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345049AbjJIF3Q (ORCPT ); Mon, 9 Oct 2023 01:29:16 -0400 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DC909E; Sun, 8 Oct 2023 22:29:15 -0700 (PDT) Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-27740ce6c76so2364672a91.0; Sun, 08 Oct 2023 22:29:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696829354; x=1697434154; 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=Vr/F+bCfSklSZ5y08IwzckZb9rJ4zF5BksIsHEdUNU0=; b=Kyv0YlLheoIHRnDjd2PNm7dCqBaPzaOui7gze85f9jri92YobwdneYrJbupminq12k xSjDTed65cNUxshugxdntBdInoz4fRg2c6UvYoYmAXIUh+j/nTtW4AGoWYTsECBoLE1I aECH7RCoK0uewvAdgmQBt2GsaJaCyR6IMKlBnL3PQAnH6SnkoOFTPcMwR6YbKdyGTfOZ X+yyN3bH7o3Gqqi3z98aVYEYiv+BQWVTeKqqwgKYdaDaoHe4P4otUuF0G2DhHaAjK2ud tsV4CHzs4hvlduozbwUaiKJDJLiqMljh/N2V1WZMKpeR0LDz42c1RIIQvExWuz4HoenG JzXQ== X-Gm-Message-State: AOJu0YxZfFJWS7M42jH4wMsP5v21GpBScDMDa0WoFLFkgEWgjPlZW7ZQ FJT0BV6G6R6Ui1exGlXogYiOg1vrpPSz4n1Aelw= X-Received: by 2002:a17:90b:4c87:b0:26d:416a:d9d0 with SMTP id my7-20020a17090b4c8700b0026d416ad9d0mr11350450pjb.21.1696829354575; Sun, 08 Oct 2023 22:29:14 -0700 (PDT) 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: Sun, 8 Oct 2023 22:29:03 -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: 8BIT X-Spam-Status: No, score=2.6 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,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 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]); Sun, 08 Oct 2023 22:29:24 -0700 (PDT) X-Spam-Level: ** 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? Thanks, Namhyung