From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a11xP-00050w-S6 for qemu-devel@nongnu.org; Mon, 23 Nov 2015 19:59:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a11xM-0002AK-Lm for qemu-devel@nongnu.org; Mon, 23 Nov 2015 19:59:43 -0500 Message-ID: <1448326773.4574.32.camel@kernel.crashing.org> From: Benjamin Herrenschmidt Date: Tue, 24 Nov 2015 11:59:33 +1100 In-Reply-To: <20151120075320.GE7118@voom.redhat.com> References: <1447201710-10229-1-git-send-email-benh@kernel.crashing.org> <1447201710-10229-25-git-send-email-benh@kernel.crashing.org> <20151120075320.GE7118@voom.redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 24/77] ppc: Move exception generation code out of line List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Fri, 2015-11-20 at 18:53 +1100, David Gibson wrote: > On Wed, Nov 11, 2015 at 11:27:37AM +1100, Benjamin Herrenschmidt > wrote: > > There's no point inlining this, if you hit the exception case you > > exit anyway, >=20 > That doesn't quite seem relevant - IIUC this is affecting inlining in > the code generation path, rather than the code execution path. Well, the generation path is also slightly performance sensitive. My point was making the error path inline wasn't buying us anything. > > and not inlining saves about 100K of code size (and cache > > footprint). >=20 > That sounds like a win, though. Yup. =C2=A0 .../... > > -static inline void gen_exception_err(DisasContext *ctx, uint32_t > > excp, uint32_t error) > > +static void __attribute__((noinline)) > > +gen_exception_err(DisasContext *ctx, uint32_t excp, uint32_t > > error) >=20 > I thought we generally avoided bare gcc attributes in qemu, but I > don't see a helper macro for it and I do see it used in a few other > places, so I guess its ok. That was my guess too... > > =C2=A0{ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0TCGv_i32 t0, t1; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (ctx->exception =3D=3D POWERPC_EXCP_= NONE) { > > @@ -293,7 +294,8 @@ static inline void > > gen_exception_err(DisasContext *ctx, uint32_t excp, uint32_t > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ctx->exception =3D (excp); > > =C2=A0} > > =C2=A0 > > -static inline void gen_exception(DisasContext *ctx, uint32_t excp) > > +static void __attribute__((noinline)) > > +gen_exception(DisasContext *ctx, uint32_t excp) > > =C2=A0{ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0TCGv_i32 t0; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (ctx->exception =3D=3D POWERPC_EXCP_= NONE) { > > @@ -305,7 +307,8 @@ static inline void gen_exception(DisasContext > > *ctx, uint32_t excp) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ctx->exception =3D (excp); > > =C2=A0} > > =C2=A0 > > -static inline void gen_debug_exception(DisasContext *ctx) > > +static void __attribute__((noinline)) > > +gen_debug_exception(DisasContext *ctx) > > =C2=A0{ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0TCGv_i32 t0; > > =C2=A0 >=20