From patchwork Tue Jan 25 10:57:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Tao X-Patchwork-Id: 12725001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7CD67C2BA4C for ; Wed, 26 Jan 2022 12:25:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=NhRhfvGxeNaP/Shn4K0k8wHjB/xWzQNy85135IsE8EA=; b=s79ClWcnhUYfQl 3oF3o+LVh+rnQ5QIBqMPUBkWQNOGRPaBSBmpakVvj7/zpEwyc406jnB98Gb2rmBCwZl4v3JtVVKqZ 5dvCk+0QfHd0clI7eq5vJfcIqKM42l0CShPOj03uWfyQloah7i+epDpAvo8En/8f5gX1HcnUFHuQU GlwSPOxZceL+Y0X8BzOjf2a1utDBSxvPHv6FGVfFwrhrunWoN8nS84VOZRufuSb6UevLI11Y8JAjj krTjQIJy4w3G+SHOpxkLq5cOC7BzvdW2yT+uIKFwLA+/pkg6sgxTDhZ0IHr3mu3/Wok8MifRuzMbu CB2vWUHyTdHgjwpl9wVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nChL2-00Bg6j-Bg; Wed, 26 Jan 2022 12:23:48 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nChKy-00Bg4v-8T for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 12:23:46 +0000 Received: from dggpeml500025.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4JkN830FDPzZfXT; Wed, 26 Jan 2022 20:19:47 +0800 (CST) Received: from huawei.com (10.175.124.27) by dggpeml500025.china.huawei.com (7.185.36.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 26 Jan 2022 20:23:41 +0800 From: Hou Tao To: Alexei Starovoitov , Daniel Borkmann CC: Ard Biesheuvel , Martin KaFai Lau , Yonghong Song , Andrii Nakryiko , Zi Shen Lim , Will Deacon , Catalin Marinas , , , Subject: [PATCH bpf-next v2 0/2] bpf, arm64: fix bpf line info Date: Tue, 25 Jan 2022 18:57:05 +0800 Message-ID: <20220125105707.292449-1-houtao1@huawei.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500025.china.huawei.com (7.185.36.35) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_042344_489755_BD122B36 X-CRM114-Status: UNSURE ( 6.48 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, The patchset addresses two issues in bpf line info for arm64: (1) insn_to_jit_off only considers the body itself and ignores prologue before the body. Fixed in patch #1. (2) insn_to_jit_off passed to bpf_prog_fill_jited_linfo() is calculated in instruction granularity instead of bytes granularity. Fixed in patch #2. Comments are always welcome. Regards, Tao Change Log: v2: * split into two independent patches (from Daniel) * use AARCH64_INSN_SIZE instead of defining INSN_SIZE v1: https://lore.kernel.org/bpf/20220104014236.1512639-1-houtao1@huawei.com Hou Tao (2): bpf, arm64: call build_prologue() first in first JIT pass bpf, arm64: calculate offset as byte-offset for bpf line info arch/arm64/net/bpf_jit_comp.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)