* [PATCH] ARM: boot: Fix ATAGs with appended DTB
@ 2020-02-25 14:47 ` Geert Uytterhoeven
2020-02-26 6:35 ` Marek Szyprowski
0 siblings, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2020-02-25 14:47 UTC (permalink / raw)
To: Marek Szyprowski, Russell King, Nicolas Pitre, Arnd Bergmann,
Eric Miao, Uwe Kleine-König
Cc: Chris Brandt, Linux ARM, Linux-Renesas, linux-kernel, Geert Uytterhoeven
At early boot, register r8 may contain an ATAGs or DTB pointer.
When an appended DTB is found, its address is stored in r8, for
extraction of the RAM base address later.
However, if r8 contained an ATAGs pointer before, that pointer will be
lost, and the provided ATAGs is no longer folded into the provided DTB.
Fix this by leaving r8 untouched.
Fixes: 137e522593918be2 ("ARM: 8960/1: boot: Obtain start of physical memory from DTB")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Not tested with ATAGs, only with [uz]Image + DTB, and zImage with
appended DTB.
---
arch/arm/boot/compressed/head.S | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 339d4b4cfbbeed15..a351ed2bc195ed8d 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -267,16 +267,18 @@ not_angel:
cmp r0, r1 @ do we have a DTB there?
bne 1f
- mov r8, r6 @ use it if so
/* preserve 64-bit alignment */
add r5, r5, #7
bic r5, r5, #7
- add sp, sp, r5 @ and move stack above it
+ add sp, sp, r5 @ if so, move stack above DTB
+ mov r0, r6 @ and extract memory start from DTB
+ b 2f
1:
#endif /* CONFIG_ARM_APPENDED_DTB */
mov r0, r8
+2:
bl fdt_get_mem_start
mov r4, r0
cmp r0, #-1
--
2.17.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] ARM: boot: Fix ATAGs with appended DTB
2020-02-25 14:47 ` [PATCH] ARM: boot: Fix ATAGs with appended DTB Geert Uytterhoeven
@ 2020-02-26 6:35 ` Marek Szyprowski
2020-02-26 17:49 ` Russell King - ARM Linux admin
0 siblings, 1 reply; 9+ messages in thread
From: Marek Szyprowski @ 2020-02-26 6:35 UTC (permalink / raw)
To: Geert Uytterhoeven, Russell King, Nicolas Pitre, Arnd Bergmann,
Eric Miao, Uwe Kleine-König
Cc: Chris Brandt, Linux ARM, Linux-Renesas, linux-kernel
Hi Geert,
On 25.02.2020 15:47, Geert Uytterhoeven wrote:
> At early boot, register r8 may contain an ATAGs or DTB pointer.
> When an appended DTB is found, its address is stored in r8, for
> extraction of the RAM base address later.
>
> However, if r8 contained an ATAGs pointer before, that pointer will be
> lost, and the provided ATAGs is no longer folded into the provided DTB.
>
> Fix this by leaving r8 untouched.
>
> Fixes: 137e522593918be2 ("ARM: 8960/1: boot: Obtain start of physical memory from DTB")
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Not tested with ATAGs, only with [uz]Image + DTB, and zImage with
> appended DTB.
Works fine with zImage + appended DTB + cmdline/memory info passed via ATAGs
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> arch/arm/boot/compressed/head.S | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
> index 339d4b4cfbbeed15..a351ed2bc195ed8d 100644
> --- a/arch/arm/boot/compressed/head.S
> +++ b/arch/arm/boot/compressed/head.S
> @@ -267,16 +267,18 @@ not_angel:
> cmp r0, r1 @ do we have a DTB there?
> bne 1f
>
> - mov r8, r6 @ use it if so
> /* preserve 64-bit alignment */
> add r5, r5, #7
> bic r5, r5, #7
> - add sp, sp, r5 @ and move stack above it
> + add sp, sp, r5 @ if so, move stack above DTB
> + mov r0, r6 @ and extract memory start from DTB
> + b 2f
>
> 1:
> #endif /* CONFIG_ARM_APPENDED_DTB */
>
> mov r0, r8
> +2:
> bl fdt_get_mem_start
> mov r4, r0
> cmp r0, #-1
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ARM: boot: Fix ATAGs with appended DTB
2020-02-26 6:35 ` Marek Szyprowski
@ 2020-02-26 17:49 ` Russell King - ARM Linux admin
2020-02-26 17:56 ` Geert Uytterhoeven
0 siblings, 1 reply; 9+ messages in thread
From: Russell King - ARM Linux admin @ 2020-02-26 17:49 UTC (permalink / raw)
To: Marek Szyprowski, Geert Uytterhoeven
Cc: Nicolas Pitre, Arnd Bergmann, Eric Miao, Uwe Kleine-König,
Chris Brandt, Linux ARM, Linux-Renesas, linux-kernel
On Wed, Feb 26, 2020 at 07:35:14AM +0100, Marek Szyprowski wrote:
> Hi Geert,
>
> On 25.02.2020 15:47, Geert Uytterhoeven wrote:
> > At early boot, register r8 may contain an ATAGs or DTB pointer.
> > When an appended DTB is found, its address is stored in r8, for
> > extraction of the RAM base address later.
> >
> > However, if r8 contained an ATAGs pointer before, that pointer will be
> > lost, and the provided ATAGs is no longer folded into the provided DTB.
> >
> > Fix this by leaving r8 untouched.
> >
> > Fixes: 137e522593918be2 ("ARM: 8960/1: boot: Obtain start of physical memory from DTB")
> > Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
The original commit hasn't been submitted, so it can be fixed before it
hits mainline if you want. Let me know what you want to do. Thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ARM: boot: Fix ATAGs with appended DTB
2020-02-26 17:49 ` Russell King - ARM Linux admin
@ 2020-02-26 17:56 ` Geert Uytterhoeven
2020-02-26 17:57 ` Russell King - ARM Linux admin
0 siblings, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2020-02-26 17:56 UTC (permalink / raw)
To: Russell King - ARM Linux admin
Cc: Marek Szyprowski, Geert Uytterhoeven, Nicolas Pitre,
Arnd Bergmann, Eric Miao, Uwe Kleine-König, Chris Brandt,
Linux ARM, Linux-Renesas, Linux Kernel Mailing List
Hi Russell,
On Wed, Feb 26, 2020 at 6:49 PM Russell King - ARM Linux admin
<linux@armlinux.org.uk> wrote:
> On Wed, Feb 26, 2020 at 07:35:14AM +0100, Marek Szyprowski wrote:
> > On 25.02.2020 15:47, Geert Uytterhoeven wrote:
> > > At early boot, register r8 may contain an ATAGs or DTB pointer.
> > > When an appended DTB is found, its address is stored in r8, for
> > > extraction of the RAM base address later.
> > >
> > > However, if r8 contained an ATAGs pointer before, that pointer will be
> > > lost, and the provided ATAGs is no longer folded into the provided DTB.
> > >
> > > Fix this by leaving r8 untouched.
> > >
> > > Fixes: 137e522593918be2 ("ARM: 8960/1: boot: Obtain start of physical memory from DTB")
> > > Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> The original commit hasn't been submitted, so it can be fixed before it
> hits mainline if you want. Let me know what you want to do. Thanks.
Fixing the original is fine for me, of course.
Thanks!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ARM: boot: Fix ATAGs with appended DTB
2020-02-26 17:56 ` Geert Uytterhoeven
@ 2020-02-26 17:57 ` Russell King - ARM Linux admin
2020-02-26 20:48 ` Geert Uytterhoeven
0 siblings, 1 reply; 9+ messages in thread
From: Russell King - ARM Linux admin @ 2020-02-26 17:57 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Marek Szyprowski, Geert Uytterhoeven, Nicolas Pitre,
Arnd Bergmann, Eric Miao, Uwe Kleine-König, Chris Brandt,
Linux ARM, Linux-Renesas, Linux Kernel Mailing List
On Wed, Feb 26, 2020 at 06:56:06PM +0100, Geert Uytterhoeven wrote:
> Hi Russell,
>
> On Wed, Feb 26, 2020 at 6:49 PM Russell King - ARM Linux admin
> <linux@armlinux.org.uk> wrote:
> > On Wed, Feb 26, 2020 at 07:35:14AM +0100, Marek Szyprowski wrote:
> > > On 25.02.2020 15:47, Geert Uytterhoeven wrote:
> > > > At early boot, register r8 may contain an ATAGs or DTB pointer.
> > > > When an appended DTB is found, its address is stored in r8, for
> > > > extraction of the RAM base address later.
> > > >
> > > > However, if r8 contained an ATAGs pointer before, that pointer will be
> > > > lost, and the provided ATAGs is no longer folded into the provided DTB.
> > > >
> > > > Fix this by leaving r8 untouched.
> > > >
> > > > Fixes: 137e522593918be2 ("ARM: 8960/1: boot: Obtain start of physical memory from DTB")
> > > > Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >
> > The original commit hasn't been submitted, so it can be fixed before it
> > hits mainline if you want. Let me know what you want to do. Thanks.
>
> Fixing the original is fine for me, of course.
> Thanks!
Please submit a replacement for 8960/1, thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ARM: boot: Fix ATAGs with appended DTB
2020-02-26 17:57 ` Russell King - ARM Linux admin
@ 2020-02-26 20:48 ` Geert Uytterhoeven
2020-03-12 12:23 ` Marek Szyprowski
0 siblings, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2020-02-26 20:48 UTC (permalink / raw)
To: Russell King - ARM Linux admin
Cc: Marek Szyprowski, Geert Uytterhoeven, Nicolas Pitre,
Arnd Bergmann, Eric Miao, Uwe Kleine-König, Chris Brandt,
Linux ARM, Linux-Renesas, Linux Kernel Mailing List
Hi Russell,
On Wed, Feb 26, 2020 at 6:57 PM Russell King - ARM Linux admin
<linux@armlinux.org.uk> wrote:
> On Wed, Feb 26, 2020 at 06:56:06PM +0100, Geert Uytterhoeven wrote:
> > On Wed, Feb 26, 2020 at 6:49 PM Russell King - ARM Linux admin
> > <linux@armlinux.org.uk> wrote:
> > > On Wed, Feb 26, 2020 at 07:35:14AM +0100, Marek Szyprowski wrote:
> > > > On 25.02.2020 15:47, Geert Uytterhoeven wrote:
> > > > > At early boot, register r8 may contain an ATAGs or DTB pointer.
> > > > > When an appended DTB is found, its address is stored in r8, for
> > > > > extraction of the RAM base address later.
> > > > >
> > > > > However, if r8 contained an ATAGs pointer before, that pointer will be
> > > > > lost, and the provided ATAGs is no longer folded into the provided DTB.
> > > > >
> > > > > Fix this by leaving r8 untouched.
> > > > >
> > > > > Fixes: 137e522593918be2 ("ARM: 8960/1: boot: Obtain start of physical memory from DTB")
> > > > > Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > >
> > > The original commit hasn't been submitted, so it can be fixed before it
> > > hits mainline if you want. Let me know what you want to do. Thanks.
> >
> > Fixing the original is fine for me, of course.
> > Thanks!
>
> Please submit a replacement for 8960/1, thanks.
Done.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ARM: boot: Fix ATAGs with appended DTB
2020-02-26 20:48 ` Geert Uytterhoeven
@ 2020-03-12 12:23 ` Marek Szyprowski
2020-03-12 12:28 ` Russell King - ARM Linux admin
2020-03-12 12:29 ` Geert Uytterhoeven
0 siblings, 2 replies; 9+ messages in thread
From: Marek Szyprowski @ 2020-03-12 12:23 UTC (permalink / raw)
To: Geert Uytterhoeven, Russell King - ARM Linux admin
Cc: Geert Uytterhoeven, Nicolas Pitre, Arnd Bergmann, Eric Miao,
Uwe Kleine-König, Chris Brandt, Linux ARM, Linux-Renesas,
Linux Kernel Mailing List
Hi,
On 26.02.2020 21:48, Geert Uytterhoeven wrote:
> Hi Russell,
>
> On Wed, Feb 26, 2020 at 6:57 PM Russell King - ARM Linux admin
> <linux@armlinux.org.uk> wrote:
>> On Wed, Feb 26, 2020 at 06:56:06PM +0100, Geert Uytterhoeven wrote:
>>> On Wed, Feb 26, 2020 at 6:49 PM Russell King - ARM Linux admin
>>> <linux@armlinux.org.uk> wrote:
>>>> On Wed, Feb 26, 2020 at 07:35:14AM +0100, Marek Szyprowski wrote:
>>>>> On 25.02.2020 15:47, Geert Uytterhoeven wrote:
>>>>>> At early boot, register r8 may contain an ATAGs or DTB pointer.
>>>>>> When an appended DTB is found, its address is stored in r8, for
>>>>>> extraction of the RAM base address later.
>>>>>>
>>>>>> However, if r8 contained an ATAGs pointer before, that pointer will be
>>>>>> lost, and the provided ATAGs is no longer folded into the provided DTB.
>>>>>>
>>>>>> Fix this by leaving r8 untouched.
>>>>>>
>>>>>> Fixes: 137e522593918be2 ("ARM: 8960/1: boot: Obtain start of physical memory from DTB")
>>>>>> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>>>>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>>>> The original commit hasn't been submitted, so it can be fixed before it
>>>> hits mainline if you want. Let me know what you want to do. Thanks.
>>> Fixing the original is fine for me, of course.
>>> Thanks!
>> Please submit a replacement for 8960/1, thanks.
> Done.
Gentle ping. This fix is still not present in linux-next for over 2 weeks...
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ARM: boot: Fix ATAGs with appended DTB
2020-03-12 12:23 ` Marek Szyprowski
@ 2020-03-12 12:28 ` Russell King - ARM Linux admin
2020-03-12 12:29 ` Geert Uytterhoeven
1 sibling, 0 replies; 9+ messages in thread
From: Russell King - ARM Linux admin @ 2020-03-12 12:28 UTC (permalink / raw)
To: Marek Szyprowski
Cc: Geert Uytterhoeven, Geert Uytterhoeven, Nicolas Pitre,
Arnd Bergmann, Eric Miao, Uwe Kleine-König, Chris Brandt,
Linux ARM, Linux-Renesas, Linux Kernel Mailing List
On Thu, Mar 12, 2020 at 01:23:09PM +0100, Marek Szyprowski wrote:
> Hi,
>
> On 26.02.2020 21:48, Geert Uytterhoeven wrote:
> > Hi Russell,
> >
> > On Wed, Feb 26, 2020 at 6:57 PM Russell King - ARM Linux admin
> > <linux@armlinux.org.uk> wrote:
> >> On Wed, Feb 26, 2020 at 06:56:06PM +0100, Geert Uytterhoeven wrote:
> >>> On Wed, Feb 26, 2020 at 6:49 PM Russell King - ARM Linux admin
> >>> <linux@armlinux.org.uk> wrote:
> >>>> On Wed, Feb 26, 2020 at 07:35:14AM +0100, Marek Szyprowski wrote:
> >>>>> On 25.02.2020 15:47, Geert Uytterhoeven wrote:
> >>>>>> At early boot, register r8 may contain an ATAGs or DTB pointer.
> >>>>>> When an appended DTB is found, its address is stored in r8, for
> >>>>>> extraction of the RAM base address later.
> >>>>>>
> >>>>>> However, if r8 contained an ATAGs pointer before, that pointer will be
> >>>>>> lost, and the provided ATAGs is no longer folded into the provided DTB.
> >>>>>>
> >>>>>> Fix this by leaving r8 untouched.
> >>>>>>
> >>>>>> Fixes: 137e522593918be2 ("ARM: 8960/1: boot: Obtain start of physical memory from DTB")
> >>>>>> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> >>>>>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >>>> The original commit hasn't been submitted, so it can be fixed before it
> >>>> hits mainline if you want. Let me know what you want to do. Thanks.
> >>> Fixing the original is fine for me, of course.
> >>> Thanks!
> >> Please submit a replacement for 8960/1, thanks.
> > Done.
>
> Gentle ping. This fix is still not present in linux-next for over 2 weeks...
The 32-bit ARM tree is now a low priority ad-hoc effort; as a result,
I now only merge patches around once or twice each cycle. I've merged
the replacement earlier this morning.
So, it will take longer than two weeks for patches to make it into my
tree, as has been the case ever since I lost funding for maintaining
32-bit ARM support, and, therefore, I now have other priorities.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 10.2Mbps down 587kbps up
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] ARM: boot: Fix ATAGs with appended DTB
2020-03-12 12:23 ` Marek Szyprowski
2020-03-12 12:28 ` Russell King - ARM Linux admin
@ 2020-03-12 12:29 ` Geert Uytterhoeven
1 sibling, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2020-03-12 12:29 UTC (permalink / raw)
To: Marek Szyprowski
Cc: Russell King - ARM Linux admin, Geert Uytterhoeven,
Nicolas Pitre, Arnd Bergmann, Eric Miao, Uwe Kleine-König,
Chris Brandt, Linux ARM, Linux-Renesas,
Linux Kernel Mailing List
Hi Marek,
On Thu, Mar 12, 2020 at 1:23 PM Marek Szyprowski
<m.szyprowski@samsung.com> wrote:
> On 26.02.2020 21:48, Geert Uytterhoeven wrote:
> > On Wed, Feb 26, 2020 at 6:57 PM Russell King - ARM Linux admin
> > <linux@armlinux.org.uk> wrote:
> >> On Wed, Feb 26, 2020 at 06:56:06PM +0100, Geert Uytterhoeven wrote:
> >>> On Wed, Feb 26, 2020 at 6:49 PM Russell King - ARM Linux admin
> >>> <linux@armlinux.org.uk> wrote:
> >>>> On Wed, Feb 26, 2020 at 07:35:14AM +0100, Marek Szyprowski wrote:
> >>>>> On 25.02.2020 15:47, Geert Uytterhoeven wrote:
> >>>>>> At early boot, register r8 may contain an ATAGs or DTB pointer.
> >>>>>> When an appended DTB is found, its address is stored in r8, for
> >>>>>> extraction of the RAM base address later.
> >>>>>>
> >>>>>> However, if r8 contained an ATAGs pointer before, that pointer will be
> >>>>>> lost, and the provided ATAGs is no longer folded into the provided DTB.
> >>>>>>
> >>>>>> Fix this by leaving r8 untouched.
> >>>>>>
> >>>>>> Fixes: 137e522593918be2 ("ARM: 8960/1: boot: Obtain start of physical memory from DTB")
> >>>>>> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> >>>>>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >>>> The original commit hasn't been submitted, so it can be fixed before it
> >>>> hits mainline if you want. Let me know what you want to do. Thanks.
> >>> Fixing the original is fine for me, of course.
> >>> Thanks!
> >> Please submit a replacement for 8960/1, thanks.
> > Done.
>
> Gentle ping. This fix is still not present in linux-next for over 2 weeks...
According to
https://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=8963
the fixed version was applied less than one hour ago.
It's now part of arm/for-next.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-03-12 12:29 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20200225144815eucas1p1229ceb0d017b46cbbe2409639a7c1f83@eucas1p1.samsung.com>
2020-02-25 14:47 ` [PATCH] ARM: boot: Fix ATAGs with appended DTB Geert Uytterhoeven
2020-02-26 6:35 ` Marek Szyprowski
2020-02-26 17:49 ` Russell King - ARM Linux admin
2020-02-26 17:56 ` Geert Uytterhoeven
2020-02-26 17:57 ` Russell King - ARM Linux admin
2020-02-26 20:48 ` Geert Uytterhoeven
2020-03-12 12:23 ` Marek Szyprowski
2020-03-12 12:28 ` Russell King - ARM Linux admin
2020-03-12 12:29 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).