Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1204718pxb; Tue, 8 Feb 2022 11:34:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyP1Dpv1pmCNiFEH6hWknyGBapshSvwSFhJgcMNZPEmxB8QOM5OuECEVzeKM6u7q5mLshrL X-Received: by 2002:a50:d5cd:: with SMTP id g13mr6151713edj.268.1644348882338; Tue, 08 Feb 2022 11:34:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644348882; cv=none; d=google.com; s=arc-20160816; b=I1c1w1/I4vfME1WkM1Up1RwS1Nydy5+QekdEC/s8IASfMOVZ5JVTWL0Ayra/casx8Y BtNWv6yr9h7zzHXBCk7CC1T+NfQVkmcYIrGKOGCOJf10Y528MsoDRZCvj8bReg4tTNek ChHWpLrX7WBkGumVFIk3usTqNL02GbCdsztJjXLNkuYzF92/Z7pOzxnaSbev5ORUnkRW znhSw/bqoMsCnxmhrcEyeBrnkulXkSatp9e5IMzxO2zdZOLVAAtSo3T33UMqlfsebbEL 39AmN7leQh2oqgN/g9gMrZX1+d76aplak+knUZ8NfwPPE1pMQPrm3CkAQgmLZIW+adqz nDQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=d6eh5upzfMbYNwHJ+sg6bV3O+R7A+94KcWdxqQhkk74=; b=KoqtDHzCU4QGSXOrIpcQPIeQjLE234b+J6U+ogB0w8Zx5z8OebrtFf8qpThqjZBCra P51luLo0QL+uU2kgEO/fUMe6/4/vzquqMcpmjrLbnj33pLjmkiokcPcHGKkF5TcS07O1 29hPqPqBvEfFBAruQApOWlD/E6Q7A8MfZEeDI9vktrr7vtPW1NI9TGS5BzyOtkfMLzDE SaLNgSLTn7QUtCgpXyPK0zLECG1PnAFSYINPho2dlRTUaR/dNNpC9VDYD5qreN1Amfbo j82Qr0CvMwx3g5Sf90aUz0I1cc56pZ0WmMAwxqcAFT+w3PYMfPG3cHTjwDNqFJFn3oF3 rOeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mf+Yh0ao; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg4si9253296ejc.594.2022.02.08.11.34.16; Tue, 08 Feb 2022 11:34:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mf+Yh0ao; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353639AbiBDHmO (ORCPT + 99 others); Fri, 4 Feb 2022 02:42:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234310AbiBDHmM (ORCPT ); Fri, 4 Feb 2022 02:42:12 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E13DC061714; Thu, 3 Feb 2022 23:42:12 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EB4C9B817E5; Fri, 4 Feb 2022 07:42:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A44D0C340EB; Fri, 4 Feb 2022 07:42:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643960529; bh=Kp4NxRJMhPOrk6yCLmuMuuK4NgUYV4IbJR5q0vDERwg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Mf+Yh0ao1IESxOx9bUslgQDJ/crTGytTfE2ICKsuJBoYFSimt1sHPJzOtRauvpEf4 PJniz64kRtHRYhJVOJMdIQzG9lFiDwJ9ymo7nCpSyBbU+CQesxcTiUAOZbtMobgzOP 6vNcvrTLykaykyJSEtpk4k+f30zWrMN9dJMDH6ZDDmxCNp9SKCWVgpTrRWy7FudZV0 iH7j2nP4shtv0qXNRO2cW62ulfTTPg4crgB64MrHREULX5F8XtmR5cHapwOr1tD/jO meN6bKfdF/t0EA91FCRGB3jIOLcnHnAJc+xsrURKv69Q4yT651siBbU4+va+kZqLo6 O9HrNmpRrAhYA== Received: by mail-yb1-f172.google.com with SMTP id c6so16316562ybk.3; Thu, 03 Feb 2022 23:42:09 -0800 (PST) X-Gm-Message-State: AOAM531J16bhlPBff1eT1aHwvFSa9txZSuU7QpWPLsR6b+lGbJI8x9g7 6YFApAk08zoK3NrPaMhMgukVpKvk4mM/pTUF/WU= X-Received: by 2002:a5b:54b:: with SMTP id r11mr1769676ybp.282.1643960528738; Thu, 03 Feb 2022 23:42:08 -0800 (PST) MIME-Version: 1.0 References: <20220201062803.2675204-1-song@kernel.org> <20220201062803.2675204-5-song@kernel.org> In-Reply-To: <20220201062803.2675204-5-song@kernel.org> From: Song Liu Date: Thu, 3 Feb 2022 23:41:57 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 bpf-next 4/9] bpf: use prog->jited_len in bpf_prog_ksym_set_addr() To: bpf , Networking , open list Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Kernel Team , Peter Zijlstra , X86 ML , Ilya Leoshkevich Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 31, 2022 at 10:31 PM Song Liu wrote: > > Using prog->jited_len is simpler and more accurate than current > estimation (header + header->size). > > Signed-off-by: Song Liu Hmm... CI [1] reports error on test_progs 159/tailcalls, and bisect points to this one. However, I couldn't figure out why this breaks tail call. round_up(PAGE_SIZE) does fix it though. But that won't be accurate, right? Any suggestions on what could be the reason for these failures? Thanks, Song [1] https://github.com/kernel-patches/bpf/runs/5060194776?check_suite_focus=true > --- > kernel/bpf/core.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c > index 14199228a6f0..e3fe53df0a71 100644 > --- a/kernel/bpf/core.c > +++ b/kernel/bpf/core.c > @@ -537,13 +537,10 @@ long bpf_jit_limit_max __read_mostly; > static void > bpf_prog_ksym_set_addr(struct bpf_prog *prog) > { > - const struct bpf_binary_header *hdr = bpf_jit_binary_hdr(prog); > - unsigned long addr = (unsigned long)hdr; > - > WARN_ON_ONCE(!bpf_prog_ebpf_jited(prog)); > > prog->aux->ksym.start = (unsigned long) prog->bpf_func; > - prog->aux->ksym.end = addr + hdr->size; > + prog->aux->ksym.end = prog->aux->ksym.start + prog->jited_len; > } > > static void > -- > 2.30.2 >