From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E64BF2C0199 for ; Sat, 26 Oct 2013 18:26:51 +1100 (EST) Subject: Re: [PATCH] [RFC] Emulate "lwsync" to run standard user land on e500 cores Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Kumar Gala In-Reply-To: <1382706165.9395.63.camel@pasglop> Date: Sat, 26 Oct 2013 02:26:34 -0500 Message-Id: References: <1382081880-6666-1-git-send-email-wd@denx.de> <39CCEB38-1D9B-4918-B8F4-148D4E90FE21@kernel.crashing.org> <1382523314.3926.21.camel@aoeu.buserror.net> <1382607919.9395.56.camel@pasglop> <6BFC8EB0-1A75-41C3-985A-E3ED14846710@kernel.crashing.org> , <26976A96-8DF8-44EB-8B9B-E23200738F4E@kernel.crashing.org> <1382706165.9395.63.camel@pasglop> To: Benjamin Herrenschmidt Cc: Yang James-RA8135 , David Laight , linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Oct 25, 2013, at 8:02 AM, Benjamin Herrenschmidt wrote: > On Fri, 2013-10-25 at 10:58 +0100, David Laight wrote: >>> This is not a distro issue. It's a libstdc++ portability issue. = libstdc++ >>> hardcodes lwsync unless __NO_LWSYNC__ is explicitly defined, >>> which you only get with -mcpu=3D8540/-mcpu=3D8548. When compiled >>> for any powerpc target other than -mcpu=3D8540/-mcpu=3D8548, = including >>> the default -mcpu=3Dcommon, libstdc++ will end up containing = lwsync. >>> There is no way to explicitly request libstdc++ to be built without = lwsync >>> with an -mcpu target other than 8540/8548. >>>=20 >>> The issue is easily demonstrated by running a program that throws a >>> C++ exception: __cxa_throw() is called, which has an lwsync. This >>> results in an illegal instruction exception when run on an = e500v1/e500v2. >>=20 >> Perhaps libstc++ should be working out at run time whether lwsync is = valid? >=20 > Do we have enough coats of paint on this bike shed yet ? :-) >=20 > I'm personally tempted to take Scott's approach since that's what we = do > for other things as well, it just works and is simple. >=20 > Cheers, > Ben. >=20 I give in, however some should test with CONFIG_PPC_EMULATED_STATS and = fix what I'm guessing is a build breakage with either patch. - k