Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6172373rwl; Tue, 4 Apr 2023 08:47:29 -0700 (PDT) X-Google-Smtp-Source: AKy350YvwxOH1OrNeJrRU1Z66qlgQsbb9igp9SuJ7Ydd9fSKy82BMKd5WSCm5HiSmE2xSNLM7jdk X-Received: by 2002:a17:90b:1b0f:b0:23f:91e5:1038 with SMTP id nu15-20020a17090b1b0f00b0023f91e51038mr3314866pjb.11.1680623249463; Tue, 04 Apr 2023 08:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680623249; cv=none; d=google.com; s=arc-20160816; b=blZ8xwm5HcixrXzpYjMPpCdpQ85oTfBghqfJ/QZS8Q/ITz5RWhW+hoA/QTuzuAzysU d0BzlRixA1lkGMwr9CPnyPmtd811i1B5h8/c5BpjM2P48h8MoCY4Cs3LmGUcW5+EiKRy IX+4Mv17h9c8Sg25WX6x/4RFTTxuxk2CDB+7f965MlZkp/RY7Ej7bCbE+HP9+BqjWE+a NxRRzYEpEAej7s+F7/tFRagAai3oyQG0YnRfWu8clsgRrQVyickklpxM7Oc3J+V+xdNT z2vnBWgqrrc9zlEj74dltZ1jPrRR3lRCXS7UJjNrBqHf12oWWAuSgZfslbdNQLxgtkR5 Bc/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=booTjXEjDItMr83/eVTfoDxuM3Rup1He0ErLuQdXd0Q=; b=otk/BQrfGLKVpUmHWXHd7yVgxLZjGhhyVfT97OFBLSaG/O5QdZW9PeOpm68GvAy2lq 9Wi/BTHpnevIE8Sig5Jcq1MyTwPMfuRNbzVPZgPw/tyqSmvKP3stAnggANVT01hEaaCf UAl8mQYLzxQcvqIaY+mvQFMVfv2SOMSpacvwniHyodN6YlZ8/5if9R28paKOynDvsSD2 Fea1qeWPBr5jdxX92Hm1ahV5/qQf/w4RaskEax7sVZp4Ed63X4M23ec0abW13tmvGOnO EbwRFYnFzxOE9CdA8ITpphjywiICzBqtHvpIbpe/gdm2GXcMZ+LEuuIRWbdLHjWv/7Ol ARTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=OzxbHVty; 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 h15-20020a17090aa88f00b00234362da27bsi14606439pjq.127.2023.04.04.08.46.59; Tue, 04 Apr 2023 08:47:29 -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=bombadil.20210309 header.b=OzxbHVty; 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 S235799AbjDDPmk (ORCPT + 99 others); Tue, 4 Apr 2023 11:42:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235404AbjDDPmi (ORCPT ); Tue, 4 Apr 2023 11:42:38 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5481D4687; Tue, 4 Apr 2023 08:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=booTjXEjDItMr83/eVTfoDxuM3Rup1He0ErLuQdXd0Q=; b=OzxbHVtyfERSnBcrsPOVWl5N74 Wwjt4FFnh4JL6wj151vcbY8Ho3YWAWJmTY6uBMrEgRtcKeCF8r/WsbIGbNJktlDNxLc7QgJvQzT7d slGICmuquA4zKFpITpkzSJJCRMA2AK86yE7PBeajq9NP2lbyykUECAdvP9xA8kf6EMBpu+234Rg01 ctn8sDyiKq4TvMXuzbc/GTSOoNwnnTC+sNQIoQKC6sDM9bLksyTEzubF/MQbdYx/bykf8T1zjKG9t d4rVicC0bmCCQjeyxb5B/JrlCbErkI74h4UdE9tb4p5kAT+STXHwmO2jG1Jfs74FkQi7chhw87d/H qWGoE7Hw==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pjinR-0022mB-2C; Tue, 04 Apr 2023 15:42:09 +0000 Date: Tue, 4 Apr 2023 08:42:09 -0700 From: Christoph Hellwig To: Biju Das Cc: Christoph Hellwig , Prabhakar , "devicetree@vger.kernel.org" , Albert Ou , Arnd Bergmann , Geert Uytterhoeven , Samuel Holland , Heiko Stuebner , "linux-kernel@vger.kernel.org" , Prabhakar Mahadev Lad , "linux-renesas-soc@vger.kernel.org" , Conor Dooley , Rob Herring , Guo Ren , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , "linux-riscv@lists.infradead.org" , Andrew Jones Subject: Re: [PATCH v7 1/6] riscv: mm: dma-noncoherent: Switch using function pointers for cache management Message-ID: References: <20230330204217.47666-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20230330204217.47666-2-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 On Tue, Apr 04, 2023 at 06:24:16AM +0000, Biju Das wrote: > Just a question, how does function pointer makes a performance difference compared to > ALTERNATIVE_X() macros? > > On both cases, we are pushing function parameters to stack, jumping to the actual routine > And then on return pop the variables from stack. Am I missing something here? Indirect calls have always been more expensive, and with the hard- and software mitigations for spectre-like attacks they are becoming even more expensive. But other other point is adding more cache flushing variants should not be easy. Everyone should be using the standardize version. If it's not implemented in hardware despite having ratified extensions you can fake it up in SBI. Yes, that's way more expensive than indirect calls, but that's what you get for taping out new hardware that ignores the actual architecture specification and just does their own made up shit.