From: linux@arm.linux.org.uk (Russell King - ARM Linux) Date: Tue, 3 Nov 2015 20:30:44 +0000 Subject: v7-M: Fixing XIP when the kernel is in ROM In-Reply-To: <20151103200901.GL4931@pengutronix.de> References: <562FA053.6010208@st.com> <85aea33b93066d0959d98b56f8787ba3@agner.ch> <20151028074304.GN4931@pengutronix.de> <20151103200901.GL4931@pengutronix.de> Message-ID: <20151103203043.GF8644@n2100.arm.linux.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, Nov 03, 2015 at 09:09:01PM +0100, Uwe Kleine-K?nig wrote: > Hello, > > On Tue, Nov 03, 2015 at 05:52:53PM +0000, Chris Brandt wrote: > > > So the right fix is to move __v7m_setup_stack to .data I guess. > > > > > > Since my set of patches went nowhere, last week we had a look at doing just that (using a pre-allocated stack in .data instead of hard coding to the top of PLAT_PHYS_OFFSET). > > > > Here's the code we came up with. Seems to work on XIP and non-XIP builds as well as SMP and non-SMP. > > > > > > Maybe you can try this technique to allocate the temporary stack in the data section. > I think for v7-M it's easier. Just move the stack to .data and use it > from there where the linker put it to. Why waste memory - we already have a stack allocated in the .data segment already. -- FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.