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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5564CC433E3 for ; Mon, 29 Mar 2021 16:52:18 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4DACF61981 for ; Mon, 29 Mar 2021 16:52:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DACF61981 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4F8JXH3mPLz30BT for ; Tue, 30 Mar 2021 03:52:15 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nefkom.net (client-ip=212.18.0.9; helo=mail-out.m-online.net; envelope-from=whitebox@nefkom.net; receiver=) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4F8JWw4zm5z2yYZ for ; Tue, 30 Mar 2021 03:51:55 +1100 (AEDT) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4F8JWs1brCz1qtd6; Mon, 29 Mar 2021 18:51:53 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4F8JWs07P7z1r1MN; Mon, 29 Mar 2021 18:51:53 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id MNq1pLoSM0u6; Mon, 29 Mar 2021 18:51:52 +0200 (CEST) X-Auth-Info: 5/I5xbODmWC5+hbQN/k4J9zlsnkIZA28m3kRoxWTXIYD+G6Ld0StKhmD448nqGVa Received: from igel.home (ppp-46-244-184-171.dynamic.mnet-online.de [46.244.184.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 29 Mar 2021 18:51:52 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id A1BF52C3258; Mon, 29 Mar 2021 18:51:51 +0200 (CEST) From: Andreas Schwab To: Christophe Leroy Subject: Re: [PATCH] powerpc/64s: power4 nap fixup in C References: <20210312012044.3660743-1-npiggin@gmail.com> <236a67a4-1609-5fec-3c68-41db02cd1a4c__18973.8760514714$1617008745$gmane$org@csgroup.eu> <87czvikwb7.fsf__13924.9042653077$1617019017$gmane$org@igel.home> X-Yow: .. the HIGHWAY is made out of LIME JELLO and my HONDA is a barbequed OYSTER! Yum! Date: Mon, 29 Mar 2021 18:51:51 +0200 In-Reply-To: <87czvikwb7.fsf__13924.9042653077$1617019017$gmane$org@igel.home> (Andreas Schwab's message of "Mon, 29 Mar 2021 13:56:28 +0200") Message-ID: <87mtulkimw.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: linuxppc-dev@lists.ozlabs.org, Nicholas Piggin Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mär 29 2021, Andreas Schwab wrote: > On Mär 29 2021, Christophe Leroy wrote: > >> Le 29/03/2021 à 10:33, Benjamin Herrenschmidt a écrit : >>> On Fri, 2021-03-12 at 11:20 +1000, Nicholas Piggin wrote: >>>> >>>> +static inline void nap_adjust_return(struct pt_regs *regs) >>>> >>>> +{ >>>> >>>> +#ifdef CONFIG_PPC_970_NAP >>>> >>>> + if (unlikely(test_thread_local_flags(_TLF_NAPPING))) { >>>> + /* Can avoid a test-and-clear because NMIs do not call this */ >>>> + clear_thread_local_flags(_TLF_NAPPING); >>>> + regs->nip = (unsigned long)power4_idle_nap_return; >>>> + } >>> Is this a pointer to a function descriptor or the actual code ? >>> >> >> --- a/arch/powerpc/kernel/idle_book3s.S >> +++ b/arch/powerpc/kernel/idle_book3s.S >> @@ -209,4 +209,8 @@ _GLOBAL(power4_idle_nap) >> mtmsrd r7 >> isync >> b 1b >> + >> + .globl power4_idle_nap_return >> +power4_idle_nap_return: >> + blr >> #endif > > The problem is not the definition, it is the reference. In C, a > function symbol always resolves to the address of the descriptor. Sorry, this is wrong, I have misremembered how function descriptors work on ppc64. The address is really pointing to the actual code. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."