Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2432576rdh; Sun, 29 Oct 2023 16:28:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQYGWS+yET5Bw/oHEYB/fqEraDKDq2J+JDcKGZXPrkDBccPgCKXroN6gOzYjmS/3ZTXGN2 X-Received: by 2002:a05:6808:4191:b0:3ad:fcd5:3dd6 with SMTP id dj17-20020a056808419100b003adfcd53dd6mr9753688oib.13.1698622093429; Sun, 29 Oct 2023 16:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698622093; cv=none; d=google.com; s=arc-20160816; b=bdtTQSlM2shM0zcD/skWumkkYe4ZLibvDHuLimXmGb5khzloShF0wFUN7TajTFA6lA /3J946OH0K/TRgboGYuoyRJ3dLUnhEy4d73q96sEUWvHrBv5IVPX6ypj97Tt5qy2uVtX I6NfX3X16IqlEu37p1tsnNKJC+Cw1ZGcCTfPqpJnFibzYbB21zV5teZjKZ67HFhChVIV q0zcvK4tPK7fIRIXMIv99kD3qTb+wZVD6BdHuP2tpALTkTEn/m/7ZS9qigAixE3Zcsfr 1N6cymiShaQsIzNSOS4ZinOlyRK9nagS1TZikJET796b0qOuJ18HKxzeyYBRqKKiKqbV 4Acg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=jAiuAMSOIMa8Cg5aa4qggKms7FgUgfk0/cVYa27X7G4=; fh=8LmOAwDJPil+k2W/G6B78z2JZ3jS3EZ7TPS5wIDtgTs=; b=ohw0KDjK8dGSFwILpum2+4O11yMWenPab6WBRtU5hlz2T3V1l8IqYQzqhmuuuoqa/Y OX3yl89GsfGaJBFNlwYDrOqR/gF6zsGjoS98DmgryMeKXvXU/TJhRRL6/hF5llWpcTCZ yEve9V6Mro1DSt97AfNX9oUbafHXjvfob9PMzVUIUuCs5lSVr5wlt+1zVAPiLQu3Cr0x v3nefRvMCTbNFtLEGSyEKwoJkG6shretTU24JIjMYFV2M45urQ7dAefNjXXK+kxB8A+A ZgHLz5Xwj8NmiGoUEskVeES3jxoaQYZHZiIsiN/Zxo3WTRwcr29HNRng88G1y8XbRaM5 7HZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm2 header.b=K0cNF8xx; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=cXfRGArM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id s24-20020a656918000000b00578d0d070f4si4095686pgq.844.2023.10.29.16.28.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 16:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm2 header.b=K0cNF8xx; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=cXfRGArM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 07D878063BEF; Sun, 29 Oct 2023 16:28:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232024AbjJ2X2F (ORCPT + 99 others); Sun, 29 Oct 2023 19:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231497AbjJ2X1y (ORCPT ); Sun, 29 Oct 2023 19:27:54 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AAB91B690; Sun, 29 Oct 2023 16:22:06 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 955CA5C00EF; Sun, 29 Oct 2023 19:22:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 29 Oct 2023 19:22:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1698621725; x=1698708125; bh=jAiuAMSOIMa8Cg5aa4qggKms7FgUgfk0/cV Ya27X7G4=; b=K0cNF8xxyKoL7GjLQgX5JcM8YDseoua1sFJjn2T0+BQbhNScNjb y+MvftAgcAqm3vaWRq+qDz6k+EjraAW+HUkHuKsZ7gUahWeSAD/0Hww1TT0VtEP2 VXLqrG3WW3Up/mz0fBlWmv5QM64T8mBOVKLGCW1TVbvc0AQxQivdE5v8vVvHPGZi /VdN4x8XQd19iMrj0ex25hOs38lvKdYMj6vq1H68c12Ds0ox70OepMCZkGZzveg6 FcRQuj8igpENN41hsM2V7IOQCgswtU7Tc25HOdYl37IpJfx4ur1fPi/SvLim9Mzr 3gkw+3HPdqCTWoJoNiFSvtnSqXPPjgLjNow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1698621725; x=1698708125; bh=jAiuAMSOIMa8Cg5aa4qggKms7FgUgfk0/cV Ya27X7G4=; b=cXfRGArMSrk+/hlXVi5EBhMBZZFct7Dw3Y/WfIxULB9O28Feshs cwI4kJYscJg/E9cZu0NKbp/CPq5bsTrbo/C2clsozebQI4F8VWBVjtunLvve0Rw8 O25zEOkAI2i4ZAhFwJs7IztIy/rNLxqMVPz2KSUEH7j6dz6a6PCnxp0oiW3pXAjF 3KkBZZS9CUcC9AtM3pKXJjVVslHOMCJlJ/mSxZJQ149pEG7ixQj/c2G803MOJqbj HAKQ42jHhBQ4EGdFL7nV3gHt0MQRgj3CkKWMFL/Uquyk8QyRJBN58RrdwLcL7lZA 5SSDAnC/XHvqIft/ZmRQUsxrA6NqhqcaLgA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrleelgddutdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggugfgjsehtkefstddt tdejnecuhfhrohhmpeffrghnihgvlhcuighuuceougiguhesugiguhhuuhdrgiihiieqne cuggftrfgrthhtvghrnheptdfgueeuueekieekgfeiueekffelteekkeekgeegffevtddv jeeuheeuueelfeetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepugiguhesugiguhhuuhdrgiihii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Oct 2023 19:22:04 -0400 (EDT) Date: Sun, 29 Oct 2023 17:22:02 -0600 From: Daniel Xu To: Andrii Nakryiko Cc: ast@kernel.org, andrii@kernel.org, shuah@kernel.org, daniel@iogearbox.net, steffen.klassert@secunet.com, antony.antony@secunet.com, mykolal@fb.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linux-ipsec.org Subject: Re: [RFC bpf-next 5/6] bpf: selftests: test_tunnel: Disable CO-RE relocations Message-ID: <73xnkgitatvymw2bqwo6elqmdpsvj2atmh6ugrityvqyegguq7@cjos2bsw2ico> References: <111a64c3e6ccda6b8a2826491715d4e8a645e384.1698431765.git.dxu@dxuuu.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Sun, 29 Oct 2023 16:28:11 -0700 (PDT) On Fri, Oct 27, 2023 at 01:33:09PM -0700, Andrii Nakryiko wrote: > On Fri, Oct 27, 2023 at 11:46 AM Daniel Xu wrote: > > > > Switching to vmlinux.h definitions seems to make the verifier very > > unhappy with bitfield accesses. The error is: > > > > ; md.u.md2.dir = direction; > > 33: (69) r1 = *(u16 *)(r2 +11) > > misaligned stack access off (0x0; 0x0)+-64+11 size 2 > > > > It looks like disabling CO-RE relocations seem to make the error go > > away. > > > > for accessing bitfields libbpf provides > BPF_CORE_READ_BITFIELD_PROBED() and BPF_CORE_READ_BITFIELD() macros In this case the code in question is: __u8 direction = 0; md.u.md2.dir = direction; IOW the problem is assigning to bitfields, not reading from them. Is that something that libbpf needs to support as well? Thanks, Daniel