Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1240757 > unrolled thread

Re: [PATCH V4 2/3] arm64: support initrd outside kernel linear map

Started byMark Rutland <mark.rutland@arm.com>
First post2015-10-06 19:20 +0200
Last post2015-10-08 11:50 +0200
Articles 5 — 5 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH V4 2/3] arm64: support initrd outside kernel linear map Mark Rutland <mark.rutland@arm.com> - 2015-10-06 19:20 +0200
    Re: [PATCH V4 2/3] arm64: support initrd outside kernel linear map Mark Salter <msalter@redhat.com> - 2015-10-06 19:20 +0200
      Re: [PATCH V4 2/3] arm64: support initrd outside kernel linear map Christoffer Dall <christoffer.dall@linaro.org> - 2015-10-08 10:50 +0200
        Re: [PATCH V4 2/3] arm64: support initrd outside kernel linear map yalin wang <yalin.wang2010@gmail.com> - 2015-10-08 11:20 +0200
          Re: [PATCH V4 2/3] arm64: support initrd outside kernel linear map Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-10-08 11:50 +0200

#1240757 — Re: [PATCH V4 2/3] arm64: support initrd outside kernel linear map

FromMark Rutland <mark.rutland@arm.com>
Date2015-10-06 19:20 +0200
SubjectRe: [PATCH V4 2/3] arm64: support initrd outside kernel linear map
Message-ID<qgE49-49R-11@gated-at.bofh.it>
On Tue, Sep 08, 2015 at 12:31:13PM +0100, Mark Rutland wrote:
> Hi Mark,
> 
> On Mon, Aug 17, 2015 at 06:01:06PM +0100, Mark Salter wrote:
> > The use of mem= could leave part or all of the initrd outside of
> > the kernel linear map. This will lead to an error when unpacking
> > the initrd and a probable failure to boot. This patch catches that
> > situation and relocates the initrd to be fully within the linear
> > map.
> 
> With next-20150908, this patch results in a confusing message at boot when not
> using an initrd:
> 
> Moving initrd from [4080000000-407fffffff] to [9fff49000-9fff48fff]
> 
> I think that can be solved by folding in the diff below.

Mark, it looks like this fell by the wayside.

Do you have any objection to this? I'll promote this to it's own patch
if not.

Mark.

