Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1492161rwi; Thu, 3 Nov 2022 06:03:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7sXlvnJuVm/Z3Fms24dMtMufrU5WwSsCY7txMQ2WoHMmybtAeGiBIaG539+FYhco/qilL3 X-Received: by 2002:a17:907:8d07:b0:7ad:cdf2:7b66 with SMTP id tc7-20020a1709078d0700b007adcdf27b66mr20771001ejc.699.1667480600249; Thu, 03 Nov 2022 06:03:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667480600; cv=none; d=google.com; s=arc-20160816; b=D/gmH1d/ds00hTEwqMkBKpYjvWaIB1Ibs+JiM+QHI11Vpl7yLbpwFpD19dtHr/rRrn sD0xG81ZbIRdaewcIN87Iaaed3Xk1gHtScxrEuK1WCyRvB8PHjJilOkz5lO8Oxo1gct/ QgRBQwkOQLiQR33RqPwniQ5CFPDS1ulyINDuwTVhn2hnGGvkJdRVwYloTOgSv/AQwYZ7 Kol7c91/fynGOfDyzCTx8+UCQ0MBdMqEIS+eKeqZxwInlndIKReXFBeZBRRSCnb7Fmbs GwgyqeE3aNV/nfpIocGa/6SxpfBDCOSBBGcLAT5iDCCETpObqfMZgbz9DiR23A/2UYOR 6X+w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m5-20020a50cc05000000b00463d6098de6si1121597edi.155.2022.11.03.06.02.48; Thu, 03 Nov 2022 06:03:20 -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 + 97 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 ); 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 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: X-Mailing-List: linux-kernel@vger.kernel.org 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.