From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 3ACB9C433F5 for ; Fri, 18 Mar 2022 17:41:38 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KKrsr5xpBz3bgN for ; Sat, 19 Mar 2022 04:41:36 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=NONTVbUi; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; helo=desiato.infradead.org; envelope-from=peterz@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=NONTVbUi; dkim-atps=neutral Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4KKrs620Wpz2x9d for ; Sat, 19 Mar 2022 04:40:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=UnwUchRztZx67XW2Wtg1p3jNoABacVhXYIkA4iPmYBY=; b=NONTVbUiR71+d0XeEcUfDpp0vP MD45EexewpUEUT12NhXyk4l9VOCb8yLfi+bcTQEWXsMpckaEb5xChedWfPc5fTjh1h2fK129+/85J Hm6FR3HNVdlvUi0F8DR4eW9s8pGpgqzWUO+fQGa31kyz/uvvTyJdE9/olTzVv69mADm7ilhVw1Brg AQzsAGv9FQeZ/kJ/CkQxgaFNjZDnuzXpKvg1MlyiZQVuH5pNRndlIxKG2D1AQbjmJzSMGOKH3YEtU bmLflbLqjsYd3ir/edfDfNhnm9cull9gwj+kle9CAxHUvu8tv3Tc9szD51ViCjMB6xaJ8PSmFGwly bTW7Rhzw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nVGaT-002GNw-QN; Fri, 18 Mar 2022 17:40:29 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 01ACF98841D; Fri, 18 Mar 2022 18:40:27 +0100 (CET) Date: Fri, 18 Mar 2022 18:40:27 +0100 From: Peter Zijlstra To: Christophe Leroy Subject: Re: [PATCH v2] static_call: Don't make __static_call_return0 static Message-ID: <20220318174027.GS8939@worktop.programming.kicks-ass.net> References: <30821468a0e7d28251954b578e5051dc09300d04.1647258493.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30821468a0e7d28251954b578e5051dc09300d04.1647258493.git.christophe.leroy@csgroup.eu> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt , Jason Baron , Josh Poimboeuf , linuxppc-dev@lists.ozlabs.org, Ard Biesheuvel Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Mar 14, 2022 at 12:49:36PM +0100, Christophe Leroy wrote: > System.map shows that vmlinux contains several instances of > __static_call_return0(): > > c0004fc0 t __static_call_return0 > c0011518 t __static_call_return0 > c00d8160 t __static_call_return0 > > arch_static_call_transform() uses the middle one to check whether we are > setting a call to __static_call_return0 or not: > > c0011520 : > c0011520: 3d 20 c0 01 lis r9,-16383 <== r9 = 0xc001 << 16 > c0011524: 39 29 15 18 addi r9,r9,5400 <== r9 += 0x1518 > c0011528: 7c 05 48 00 cmpw r5,r9 <== r9 has value 0xc0011518 here > > So if static_call_update() is called with one of the other instances of > __static_call_return0(), arch_static_call_transform() won't recognise it. > > In order to work properly, global single instance of __static_call_return0() is required. > > Fixes: 3f2a8fc4b15d ("static_call/x86: Add __static_call_return0()") > Signed-off-by: Christophe Leroy Thanks! I've transferred Josh' ack from v1 in the presumption he's fine with this one too :-) From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93C73C433F5 for ; Fri, 18 Mar 2022 17:41:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239705AbiCRRmS (ORCPT ); Fri, 18 Mar 2022 13:42:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235185AbiCRRmQ (ORCPT ); Fri, 18 Mar 2022 13:42:16 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23E2F196089 for ; Fri, 18 Mar 2022 10:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=UnwUchRztZx67XW2Wtg1p3jNoABacVhXYIkA4iPmYBY=; b=NONTVbUiR71+d0XeEcUfDpp0vP MD45EexewpUEUT12NhXyk4l9VOCb8yLfi+bcTQEWXsMpckaEb5xChedWfPc5fTjh1h2fK129+/85J Hm6FR3HNVdlvUi0F8DR4eW9s8pGpgqzWUO+fQGa31kyz/uvvTyJdE9/olTzVv69mADm7ilhVw1Brg AQzsAGv9FQeZ/kJ/CkQxgaFNjZDnuzXpKvg1MlyiZQVuH5pNRndlIxKG2D1AQbjmJzSMGOKH3YEtU bmLflbLqjsYd3ir/edfDfNhnm9cull9gwj+kle9CAxHUvu8tv3Tc9szD51ViCjMB6xaJ8PSmFGwly bTW7Rhzw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nVGaT-002GNw-QN; Fri, 18 Mar 2022 17:40:29 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 01ACF98841D; Fri, 18 Mar 2022 18:40:27 +0100 (CET) Date: Fri, 18 Mar 2022 18:40:27 +0100 From: Peter Zijlstra To: Christophe Leroy Cc: Josh Poimboeuf , Jason Baron , Steven Rostedt , Ard Biesheuvel , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: Re: [PATCH v2] static_call: Don't make __static_call_return0 static Message-ID: <20220318174027.GS8939@worktop.programming.kicks-ass.net> References: <30821468a0e7d28251954b578e5051dc09300d04.1647258493.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30821468a0e7d28251954b578e5051dc09300d04.1647258493.git.christophe.leroy@csgroup.eu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 14, 2022 at 12:49:36PM +0100, Christophe Leroy wrote: > System.map shows that vmlinux contains several instances of > __static_call_return0(): > > c0004fc0 t __static_call_return0 > c0011518 t __static_call_return0 > c00d8160 t __static_call_return0 > > arch_static_call_transform() uses the middle one to check whether we are > setting a call to __static_call_return0 or not: > > c0011520 : > c0011520: 3d 20 c0 01 lis r9,-16383 <== r9 = 0xc001 << 16 > c0011524: 39 29 15 18 addi r9,r9,5400 <== r9 += 0x1518 > c0011528: 7c 05 48 00 cmpw r5,r9 <== r9 has value 0xc0011518 here > > So if static_call_update() is called with one of the other instances of > __static_call_return0(), arch_static_call_transform() won't recognise it. > > In order to work properly, global single instance of __static_call_return0() is required. > > Fixes: 3f2a8fc4b15d ("static_call/x86: Add __static_call_return0()") > Signed-off-by: Christophe Leroy Thanks! I've transferred Josh' ack from v1 in the presumption he's fine with this one too :-)