> 
> Thanks,
> Mark.
> 
> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> index 6bab21f..2322479 100644
> --- a/arch/arm64/kernel/setup.c
> +++ b/arch/arm64/kernel/setup.c
> @@ -364,6 +364,8 @@ static void __init relocate_initrd(void)
>                 to_free = ram_end - orig_start;
>  
>         size = orig_end - orig_start;
> +       if (!size)
> +               return;
>  
>         /* initrd needs to be relocated completely inside linear mapping */
>         new_start = memblock_find_in_range(0, PFN_PHYS(max_pfn),
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1240762

FromMark Salter <msalter@redhat.com>
Date2015-10-06 19:20 +0200
Message-ID<qgE49-49R-17@gated-at.bofh.it>
In reply to#1240757
On Tue, 2015-10-06 at 18:11 +0100, Mark Rutland wrote:
> On Tue, Sep 08, 2015 at 12:31:13PM +0100, Mark Rutland wrote:
> > Hi Mark,
> > 
> > On Mon, Aug 17, 2015 at 06:01:06PM +0100, Mark Salter wrote:
> > > The use of mem= could leave part or all of the initrd outside of
> > > the kernel linear map. This will lead to an error when unpacking
> > > the initrd and a probable failure to boot. This patch catches that
> > > situation and relocates the initrd to be fully within the linear
> > > map.
> > 
> > With next-20150908, this patch results in a confusing message at boot when not
> > using an initrd:
> > 
> > Moving initrd from [4080000000-407fffffff] to [9fff49000-9fff48fff]
> > 
> > I think that can be solved by folding in the diff below.
> 
> Mark, it looks like this fell by the wayside.
> 
> Do you have any objection to this? I'll promote this to it's own patch
> if not.
> 
> Mark.
> 
> > 
> > Thanks,
> > Mark.
> > 
> > diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> > index 6bab21f..2322479 100644
> > --- a/arch/arm64/kernel/setup.c
> > +++ b/arch/arm64/kernel/setup.c
> > @@ -364,6 +364,8 @@ static void __init relocate_initrd(void)
> >                 to_free = ram_end - orig_start;
> >  
> >         size = orig_end - orig_start;
> > +       if (!size)
> > +               return;
> >  
> >         /* initrd needs to be relocated completely inside linear mapping */
> >         new_start = memblock_find_in_range(0, PFN_PHYS(max_pfn),

Sorry, no. That looks perfectly good to me.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1242081

FromChristoffer Dall <christoffer.dall@linaro.org>
Date2015-10-08 10:50 +0200
Message-ID<qhf3J-6MG-17@gated-at.bofh.it>
In reply to#1240762
On Tue, Oct 06, 2015 at 01:16:52PM -0400, Mark Salter wrote:
> On Tue, 2015-10-06 at 18:11 +0100, Mark Rutland wrote:
> > On Tue, Sep 08, 2015 at 12:31:13PM +0100, Mark Rutland wrote:
> > > Hi Mark,
> > > 
> > > On Mon, Aug 17, 2015 at 06:01:06PM +0100, Mark Salter wrote:
> > > > The use of mem= could leave part or all of the initrd outside of
> > > > the kernel linear map. This will lead to an error when unpacking
> > > > the initrd and a probable failure to boot. This patch catches that
> > > > situation and relocates the initrd to be fully within the linear
> > > > map.
> > > 
> > > With next-20150908, this patch results in a confusing message at boot when not
> > > using an initrd:
> > > 
> > > Moving initrd from [4080000000-407fffffff] to [9fff49000-9fff48fff]
> > > 
> > > I think that can be solved by folding in the diff below.
> > 
> > Mark, it looks like this fell by the wayside.
> > 
> > Do you have any objection to this? I'll promote this to it's own patch
> > if not.
> > 
> > Mark.
> > 
> > > 
> > > Thanks,
> > > Mark.
> > > 
> > > diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> > > index 6bab21f..2322479 100644
> > > --- a/arch/arm64/kernel/setup.c
> > > +++ b/arch/arm64/kernel/setup.c
> > > @@ -364,6 +364,8 @@ static void __init relocate_initrd(void)
> > >                 to_free = ram_end - orig_start;
> > >  
> > >         size = orig_end - orig_start;
> > > +       if (!size)
> > > +               return;
> > >  
> > >         /* initrd needs to be relocated completely inside linear mapping */
> > >         new_start = memblock_find_in_range(0, PFN_PHYS(max_pfn),
> 
> Sorry, no. That looks perfectly good to me.
> 
FYI: I applied these patches to 4.0 (only a trivial conflict on the x86
side) and this fixed an issue for me booting systems with mem=X,
reducing the amount of physical memory available on a system, which
would otherwise cause the system to just silently halt during boot.

Note that this seems to fix even more than it promises, because one of
those systems does not use an initrd, but I'm thinking maybe this fixes
issues with the DT as well?

In any case, I think this may be a good candidate for cc'ing to stable?

Thanks,
-Christoffer
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1242103

Fromyalin wang <yalin.wang2010@gmail.com>
Date2015-10-08 11:20 +0200
Message-ID<qhfwJ-7zW-13@gated-at.bofh.it>
In reply to#1242081
> On Oct 8, 2015, at 16:49, Christoffer Dall <christoffer.dall@linaro.org> wrote:
> 
> On Tue, Oct 06, 2015 at 01:16:52PM -0400, Mark Salter wrote:
>> On Tue, 2015-10-06 at 18:11 +0100, Mark Rutland wrote:
>>> On Tue, Sep 08, 2015 at 12:31:13PM +0100, Mark Rutland wrote:
>>>> Hi Mark,
>>>> 
>>>> On Mon, Aug 17, 2015 at 06:01:06PM +0100, Mark Salter wrote:
>>>>> The use of mem= could leave part or all of the initrd outside of
>>>>> the kernel linear map. This will lead to an error when unpacking
>>>>> the initrd and a probable failure to boot. This patch catches that
>>>>> situation and relocates the initrd to be fully within the linear
>>>>> map.
>>>> 
>>>> With next-20150908, this patch results in a confusing message at boot when not
>>>> using an initrd:
>>>> 
>>>> Moving initrd from [4080000000-407fffffff] to [9fff49000-9fff48fff]
>>>> 
>>>> I think that can be solved by folding in the diff below.
>>> 
>>> Mark, it looks like this fell by the wayside.
>>> 
>>> Do you have any objection to this? I'll promote this to it's own patch
>>> if not.
>>> 
>>> Mark.
>>> 
>>>> 
>>>> Thanks,
>>>> Mark.
>>>> 
>>>> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
>>>> index 6bab21f..2322479 100644
>>>> --- a/arch/arm64/kernel/setup.c
>>>> +++ b/arch/arm64/kernel/setup.c
>>>> @@ -364,6 +364,8 @@ static void __init relocate_initrd(void)
>>>>                to_free = ram_end - orig_start;
>>>> 
>>>>        size = orig_end - orig_start;
>>>> +       if (!size)
>>>> +               return;
>>>> 
>>>>        /* initrd needs to be relocated completely inside linear mapping */
>>>>        new_start = memblock_find_in_range(0, PFN_PHYS(max_pfn),
>> 
>> Sorry, no. That looks perfectly good to me.
>> 
is it also possible to implement it on ARM platforms?
ARM64 platform don’t have HIGH_MEM zone .
but ARM platform have .
i remember boot loader must put init rd  into low memory region,
so if some boot loader put init rd into HIGH men zone
we can also relocate it to low men region ?
then boot loader don’t need care about this ,
and since vmalloc= boot option will change HIGH mem region size,
if we can relocate init rd , boot loader don’t need care about init rd load address,
when change vmalloc= boot options .


Thanks









--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1242133

FromRussell King - ARM Linux <linux@arm.linux.org.uk>
Date2015-10-08 11:50 +0200
Message-ID<qhfZN-88e-31@gated-at.bofh.it>
In reply to#1242103
On Thu, Oct 08, 2015 at 05:18:14PM +0800, yalin wang wrote:
> is it also possible to implement it on ARM platforms?
> ARM64 platform don’t have HIGH_MEM zone .
> but ARM platform have .
> i remember boot loader must put init rd  into low memory region,
> so if some boot loader put init rd into HIGH men zone
> we can also relocate it to low men region ?
> then boot loader don’t need care about this ,
> and since vmalloc= boot option will change HIGH mem region size,
> if we can relocate init rd , boot loader don’t need care about init rd load address,
> when change vmalloc= boot options .

I'd be more inclined to say yes if the kernel wasn't buggering around
passing virtual addresses (initrd_start) of the initrd image around,
but instead used a physical address.  initrd_start must be a lowmem
address.

-- 
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web