Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp600807rdg; Tue, 10 Oct 2023 22:57:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IExxMxQejKmxn1EVlLGLQdydkRvQDTb0AljK4mjf2qA82UwiYXqZCPCaHoBPj9OlH1OR+0/ X-Received: by 2002:a17:90b:3ecc:b0:276:6be8:8bfe with SMTP id rm12-20020a17090b3ecc00b002766be88bfemr27042938pjb.23.1697003865516; Tue, 10 Oct 2023 22:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697003865; cv=none; d=google.com; s=arc-20160816; b=IF9XLTeFijYNqNXK+O0b7fS6FXCmYhN1GiM6WhmfSYrhONPMyV/xM9q99aAyIuGQ1f YUlQhIDvPc6K1tjMrUxAiTrr4XZMP8xQv5NbBmZJEvw6zDlY5eMTLerWo82UonnEBlg/ HMZvED0gEPxhJiCkixKKxmaBrOc9FPWH4YK2L4XcWHnvq9CEUVNsBgZGnCNmufKKzgcY +peO1lJeHRohM2gf5sVayN2FLyjr3dvgh7sg4snWTrPo/swMHchFDznnL65gXD23iIfd cT43eSEsyqDiXZPY5pQd2Cjkm415Jt9wyAcmJZDh0YAe4CulDyhT61kuO43+z6zfnNeB c7IQ== 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=Nn+IS+FpoRw095/u394Ncl7LOQA6s802ZilBz0OSqWk=; fh=7YzaLIWJ082zMt1MakRLURIZqx0q9emTVIdpaOJx0l0=; b=OehPBQSKly/YQWKpxD0mYzTRFdOwFL/QQLovMhkrwJAZJYdZaIipGJHgoG8B+NCaZJ VGoGRGpc2IGNEP9KC//JWXUevMrqoCoz5zGh8LxuQj3PbwPGkQdygLqh74dFFER3hIRy 6JDeBhJXEXjYaR3AW1fJTP7PgSsjwfdxnq+nh6HMw6MRdn7o6OUIwbDD5Bpw9qcscwQq 1RvYDHRidbVA3pwT7y6RfOcmtHVUs4PvvifvJ7j5jDlEQ9NCTUNoeVr68fow8Ay5sBbD bQuEeqg7s0LGMEZtuMXL04Yy+iqvTh26QTcUVtdqd0e9H1l3rEJUtmi21PtCpMxcwNCB 7yvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id q18-20020a17090aa01200b00274a5edad0csi13418839pjp.139.2023.10.10.22.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 22:57:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id A85FD807C75F; Tue, 10 Oct 2023 22:56:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344210AbjJKF4Q convert rfc822-to-8bit (ORCPT + 99 others); Wed, 11 Oct 2023 01:56:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344216AbjJKF4P (ORCPT ); Wed, 11 Oct 2023 01:56:15 -0400 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C25C19D; Tue, 10 Oct 2023 22:56:13 -0700 (PDT) Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-58e119bb28eso487263a12.1; Tue, 10 Oct 2023 22:56:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697003773; x=1697608573; 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=S9baY0raJWT0UxO3DXGBjth97e+wvq2TLwcz5cGk19I=; b=UPwf7yQGKT89ATne28cV4g2h0fepAhtI7Wy1h6Cq5CwJVCm03i6CtCLBbqX5DucvsF EZYZzCtyuHi8iwTnlOV85AsoTmm3eUqKiNuyhMOU/Ee93pWcaiZaPimbqTYf3PC/iPjl WWbwgaaPOk4ZEw3KwiH1ZHYiolwL38SM5X6K3hvPY28dltkIzwnzKs6GH2wi8HaN5OqH 8Re93PvtfDj1t+u/yHTN8oYqlThn3IPrS6YOiImrGlgc8Z1GTn6QOnRyA3rAeINhOvqn Eg+q2rccC75Lg6YpuGhkXWqgsF5bU3vxvd9zgvCRUt5OS0I/+1hqJ42ZGzqPTp0aMu9x /zTg== X-Gm-Message-State: AOJu0Yw8KkLIX146h1o3xyOOeXeDHbzC6F2NUnMx6EKdiT8vmo6KmTBe kk8WzY1rPZ1xlV0QkxHMAMJfAprX+8/rVP6Bi/A= X-Received: by 2002:a17:90a:4892:b0:27c:ecec:8854 with SMTP id b18-20020a17090a489200b0027cecec8854mr5722823pjh.7.1697003772775; Tue, 10 Oct 2023 22:56:12 -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: Tue, 10 Oct 2023 22:56:01 -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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 22:56:28 -0700 (PDT) X-Spam-Level: ** 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? Thanks, Namhyung