Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1182431pxb; Fri, 21 Jan 2022 11:40:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWyOFTRt4KQcHApR1zN31jl+2VhT5jUeX2J+aVoyW8vzlVqFav1aNFrvS4SAQwbpoN1Oc6 X-Received: by 2002:a63:914a:: with SMTP id l71mr3985930pge.249.1642794002262; Fri, 21 Jan 2022 11:40:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642794002; cv=none; d=google.com; s=arc-20160816; b=CdhRUjKiQF6BpKE/26m6CPBAp1HK1AmemVeXwG+C3fHWzDpCKldl03JSSSFnQ5MDVn gLEY1znlCEBpjbyZS51UpUutJCc1QK5LmZ1SZGoW9Sa+sz30zzNEYWeRuO72nPHaI74O abchqsRq90rteo5JOt95dxOOgJ7us8WnE+sh++OM33bn0Wdkhtusb6kfvrF9TFuU9VKP y98iYEx4wI5UfYw6tCtyVnz5pzMTPd3Q0yx8i7V3ecCcxUpvvnA7OQa8SpAP9nB/HIdI ycO03SKBk1/+rCjprqQ1l9FS3PTeM4KYHfgTykvc0G0fBtCZPGcpfCAOLSgimFl+Egf9 qhJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=0v3TMvjutMTw0sGmZecLVWJldBgCgND02t2RhGC5lbM=; b=VQTNVAR+U2l+VCP547zz2jX+hFXUmyA8Nz16yyW86lo7EfinfrASLbmUJbDR4SNRqS mcB7vEhHT2dUxwdytDAB2fCmsCOnnJtM0sn4bsyyvYyLQBWtjwfz/PapQdobsPpWfEsB Cdnc9PxV8GlrCyBVdeOpEqztCudfiPEJzn4ZKLVC8qe7C7hMU25nyE5xJG/dRktZTrPA pSpaaRecyjIhv0V+V1Lv4oULUXUSLTG2y9+HsI/luVJXzHifEb2ndvu5OJ5t6zTrLOmA 6WK39qo8CJulBHBWFVBJKkhN/fcT8c247j4CIbj8WL++1/1uvBKn409mourBmegcAY5b 4+7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p16si7095251pgc.395.2022.01.21.11.39.49; Fri, 21 Jan 2022 11:40:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355859AbiASPmg (ORCPT + 99 others); Wed, 19 Jan 2022 10:42:36 -0500 Received: from www62.your-server.de ([213.133.104.62]:52166 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355832AbiASPmf (ORCPT ); Wed, 19 Jan 2022 10:42:35 -0500 Received: from [78.46.152.42] (helo=sslproxy04.your-server.de) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1nAD6S-000FUR-0G; Wed, 19 Jan 2022 16:42:28 +0100 Received: from [85.1.206.226] (helo=linux.home) by sslproxy04.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAD6R-000O1M-Iy; Wed, 19 Jan 2022 16:42:27 +0100 Subject: Re: [PATCH riscv-next] riscv: bpf: Fix eBPF's exception tables To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Jisheng Zhang , Palmer Dabbelt , palmer@rivosinc.com Cc: Paul Walmsley , Albert Ou , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Netdev , bpf , linux-riscv , LKML , Tong Tiangen References: <20220110165208.1826-1-jszhang@kernel.org> From: Daniel Borkmann Message-ID: <1b104397-8cb7-c5c2-92cb-11ce56c9a8de@iogearbox.net> Date: Wed, 19 Jan 2022 16:42:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.3/26427/Wed Jan 19 11:42:43 2022) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/19/22 11:24 AM, Björn Töpel wrote: > On Mon, 10 Jan 2022 at 18:05, Jisheng Zhang wrote: >> On Tue, Jan 11, 2022 at 12:52:08AM +0800, Jisheng Zhang wrote: >>> eBPF's exception tables needs to be modified to relative synchronously. >>> >>> Suggested-by: Tong Tiangen >>> Signed-off-by: Jisheng Zhang > > Nice catch, and apologies for the slow response. > > Acked-by: Björn Töpel > >>> --- >>> arch/riscv/net/bpf_jit_comp64.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c >>> index 69bab7e28f91..44c97535bc15 100644 >>> --- a/arch/riscv/net/bpf_jit_comp64.c >>> +++ b/arch/riscv/net/bpf_jit_comp64.c >>> @@ -498,7 +498,7 @@ static int add_exception_handler(const struct bpf_insn *insn, >>> offset = pc - (long)&ex->insn; >>> if (WARN_ON_ONCE(offset >= 0 || offset < INT_MIN)) >>> return -ERANGE; >>> - ex->insn = pc; >>> + ex->insn = offset; >> >> Hi Palmer, >> >> Tong pointed out this issue but there was something wrong with my email >> forwarding address, so I didn't get his reply. Today, I searched on >> lore.kernel.org just found his reply, sorry for inconvenience. > > AFAIK, Jisheng's extable work is still in Palmer's for-next tree. > > Daniel/Alexei: This eBPF must follow commit 1f77ed9422cb ("riscv: > switch to relative extable and other improvements"), which is in > Palmer's tree. It cannot go via bpf-next. Thanks for letting us know, then lets route this fix via Palmer. Maybe he could also add Fixes tags when applying, so stable can pick it up later on. Cheers, Daniel