All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Goel, Sameer" <sgoel@codeaurora.org>
To: AKASHI Takahiro <takahiro.akashi@linaro.org>,
	Geoff Levand <geoff@infradead.org>,
	timur@codeaurora.org, rruigrok@codeaurora.org,
	shankerd@codeaurora.org, kexec@lists.infradead.org
Subject: Re: [PATCH] arm64:kexec: Memstart should not be before the kernel start address
Date: Thu, 4 Aug 2016 17:15:36 -0600	[thread overview]
Message-ID: <49ceb561-af9e-6ffc-926f-05bdb02c0304@codeaurora.org> (raw)
In-Reply-To: <20160804011600.GI7995@linaro.org>

 > In your original email, you said that you cannot place the kernel
 > at the address 0x0. Is this your problem, isn't it?

Not being able to put the kernel at 0 should not be considered a  
restriction. The kernel is not mandated to start at 0 address. The tools  
code was working fine till arm linux developers released a new set of  
changes to get the alignment right for performance reasons.

This change makes sure that he kernel start is 1GB aligned. So, once the  
round doen happens the regions that are reserved memblocks are also seen  
using the iomem query API. The reserved regions should not be considered  
as a part of the kernel RAM.

 > If so, you can explicitly specify the start address with  
"crashkernel=X@Y"
 > parameter. Or we might better add "mem-min" support as I said.

I agree that the above options will solve this case.

As I mentioned before that not starting at address 0x0 should not be  
considered a limitation.So, default case of reuse-cmdline should work as  
is.
In this code we are trying to find where the kernel code start is. Based  
on this info we can always clearly determine the kernel ram start. This  
would not be a limitation.

Any system ram region located before kernel ram should not be used  
unless explicitly reclaimed or added.

Thanks,
Sameer


On 8/3/2016 7:16 PM, AKASHI Takahiro wrote:
> On Wed, Aug 03, 2016 at 05:44:30PM -0600, Goel, Sameer wrote:
>> Hi,
>> I am using vmlinux in this case. Usually the kernel code start is at
>> a 2M alignment from the System RAM start address. Since, kexec
>> default options were not loading the image at the right address
>> (same as the original kernel) and the API used to get iomem listing
>> does not differentiate between the reserved and memblock addresses,
>
> In your original email, you said that you cannot place the kernel
> at the address 0x0. Is this your problem, isn't it?
>
> If so, you can explicitly specify the start address with "crashkernel=X@Y"
> parameter. Or we might better add "mem-min" support as I said.
>
>> I recommended that we look for the Kernel Code segment and round
>> this down to get the right start address.
>> The above should not impact any current functionality or ignore any
>> ram regions when booting the patched kernel.
>
> no need to impose such a unnecessary restriction.
>
> Thanks,
> -Takahiro AKASHI
>
>> I will report the patch on V2.
>> Thanks,
>> Sameer
>>
>>
>> On 8/1/2016 7:25 PM, AKASHI Takahiro wrote:
>>> On Mon, Aug 01, 2016 at 12:31:50PM -0700, Geoff Levand wrote:
>>>> Hi,
>>>>
>>>> On Fri, 2016-07-29 at 16:58 -0600, Goel, Sameer wrote:
>>>>> In our setup we cannot place the kernel starting at 0 address. So, it it
>>>>> placed at the first valid aligned address after placing the reserved
>>>>> regions in memory.
>>>>>
>>>>> The code from the change (https://patchwork.kernel.org/patch/8325221/)
>>>>> adds the reserved regions to iomem ranges. So, when the kexec tool is
>>>>> run it picks up the first reserved region as the start address for
>>>>> physical ram. When the kernel is loaded at this address, it fails to boot.
>>>>>
>>>>> So, I have put in a filter in the code that would pick up the right
>>>>> address of the primary kernel after this change was introduced.
>>>
>>> You're using Image, not vmlinux, right?
>>> I don't think that it's a good idea to add this sort of restriction
>>> because it is very system-specific.
>>> You'd better use "--mem-min=" parameter in your case.
>>> (In fact, this option doesn't work on the current arm64 port of kexec-tools,
>>> though.)
>>>
>>> Thanks,
>>> -Takahiro AKASHI
>>>
>>>>> Thanks,
>>>>> Sameer
>>>>
>>>>
>>>> Your patch no longer applies.  Please rebase it to my
>>>> for-merge-arm64-v2 branch and re-post.
>>>>
>>>> -Geoff
>>>>
>>>
>>> _______________________________________________
>>> kexec mailing list
>>> kexec@lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/kexec
>>>
>>
>> --
>> Qualcomm Innovation Center, Inc.
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>> a Linux Foundation Collaborative Project.
>

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      reply	other threads:[~2016-08-04 23:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26 22:14 [PATCH] arm64:kexec: Memstart should not be before the kernel start address Sameer Goel
2016-04-26 23:58 ` Geoff Levand
2016-05-03 15:12   ` Goel, Sameer
2016-06-10 16:41     ` Geoff Levand
2016-07-29 22:58       ` Goel, Sameer
2016-08-01 19:31         ` Geoff Levand
2016-08-02  1:25           ` AKASHI Takahiro
2016-08-03 23:44             ` Goel, Sameer
2016-08-04  1:16               ` AKASHI Takahiro
2016-08-04 23:15                 ` Goel, Sameer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49ceb561-af9e-6ffc-926f-05bdb02c0304@codeaurora.org \
    --to=sgoel@codeaurora.org \
    --cc=geoff@infradead.org \
    --cc=kexec@lists.infradead.org \
    --cc=rruigrok@codeaurora.org \
    --cc=shankerd@codeaurora.org \
    --cc=takahiro.akashi@linaro.org \
    --cc=timur@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.