From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1BDBC43461 for ; Mon, 14 Sep 2020 14:02:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48487208E4 for ; Mon, 14 Sep 2020 14:02:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MK3CAoBd"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="zJsZJ6zE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48487208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=R5d6DMEvd8qDmAI0XSwNzCWNKoUTIHHxEDULmZK4d3s=; b=MK3CAoBdZdn0Rska74YLBCdKV ZEBOxyyeJuHvcJLnC4rXKHSg7Tg4SdPwLU9uS8n9+xWUME3jtXDtl2tus49D7zh9s45SeBGpKaM/C sg9/o/xwUyEs/DN/YdjM7QYbl909ncymgm8vfIl0rbMH7+puoD+OVAG4/scWCMz2NtvHdhVC9BMga BSM2x4o7Oy0JNIONxr3un4YfjoRelTobXvA6O2OOdJRRQRPme8OC5KWwlinbiuKH7+pLaQJ9M2qZt J47qLndnie5gIPV7EdnLRMBV7uPBZN9ZXXfFPV3x0cSfTvcXsEcjZzhrjzU9X+59bl3ej7SkqaSrT 0Ctec3cow==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHp2s-0003US-Pp; Mon, 14 Sep 2020 14:01:26 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHp2p-0003T7-90 for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 14:01:24 +0000 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6067F208E4; Mon, 14 Sep 2020 14:01:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600092082; bh=uGQUvm/OYFR2K5MLndS6fIko6WhVxVx+Wnfq37H7WNc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zJsZJ6zERMaYi/aOqwTDzLwuLhhOZnp5WvoE2wKtKMJQgLJMF7HJi+fkdeVbEpyMq H2dogMKvpig6YxNQG5PjAwCStQoOiroxn6sObHK2aLPYfaVnzBACDPH08T2RMvs65R MsK8VkAriperAXNqG0t3OjqACEuTzDnVNHOLF0s4= Date: Mon, 14 Sep 2020 15:01:15 +0100 From: Will Deacon To: Ilias Apalodimas Subject: Re: [PATCH] arm64: bpf: Fix branch offset in JIT Message-ID: <20200914140114.GG24441@willie-the-truck> References: <20200914083622.116554-1-ilias.apalodimas@linaro.org> <20200914122042.GA24441@willie-the-truck> <20200914123504.GA124316@apalos.home> <20200914132350.GA126552@apalos.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200914132350.GA126552@apalos.home> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_100123_401777_5AF777C1 X-CRM114-Status: GOOD ( 23.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jean-Philippe Brucker , Song Liu , linux-kernel@vger.kernel.org, Jesper Dangaard Brouer , Daniel Borkmann , Yauheni Kaliuta , Zi Shen Lim , naresh.kamboju@linaro.org, John Fastabend , Alexei Starovoitov , Martin KaFai Lau , netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Catalin Marinas , KP Singh , Yonghong Song , bpf@vger.kernel.org, Andrii Nakryiko , ardb@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Ilias, On Mon, Sep 14, 2020 at 04:23:50PM +0300, Ilias Apalodimas wrote: > On Mon, Sep 14, 2020 at 03:35:04PM +0300, Ilias Apalodimas wrote: > > On Mon, Sep 14, 2020 at 01:20:43PM +0100, Will Deacon wrote: > > > On Mon, Sep 14, 2020 at 11:36:21AM +0300, Ilias Apalodimas wrote: > > > > Running the eBPF test_verifier leads to random errors looking like this: [...] > > > > The reason seems to be the offset[] creation and usage ctx->offset[] > > > > > > "seems to be"? Are you unsure? > > > > Reading the history and other ports of the JIT implementation, I couldn't > > tell if the decision on skipping the 1st entry was deliberate or not on > > Aarch64. Reading through the mailist list didn't help either [1]. > > Skipping the 1st entry seems indeed to cause the problem. > > I did run the patch though the BPF tests and showed no regressions + fixing > > the error. > > I'll correct myself here. > Looking into 7c2e988f400e ("bpf: fix x64 JIT code generation for jmp to 1st insn") > explains things a bit better. > Jumping back to the 1st insn wasn't allowed until eBPF bounded loops were > introduced. That's what the 1st instruction was not saved in the original code. > > > > > > > No Fixes: tag? > > > > I'll re-spin and apply one > > > Any suggestion on any Fixes I should apply? The original code was 'correct' and > broke only when bounded loops and their self-tests were introduced. Ouch, that's pretty bad as it means nobody is regression testing BPF on arm64 with mainline. Damn. The Fixes: tag should identify the commit beyond which we don't need to backport the fix, so it sounds like introduction of bounded loops, according to your analysis. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel