Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4172408ybl; Mon, 27 Jan 2020 18:16:50 -0800 (PST) X-Google-Smtp-Source: APXvYqxDwi6ziDn3OhgAhzf0On9dVPDjBlKa25+M5KZM4He37rnl9+rUP3O7tZazlb47T6g/Osd9 X-Received: by 2002:a9d:6ac2:: with SMTP id m2mr14822685otq.191.1580177810763; Mon, 27 Jan 2020 18:16:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580177810; cv=none; d=google.com; s=arc-20160816; b=Q8rCmfFmAjbFXoxeEIcmptm3KqISD6Gs83UEh0FeNHpgXrKhcncylhXF1H1Jd64sRm 1AtEVzgCozq5hW6ZZEv7Zre2ia4P525uRBGuTkxndtOvPjPoNiXtUFNyMgZMUjALtG/G YwTFJisvwfoplGSOj2KeICj1DpEvmkoaQulokSZpC1K4n0oXZXO6GCxEboK+N1Tf/jo6 rHjSCYz+8kl4ZheBdoHKJG/aC4mimF5825oxyBzkpD6cS/gas3gBl7XHPUWjZ+AAjJHu xGAH7gSvxVynT82u998ka34zkCUor8HxUAHeEmqn+BL+4mbQOGpmjuGU+i/fCgm0SrTK +T6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:to:from:cc :content-transfer-encoding:mime-version:message-id:date:subject :dkim-signature; bh=B26eSG9gMaHSxZUV5pLyS5i7Lt3Ya0fKdNJyMPYapJg=; b=pnfp2fnvJeVyYYqWUwsg14orx3Qm3mLw7Nd0yCafw1Ku2oRgvru/lPDjn4A5ThtxjF uxeXVbZeB7qnX7eEnVDUZXIb0dGXdth+sGkGdFm6pYMF5PqmymPljRhzWm8dz5Cq0hdN TpFfdLisbYTMxzifRHsm2qDZuEutVpLDPLpVdmT0xtrR4w0f4EqwgDO9DBe/sCxkErW/ 63cevNQG+zv8rxdRphO8zxu6NBk0pIbUMmlV8RivCrtSix1MIE/ykEd++Qp/bpuJcNxt mn5ZAwUr5hTQvaZHdo32G2Lns9TKGU4j96p+nFU80EGktDYgvVO9vT3OLhCP8iJrob94 ys/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rnj6yTlt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n25si4410298oij.175.2020.01.27.18.16.26; Mon, 27 Jan 2020 18:16:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rnj6yTlt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726080AbgA1COv (ORCPT + 99 others); Mon, 27 Jan 2020 21:14:51 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:38580 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726771AbgA1COu (ORCPT ); Mon, 27 Jan 2020 21:14:50 -0500 Received: by mail-pg1-f193.google.com with SMTP id a33so6148275pgm.5 for ; Mon, 27 Jan 2020 18:14:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=subject:date:message-id:mime-version:content-transfer-encoding:cc :from:to:in-reply-to:references; bh=B26eSG9gMaHSxZUV5pLyS5i7Lt3Ya0fKdNJyMPYapJg=; b=rnj6yTltwKWYN3+9NJAw5sCB/fR2AAcye4lYI+VlXhtsAeDA2BY21GJ8k8CnQf7aQY VdJ1qPrTM3EARaQkNVyPlmwk3OR0FZ1qhmjPYmqj747Fi6+MIUvvEt3r/xG932neiZRZ G3MOKgdSY//mdAPafDURRAFv84ghi6Xg6+OIs6B82gN1iNzgi4TCJIbiKMAjvWHnWsI8 LfD/uSlWuMSGAOZ40hPJMvwD5XkCAeqbt+356MQtEucaALw0rbVlR+5ifj9W6OqwPggu K+WgKDD0Sf0RDg9+u3AIFA8wMp9WAsRV6SFb5qwxtu0Spb25cBn4ycpFAc+FS2vQBAxJ dq0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:mime-version :content-transfer-encoding:cc:from:to:in-reply-to:references; bh=B26eSG9gMaHSxZUV5pLyS5i7Lt3Ya0fKdNJyMPYapJg=; b=i3r9J1ehubZ/a131ZBhbdC8Pyqny6dya0qxARn06gxUsL/29nCeTZbO9mw51+YxDyM eCHR46NI7cEEsOwxRwp0KFT1L+P25N1cuKutjNnJ+1vAJt9DCfVzwAI/ASSHvrxMlIse khHLcWPsUPpVFb9OlF/Q8tSwAn/CZAGaAyVgCKFnR3FGqJ5hJQuZbCA9yL1XvdHdahsu 7bQw7d3cUaxlyIkMBs3dbDDnd3iGorZjwH0t7fAk+Dqijmgpz0B0DmJOznD5u2AHBqio LIqqpVSwPQSkgt3EyRoZZr7i9Nep8VHYvTAjliOJqPRhI/R8Y5K15Pxv46M6kvGEJD/t TVDQ== X-Gm-Message-State: APjAAAUuloSV85aj15X5s7A9za1apfxDKRReiVvUxs5EAK+0eE3Mu7wJ sLqdw5yKqlFAN5D2DxD+LuieLg== X-Received: by 2002:a62:2b8a:: with SMTP id r132mr1588482pfr.56.1580177689517; Mon, 27 Jan 2020 18:14:49 -0800 (PST) Received: from localhost ([216.9.110.6]) by smtp.gmail.com with ESMTPSA id x21sm10370389pfq.76.2020.01.27.18.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 18:14:48 -0800 (PST) Subject: [PATCH 1/4] selftests/bpf: Elide a check for LLVM versions that can't compile it Date: Mon, 27 Jan 2020 18:11:42 -0800 Message-Id: <20200128021145.36774-2-palmerdabbelt@google.com> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: daniel@iogearbox.net, ast@kernel.org, zlim.lnx@gmail.com, catalin.marinas@arm.com, will@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com, shuah@kernel.org, Palmer Dabbelt , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, clang-built-linux@googlegroups.com, kernel-team@android.com From: Palmer Dabbelt To: Bjorn Topel In-Reply-To: <20200128021145.36774-1-palmerdabbelt@google.com> References: <20200128021145.36774-1-palmerdabbelt@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The current stable LLVM BPF backend fails to compile the BPF selftests due to a compiler bug. The bug has been fixed in trunk, but that fix hasn't landed in the binary packages I'm using yet (Fedora arm64). Without this workaround the tests don't compile for me. This patch triggers a preprocessor warning on LLVM versions that definitely have the bug. The test may be conservative (ie, I'm not sure if 9.1 will have the fix), but it should at least make the current set of stable releases work together. See https://reviews.llvm.org/D69438 for more information on the fix. I obtained the workaround from https://lore.kernel.org/linux-kselftest/aed8eda7-df20-069b-ea14-f06628984566@gmail.com/T/ Fixes: 20a9ad2e7136 ("selftests/bpf: add CO-RE relocs array tests") Signed-off-by: Palmer Dabbelt --- .../testing/selftests/bpf/progs/test_core_reloc_arrays.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/test_core_reloc_arrays.c b/tools/testing/selftests/bpf/progs/test_core_reloc_arrays.c index bf67f0fdf743..c9a3e0585a84 100644 --- a/tools/testing/selftests/bpf/progs/test_core_reloc_arrays.c +++ b/tools/testing/selftests/bpf/progs/test_core_reloc_arrays.c @@ -40,15 +40,23 @@ int test_core_arrays(void *ctx) /* in->a[2] */ if (BPF_CORE_READ(&out->a2, &in->a[2])) return 1; +#if defined(__clang__) && (__clang_major__ < 10) && (__clang_minor__ < 1) +# warning "clang 9.0 SEGVs on multidimensional arrays, see https://reviews.llvm.org/D69438" +#else /* in->b[1][2][3] */ if (BPF_CORE_READ(&out->b123, &in->b[1][2][3])) return 1; +#endif /* in->c[1].c */ if (BPF_CORE_READ(&out->c1c, &in->c[1].c)) return 1; +#if defined(__clang__) && (__clang_major__ < 10) && (__clang_minor__ < 1) +# warning "clang 9.0 SEGVs on multidimensional arrays, see https://reviews.llvm.org/D69438" +#else /* in->d[0][0].d */ if (BPF_CORE_READ(&out->d00d, &in->d[0][0].d)) return 1; +#endif return 0; } -- 2.25.0.341.g760bfbb309-goog