Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1412900rdh; Fri, 27 Oct 2023 13:33:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcbbYN4QzVfpSsHACeLufQwkGpIP6MFaxNh3kUfixWplCfTVGgzdMOhxQVYFO1iJmd7Qtm X-Received: by 2002:a0d:d8d5:0:b0:5a8:2078:48e5 with SMTP id a204-20020a0dd8d5000000b005a8207848e5mr4150326ywe.31.1698438817467; Fri, 27 Oct 2023 13:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698438817; cv=none; d=google.com; s=arc-20160816; b=ifEWV3atJIV5sr3GHBP/LxhTAgDCqGo4YW6tNOxPIbxDoKyeS7tjoDtm/2B8CoTZmR LZ1MPfw+x5z9afUUhjvlzxi0JxTI2awx8Pj+Oj6V4+LJCMprtuoKaL13VTpaDmIOcCUQ l5PQS5fP/2RAit3mqmfdh+GvxploDIy1ErsQuN4/kPrW6SfBCKOCDGnlQGQYnyENePgH mu2I+C3NcH2jG+ETm/DZXzpd3G8luj/eqPwCywrjnqkwAMPr58zDsgV22ah22stkE7qn 4QMvZpYfLyqVAuz90krxmAwQ0lh184PK1GW0SWZ1ji5VD+wikhfkdUxyuTkvLTqK7jL+ d/pw== 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 :dkim-signature; bh=1WUzkzWOGzjZzeiD3BpbR+P5JlIo6IVznlquX7VRDdM=; fh=fVVxygk+zpCMK3n1z8+a3B0avSS/j1/wuM3CHzOzJ38=; b=GlenW2zTMmEizbKDkyQF57hd9gOKL1Yfe3/ps6bYPkDkJHmaQrXNyzJRFIygCzs4r2 9yAPtus8rTH5s156tmvHXqBW2w5Mjy3Bn7Mm+bvCCwKxHVQwqkZ2hsCQF8ZM+nP9OYhN Rmn5n1BwFGF5xLd078rCM7B+VBpENZhRfv6030aM6pZQdk9XcxE0gxIW7dfzo17yR9ZM q+aQaNQTa0hTlEQWLecvqTt9vJQehmprlKjI1UECcdzDFZg2mF7wG+tBcdYCwtbltNtn H0qUEP1AYVkSRzPxb/CMCmwnEyHlFf3GbXjeGW65KlA+3HJWoj/HWyY0zv0uVom0O0Jo 3BIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=AS+r+lK+; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id v4-20020a818504000000b0059f2c8a0504si3634973ywf.567.2023.10.27.13.33.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 13:33:37 -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=@gmail.com header.s=20230601 header.b=AS+r+lK+; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2477383C0E2B; Fri, 27 Oct 2023 13:33:34 -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 S232953AbjJ0Ud0 (ORCPT + 99 others); Fri, 27 Oct 2023 16:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232330AbjJ0UdZ (ORCPT ); Fri, 27 Oct 2023 16:33:25 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 271691AA; Fri, 27 Oct 2023 13:33:23 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9be3b66f254so370225066b.3; Fri, 27 Oct 2023 13:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698438801; x=1699043601; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1WUzkzWOGzjZzeiD3BpbR+P5JlIo6IVznlquX7VRDdM=; b=AS+r+lK+qLTPqgwGvdaTMQMZjWn1IxwyxEr+L0I+q7Hzhd2e2zvnot9jsrdnh2AYzj s/thX8ofDebJtAzUkw5i5AIZceeLZgpUc2WnfyOlWIYJce/ysPV66yrrRXUdJR8OALUo L+NtrWTMThqsNYAgOp8UNVXCO2FTYdhateY5+GYZaP3zLwQDkwlAQ/r+eUFIt0XvhMMn SZdueFTQahfj1jbUDvCkOKA/ceuQrt30UHCIgA/WLnYIfkXRIqJeC2S0AWya6u2c9AT5 pMzTPicc+F+HfbAgNWiMzscGbgt+qTp2XnPbRmxcKH4FOP9wRSJzRD+mRI2YALnRazTG jOfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698438801; x=1699043601; 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=1WUzkzWOGzjZzeiD3BpbR+P5JlIo6IVznlquX7VRDdM=; b=laTXjZhISoc2PMtrrMK1q2POopE74Piq1akp6rRqbPTnLNOjNsYaXVI8EKLWW4vMMm 3v5Qtxz/4p2gOrSZGbq6PAKohiqtuvsT5SDesc3+OEP72H8Rzpk6suTd0F/yengA2y3R Q7oZQ15heENs79Gyj6ykWPJrbqqfraUGfPr+kbqYMPsfhKb/EvQhYjsRHyW45oq0WPrR w2iLe7KsszhZX47yC29snCyrwKNh71doeTXmpODVfy8twtheEIjuBh4AnTcJ1TUxPYyr viRdbKdefBgniHGZlLMFaXO+svw68KXS7bGvWQ53bGGRJgROjONA/ElPEXN+GMEXSpHi g7Pw== X-Gm-Message-State: AOJu0YwFcryWdvQhNZkj8bdxNT1MJNTSHz5xg3JXfW/6C+lW6dpfiXJB 6nObiNUJxRo0bZn9m4L850Fi2+pti0u0ognU5pQ= X-Received: by 2002:a17:907:7f19:b0:9be:cdca:dae9 with SMTP id qf25-20020a1709077f1900b009becdcadae9mr3015726ejc.36.1698438801317; Fri, 27 Oct 2023 13:33:21 -0700 (PDT) MIME-Version: 1.0 References: <111a64c3e6ccda6b8a2826491715d4e8a645e384.1698431765.git.dxu@dxuuu.xyz> In-Reply-To: <111a64c3e6ccda6b8a2826491715d4e8a645e384.1698431765.git.dxu@dxuuu.xyz> From: Andrii Nakryiko Date: Fri, 27 Oct 2023 13:33:09 -0700 Message-ID: Subject: Re: [RFC bpf-next 5/6] bpf: selftests: test_tunnel: Disable CO-RE relocations To: Daniel Xu 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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]); Fri, 27 Oct 2023 13:33:34 -0700 (PDT) On Fri, Oct 27, 2023 at 11:46=E2=80=AFAM 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 =3D direction; > 33: (69) r1 =3D *(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 > Signed-off-by: Daniel Xu > --- > tools/testing/selftests/bpf/progs/test_tunnel_kern.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c b/tools= /testing/selftests/bpf/progs/test_tunnel_kern.c > index 3065a716544d..ec7e04e012ae 100644 > --- a/tools/testing/selftests/bpf/progs/test_tunnel_kern.c > +++ b/tools/testing/selftests/bpf/progs/test_tunnel_kern.c > @@ -6,6 +6,7 @@ > * modify it under the terms of version 2 of the GNU General Public > * License as published by the Free Software Foundation. > */ > +#define BPF_NO_PRESERVE_ACCESS_INDEX > #include "vmlinux.h" > #include > #include > -- > 2.42.0 >