From patchwork Sun Jan 30 09:29:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Tao X-Patchwork-Id: 12729771 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 9410AC433EF for ; Sun, 30 Jan 2022 09:31:49 +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=GN9DDI4BEqge3mHgYdVtgRP5pfRDuM2iAHohjbu1zms=; b=2nBX4H9tZb2wGk vWj4VxeNabFLWxSTe3kwUZlwSOk0T/H6E21RqC7oOCiCSB/upnHG2wbSm+KQ8/dgWDUAOk6R58b1B NZcZG920U6RFyWy11WDg7IIFPbL5R3LWPveFmGSSdWJDMN1j/9mn1V9F0rcVwoE+t4dk/qSQtEM9i GrJ8tU7GtvoPyB1BCRGQZAtjdyW9TRO/AafxA6MUbdZXmV4QB9+cn0bCutnpd8SuXIzXvpinz0dFO LvezMphGj64h2mMgOMMGWsRRTtHwBdRCZcVndQJPZJuu0Gc8gPkpnsMkrCzeyDS0t1+bKOYKlo/ky 2+FG2IosoXZZF8VtrqOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nE6X1-006Exw-GF; Sun, 30 Jan 2022 09:29:59 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nE6Ww-006Ew3-1d for linux-arm-kernel@lists.infradead.org; Sun, 30 Jan 2022 09:29:56 +0000 Received: by mail-pj1-x1036.google.com with SMTP id h20-20020a17090adb9400b001b518bf99ffso15216535pjv.1 for ; Sun, 30 Jan 2022 01:29:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tpEvQsSuiYpBjJy3eGHkzJZD+Ume3n8lx1ImopJLRGQ=; b=nn0JIniocfx4raCSkUNCrTHItInul+TnBgK+Nzs50i3wc9aEkob2Em/XD2L4iuUSB6 +W2gONDcWVKBAeMKhMrbmOy+NQaykceuVIpTjSz7HEP+6PjK1DSNnTz5SY8FkHx6vwWV hO0ptfJoX+9x9de+2pCk/SRZmWfSRpkjnuLG3pvWid0giJvpBaZQyU9n4Zefj5yg1NVl RMODlhUgGu2lqtut8prQhlLXDiKKiits5D2ap6IHte/GTaZf/rzTzfZALbHgbsf7CiCp aguK1aZzWX5IqG6jSPt5YEXo2Dr8r3XrOWh/6zMsAMdAStiWh8zCLpm+g7f5G8KVWsMi ZBgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tpEvQsSuiYpBjJy3eGHkzJZD+Ume3n8lx1ImopJLRGQ=; b=7YI05XW7FQX1HZ1uHafP8n1WrLod8TxeqvPVrRzcPOEkYHsTsZothMk0WRnrSNRcVv vVO11HWbxruNIr5o2MwZ6S57OUbaEz7gOcD1aCULwPQ1Y7bm7oTqq7CtSlf/Sjuc1lq1 KRVrkbOGDBwwIJyYxH/Inb5rxyqZtGoYIR1O/pHMmtls+hZMCqjHJIZGfeYmNssQcf8e OrJtZ0y3U/JfPubD77/wuU4lcTqQwIWJRO2C4zhYINlRUN6/j8z78qzWXfTT4JRfQ125 Uo6R7MGkF7OVPUUI9py2RrSHQb6aWLt9psIcW6Z8O8H/pnV6aicoPvTm+76NghgrK9vw nPeg== X-Gm-Message-State: AOAM530HUhfj9zjmiMVPTV3X9UCpz9uwAfB8GERaqZfdrmo7eNt+VCh0 w71HXtIz9JRrVab1Ww/OAdI= X-Google-Smtp-Source: ABdhPJyGzk/8W/xQcfKS7DGHOkiwapqdHyXfHjy4HSzKOioQd6oz2ecaMPwDFPDCB5z7vm6e29YC2w== X-Received: by 2002:a17:902:a505:: with SMTP id s5mr16125096plq.157.1643534992605; Sun, 30 Jan 2022 01:29:52 -0800 (PST) Received: from localhost (61-223-193-169.dynamic-ip.hinet.net. [61.223.193.169]) by smtp.gmail.com with ESMTPSA id b4sm15446509pfl.106.2022.01.30.01.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jan 2022 01:29:51 -0800 (PST) From: Hou Tao To: Daniel Borkmann Cc: Alexei Starovoitov , Martin KaFai Lau , Yonghong Song , Andrii Nakryiko , "David S . Miller" , Jakub Kicinski , John Fastabend , netdev@vger.kernel.org, bpf@vger.kernel.org, houtao1@huawei.com, Zi Shen Lim , Catalin Marinas , Will Deacon , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, Hou Tao Subject: [PATCH bpf-next v3 0/3] bpf, arm64: enable kfunc call Date: Sun, 30 Jan 2022 17:29:14 +0800 Message-Id: <20220130092917.14544-1-hotforest@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220130_012954_126530_4022AB95 X-CRM114-Status: UNSURE ( 9.77 ) 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 simple patchset tries to enable kfunc call for arm64. Patch #1 just overrides bpf_jit_supports_kfunc_call() to enable kfunc call, patch #2 unexports the subtests in ksyms_module.c to fix the confusion in test output and patch #3 add a test in ksyms_module.c to ensure s32 is sufficient for kfunc offset. Change Log: v3: * patch #2: newly-addded to unexport unnecessary subtests * patch #3: use kallsyms_find() instead of reimplementing it. * patch #3: ensure kfunc call is supported before checking whether s32 will be overflowed or not. v2: https://lore.kernel.org/bpf/20220127071532.384888-1-houtao1@huawei.com/ * add a test to check whether imm will be overflowed for kfunc call v1: https://lore.kernel.org/bpf/20220119144942.305568-1-houtao1@huawei.com Hou Tao (3): bpf, arm64: enable kfunc call selftests/bpf: do not export subtest as standalone test selftests/bpf: check whether s32 is sufficient for kfunc offset arch/arm64/net/bpf_jit_comp.c | 5 ++ .../selftests/bpf/prog_tests/ksyms_module.c | 46 ++++++++++++++++++- .../bpf/prog_tests/xdp_adjust_frags.c | 6 --- .../bpf/prog_tests/xdp_adjust_tail.c | 4 +- .../bpf/prog_tests/xdp_cpumap_attach.c | 4 +- .../bpf/prog_tests/xdp_devmap_attach.c | 2 +- 6 files changed, 54 insertions(+), 13 deletions(-)