Message ID | 20221103120012.717020618@infradead.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp489776wru; Thu, 3 Nov 2022 05:14:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ROcuLttBDK44TmkldJ0z9W4BJ1x/2L+ZCHa1Hbzgt9NILrUBiqX9tyTwjR9/aitccc8cU X-Received: by 2002:aa7:ce92:0:b0:461:78c7:dfe2 with SMTP id y18-20020aa7ce92000000b0046178c7dfe2mr30603041edv.342.1667477676151; Thu, 03 Nov 2022 05:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667477676; cv=none; d=google.com; s=arc-20160816; b=QLVA055J+22uBzYIbqODHGZ+Nr6NzxaAt6sX1KogEsMlH/N/GGBGYvEqUDr7+xwNSk nEiag9BTmm6t1Fl1IQhKp0mSAu4cCtCXvAf6skf6GFKcliwDwUB0TWWrMrZ7rYxlmP61 J8L6YHsRavzVAuGXiG6/ARl5ItEByody9rdszA9DCAgImsuJUq+38kvBLN+Y0zU4RzzD kbkMjzB3865T2es8WQUogVCtlFkQskfg7ehEgc/SFC3Jrh7vpn24T5OPPRH1jjyVvHWO pVBNNoEZMo8QQ+iqGtFxQXuWRzyVil4Ua9xsGNXztWtT7MexvVZWeb3zA+XzFfxwILvX iMFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:user-agent:message-id :dkim-signature; bh=4jCdzdEgKJMqfguFXzmLkmfG4D81anvgaurHlpLDyOk=; b=GxNkLBDUVPlYEuawHW1BTsis/jjDR8SzAc1J7e2o78WofaZecUCnF/XIHZRW+mXcGZ Je9HHmibQxpS0j7SN7Pey+LEH5dnOx67acHTnX+T/+ay3h/K/Jh1Px4NeG5fQCs39Jxy Jg5UO0iAEZMOnycZcTvyk3VBEh+SFSMrPvj0o1rutiUyL+L9M1A5CmJjgutq+maAnP/V VOwnOd3xBBbtJdwOwUKR6jjfyLUNXIbvqhzbM69M+W1yqHTBbO5DOQQjEsqyTQrLng4x yrG3zSYWSdgCbMrwlpbopvbUdohlRsL8jRB5VBDUskK1tPbBxb274bBVa/vQEhj1bozC KlRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JHs1z4ax; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ba9-20020a0564021ac900b0045ddb2076casi992898edb.177.2022.11.03.05.14.11; Thu, 03 Nov 2022 05:14:36 -0700 (PDT) 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=@infradead.org header.s=casper.20170209 header.b=JHs1z4ax; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231513AbiKCMJL (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Thu, 3 Nov 2022 08:09:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231493AbiKCMJE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 3 Nov 2022 08:09:04 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10569FCF; Thu, 3 Nov 2022 05:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Subject:Cc:To:From:Date:Message-ID: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=4jCdzdEgKJMqfguFXzmLkmfG4D81anvgaurHlpLDyOk=; b=JHs1z4axWH2GPoZTKoZtohizp4 Wtywg/cyVEHbjeBvtjwYVoiQdcDmBpxNXqs6n0RABGZEqtEXhkf4yzyAwZ2yE/gtrhnEuxanzDbha 4WEyUiCkNQgDVcz4AUDyDINctf3nOErtR4ma/VLlSbElWGiD6mgxecLMXbNMAyp5C8RrZvGk5PWQt hgmAg7I81g5TE7Bjp96n2hjVcbdD6+iWl/G1LTL9eQuXx+W0Ggg6SdQsrz+5eiN3MQiHqZuoOKbve ip8rqLkzd6OKmabl3Okdvnh6OJlLjSQ0YUJwJPOZfqV/ABPcFA+++NbWE9JCiymY03EhOrBXYTDST HuZP+l2A==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqZ1g-006RMV-9H; Thu, 03 Nov 2022 12:08:52 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 2DB6730026A; Thu, 3 Nov 2022 13:08:44 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id 80BF520AB9A11; Thu, 3 Nov 2022 13:08:44 +0100 (CET) Message-ID: <20221103120012.717020618@infradead.org> User-Agent: quilt/0.66 Date: Thu, 03 Nov 2022 13:00:12 +0100 From: Peter Zijlstra <peterz@infradead.org> To: olsajiri@gmail.com, ast@kernel.org, daniel@iogearbox.net Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, peterz@infradead.org, bjorn@kernel.org, toke@redhat.com, David.Laight@aculab.com, rostedt@goodmis.org Subject: [PATCH 0/2] bpf: Yet another approach to fix the BPF dispatcher thing X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748477071957328558?= X-GMAIL-MSGID: =?utf-8?q?1748477071957328558?= |
Series |
bpf: Yet another approach to fix the BPF dispatcher thing
|
|
Message
Peter Zijlstra
Nov. 3, 2022, noon UTC
Hi! Even thought the __attribute__((patchable_function_entry())) solution to the BPF dispatcher woes works, it turns out to not be supported by the whole range of ageing compilers we support. Specifically this attribute seems to be GCC-8 and later. This is another approach -- using static_call() to rewrite the dispatcher function. I've compile tested this on: x86_64 (inline static-call support) i386 (out-of-line static-call support) aargh64 (no static-call support) A previous version was tested and found working by Bjorn. It is split in two patches; first reverting the current approach and then introducing the new for ease of review.
Comments
Peter Zijlstra <peterz@infradead.org> writes: > Hi! > > Even thought the __attribute__((patchable_function_entry())) solution to the > BPF dispatcher woes works, it turns out to not be supported by the whole range > of ageing compilers we support. Specifically this attribute seems to be GCC-8 > and later. > > This is another approach -- using static_call() to rewrite the dispatcher > function. I've compile tested this on: > > x86_64 (inline static-call support) > i386 (out-of-line static-call support) > aargh64 (no static-call support) > > A previous version was tested and found working by Bjorn. > > It is split in two patches; first reverting the current approach and then > introducing the new for ease of review. Took it for a spin on x86_64/KVM. For the series: Acked-by: Björn Töpel <bjorn@kernel.org> Tested-by: Björn Töpel <bjorn@kernel.org>
On Thu, Nov 03, 2022 at 01:00:12PM +0100, Peter Zijlstra wrote: > Hi! > > Even thought the __attribute__((patchable_function_entry())) solution to the > BPF dispatcher woes works, it turns out to not be supported by the whole range > of ageing compilers we support. Specifically this attribute seems to be GCC-8 > and later. > > This is another approach -- using static_call() to rewrite the dispatcher > function. I've compile tested this on: > > x86_64 (inline static-call support) > i386 (out-of-line static-call support) > aargh64 (no static-call support) > > A previous version was tested and found working by Bjorn. > > It is split in two patches; first reverting the current approach and then > introducing the new for ease of review. > Acked-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Jiri Olsa <jolsa@kernel.org> thanks, jirka
Hello: This series was applied to bpf/bpf.git (master) by Daniel Borkmann <daniel@iogearbox.net>: On Thu, 03 Nov 2022 13:00:12 +0100 you wrote: > Hi! > > Even thought the __attribute__((patchable_function_entry())) solution to the > BPF dispatcher woes works, it turns out to not be supported by the whole range > of ageing compilers we support. Specifically this attribute seems to be GCC-8 > and later. > > [...] Here is the summary with links: - [1/2] bpf: Revert ("Fix dispatcher patchable function entry to 5 bytes nop") (no matching commit) - [2/2] bpf: Convert BPF_DISPATCHER to use static_call() (not ftrace) https://git.kernel.org/bpf/bpf/c/c86df29d11df You are awesome, thank you!