From: Tom Rini Date: Tue, 3 Jul 2018 08:41:54 -0400 Subject: [U-Boot] [PATCH v1 1/5] ARM: PSCI: initialize stack pointer on secondary CPUs In-Reply-To: References: <20180624190958.1818-1-stefan@agner.ch> <862302bd9399444ab2ce62d8c62a4b3f@SFHDAG6NODE3.st.com> Message-ID: <20180703124154.GQ4752@bill-the-cat.ec.rr.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Jul 03, 2018 at 02:32:28PM +0200, Stefan Agner wrote: > Hi Tom, Hi Stefano, > > On 02.07.2018 11:08, Patrick DELAUNAY wrote: > > Hi Stefan > > > >> From: Stefan Agner [mailto:stefan at agner.ch] > >> Sent: mercredi 27 juin 2018 10:36 > >> Subject: Re: [PATCH v1 1/5] ARM: PSCI: initialize stack pointer on secondary CPUs > >> > >> On 24.06.2018 21:09, Stefan Agner wrote: > >> > From: Stefan Agner > >> > > >> > A proper stack is required to safely use C code in psci_arch_cpu_entry. > >> > >> Patrick, I prefer to have your ack on this since you introduced > >> psci_arch_cpu_entry. > >> > >> As far as I can tell STM32MP1 uses C code in psci_arch_cpu_entry. The same > >> function in i.MX 7's PSCI implementation the compiler actually pushed stuff on > >> the (uninitialized) stack, which caused the newly brought up CPU to immediately > >> crash. > >> > >> Not sure if in your case the stack pointer is already setup by some other means > >> or your compiler does not use the stack. > >> > >> In any case, I think it is better to just setup the stack properly as done in this > >> patch... > > > > I expected that the secure stack is initialized by bootROM, but after > > check on 2018.07-rc2, > > I got a crash also with the stm32mp1 platform. > > > > After code review, my behavior is clearly not safe: I don't sure that > > the initial BootROM stack > > is not overlapping the installed PSCI monitor code or data. > > So I agree: it is needed to initialize the stack in psci_cpu_entry. > > > > Moreover after your patch the crash is solved for my platform stm32mp1. > > Given that this fixes two platforms I guess it definitely should go into > v2018.07. > > Technically, for i.MX 7 only patch 1, 2 and 3 are necessary, but 4 and 5 > are fairly straight forward and seem to work fine here. > > Patch 1 is generic, so not sure through which trees the patchset should > go... I'm OK with the series coming in if Stefano is. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: