Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3949700ybl; Mon, 9 Dec 2019 02:55:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzXxRGT6ulz4be04gnmXj2Vh05wwvMXTk6hLKN1a3Wc3ZZ3UGjakCedY0y5xkiL0Dtu/gXP X-Received: by 2002:a9d:4d99:: with SMTP id u25mr15909712otk.56.1575888935434; Mon, 09 Dec 2019 02:55:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575888935; cv=none; d=google.com; s=arc-20160816; b=JRasZGT2UwV1ML4338owmyVg72BPi0zKfDZYP2ZBxxpJWBSnz/1kQDc1TfKctUkgs1 /XrMczpxdfVUqd+JYm6Cgzw0gKa0oykYX0q7p67RLpAifflEyMO+335E0NhEfH09FvpX zpOd0MEIjx6CRxXuoHp5QSh5PRTRio52S4x0gfR7FoJ5L1xEONzimY3Dcn76UdMyCiFH SOoAglqXNkulz6ooXBsl8M5CumzY62HLxcXG2UJXh5AG8Dg9Lk+tEJrEeMhJ/4szGddO iebMczLjalnjG3TsS+WIFB+N79yyrwwyx1ayKmvMEv6Tgz+HKSZElXnUGstm7pnDoBaU zw8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=FZ942XnzDDLx4ZfztsffXpCe4UxI8UZ+13FzUwRUspA=; b=ZcsKMBrMM1KY8gHafpwehwQwaVF404MjURa02zJZiPm1UXuBW+qJ2wNFhqhrPodNKb hatjch0z9xazWnYZLtnSYSFRcfhDw1e+YbfxSkGMKj1MfIatMQs6W5GF+2VC8gm8wdSB fAuERqLTgW17Q/zNJf0XEW+rD+y+z2SddpnUBaXI2rUc5iFlrWLl6HYVl/0ypQDCMWcY ZRuqVEh62ONtOnCJuwQh5OtpVV4ZGt6v5TIQvlgXEhir55FHYTAiRTJ+XfqtyQwXO1LZ DB1IZnCjZkLxyOu/elFn1+jz28CuwIfImY+QWOtodrdDlxPMIO/axAlSVKmV8yxiXzGv MphQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b="J4L8Im/v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p71si11253650oic.138.2019.12.09.02.55.23; Mon, 09 Dec 2019 02:55:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b="J4L8Im/v"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727387AbfLIKxS (ORCPT + 99 others); Mon, 9 Dec 2019 05:53:18 -0500 Received: from bilbo.ozlabs.org ([203.11.71.1]:38579 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726297AbfLIKxS (ORCPT ); Mon, 9 Dec 2019 05:53:18 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 47Wg5l45Wvz9sP6; Mon, 9 Dec 2019 21:53:15 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1575888796; bh=Sx8iWlX5fXNNlqxjgYMOs3SvPENuiEFrugWvdXWYq5o=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=J4L8Im/vg/Tt++EhvqfFa7Bo1cQsG4hCAPfpeP2fg44UAP67R/2X7N0oTcZHNRpWj oVJIHl24WiU8flkmL4B/x/bmIjVnPQHFYMPPxtC+4Zahmt162zCOWwzYIqDCIsMWOw LQF07hgKMnLUlSeXMIty4R9ZIL6VBU6mPLEMMufnGZSLg6hoQwlDUGzT/yWsmfbLzA A7fr4MWpjDvvR2rWKrmrz4HD0hhTDufo4iXGgumnh1XR18Tc017OCuf6wb1nd2sST3 8os8Hx7trY8PNyubwVGnBZjAAS3smHHf2sjXQ9i/+bBQmP4lZPeMM2PGxURE+MSWlU zD64Hn9ejlcFw== From: Michael Ellerman To: Segher Boessenkool , Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v4 2/2] powerpc/irq: inline call_do_irq() and call_do_softirq() In-Reply-To: <20191207174057.GY3152@gate.crashing.org> References: <20191121101552.GR16031@gate.crashing.org> <87y2w49rgo.fsf@mpe.ellerman.id.au> <20191125142556.GU9491@gate.crashing.org> <5fdb1c92-8bf4-01ca-f81c-214870c33be3@c-s.fr> <20191127145958.GG9491@gate.crashing.org> <2072e066-1ffb-867e-60ec-04a6bb9075c1@c-s.fr> <20191129184658.GR9491@gate.crashing.org> <20191206205953.GQ3152@gate.crashing.org> <2a22feca-d6d6-6cb0-6c76-035234fa8742@c-s.fr> <20191207174057.GY3152@gate.crashing.org> Date: Mon, 09 Dec 2019 21:53:11 +1100 Message-ID: <878snlrcrs.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Segher Boessenkool writes: > On Sat, Dec 07, 2019 at 10:42:28AM +0100, Christophe Leroy wrote: >> Le 06/12/2019 =C3=A0 21:59, Segher Boessenkool a =C3=A9crit=C2=A0: >> >If the compiler can see the callee wants the same TOC as the caller has, >> >it does not arrange to set (and restore) it, no. If it sees it may be >> >different, it does arrange for that (and the linker then will check if >> >it actually needs to do anything, and do that if needed). >> > >> >In this case, the compiler cannot know the callee wants the same TOC, >> >which complicates thing a lot -- but it all works out. >>=20 >> Do we have a way to make sure which TOC the functions are using ? Is=20 >> there several TOC at all in kernel code ? > > Kernel modules have their own TOC, I think? Yes. >> >I think things can still go wrong if any of this is inlined into a kern= el >> >module? Is there anything that prevents this / can this not happen for >> >some fundamental reason I don't see? >>=20 >> This can't happen can it ? >> do_softirq_own_stack() is an outline function, defined in powerpc irq.c >> Its only caller is do_softirq() which is an outline function defined in= =20 >> kernel/softirq.c >>=20 >> That prevents inlining, doesn't it ? > > Hopefully, sure. Would be nice if it was clearer that this works... It > is too much like working by chance, the way it is :-( There's no way any of that code can end up in a module. Or at least if there is, that's a bug. >> Anyway, until we clarify all this I'll limit my patch to PPC32 which is= =20 >> where the real benefit is I guess. >>=20 >> At the end, maybe the solution should be to switch to IRQ stack=20 >> immediately in the exception entry as x86_64 do ? Yeah that might be cleaner. cheers