Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: James Morse <james.morse@arm.com>
To: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: linux-efi@vger.kernel.org, ard.biesheuvel@linaro.org,
	jhugo@codeaurora.org, Bhupesh Sharma <bhsharma@redhat.com>,
	tbaicar@codeaurora.org, kexec@lists.infradead.org,
	Bhupesh SHARMA <bhupesh.linux@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC] arm64: extra entries in /proc/iomem for kexec
Date: Thu, 26 Apr 2018 15:26:29 +0100	[thread overview]
Message-ID: <4ed4afed-06a4-0079-8bf9-5fb31601f180@arm.com> (raw)
In-Reply-To: <20180426074043.GD21197@linaro.org>

Hi Akashi,

On 26/04/18 08:40, AKASHI Takahiro wrote:
> On Wed, Apr 25, 2018 at 02:22:07PM +0100, James Morse wrote:
>> On 25/04/18 10:20, AKASHI Takahiro wrote:
>>> On Tue, Apr 24, 2018 at 05:08:57PM +0100, James Morse wrote:
>>>> If we squash the memblock_reserved() stuff down so it appears as a top level
>>>> 'reserved' region too, I don't think we do.
>>>
>>> If I correctly understand, you're talking about my format (E).
>>> As I said, it will fix the issue without modifying user-space, but
>>>
>>> || This does not only look quite noisy but also ignores the fact that
>>> || reserved regions are part of System RAM (or memblock.memory).
>>
>> I agree its noisy, there are significantly more 'reserved' areas, but these are
>> all either nomap or memblock_reserved().
>>
>> Why does it matter if a reserved-region is nomap or memblock_reserved()? Any new
>> kernel will learn the difference from the EFI memory map and make its own decisions.
> 
> Yeah, kernel can do (though kernel won't look though system resources list
> for this purpose anyway), what about kexec-like user applications?
> It may want to seek /proc/iomem to identify all the *usable* memory on
> the system, that is "System RAM", but doesn't care whether some range is
> reserved or not (for some reason) yet does care !NOMAP.

Do you have an example application?
This would have to be a program digging in /dev/mem where it wants to touch
memory the kernel has reserved, but doesn't want to receive a signal if it
touches memory that's nomap. This doesn't seem a likely use-case.

We could change the names for the memblock_reserved()/nomap entries, but as
kexec-tools spots 'reserved' and almost does the right thing, I kept it as it is.


>>>> This prevents the efi-memory-map
>>>> being overwritten on kernels since kexec was merged.
>>>>
>>>> Its horribly fiddly to do this. The kernel code/data are special reserved
>>>> regions that we already describe as a subset of system-ram, even though they are
>>>> both also fragments of a bigger memblock_reserved() block.
>>>
>>> Actually, we don't have to avoid kernel code/data regions as copying
>>> loaded data to the final destinations will be done at the very end of kexec.
>>
>> For kexec yes, but that is the existing format of the file, which we shouldn't
>> change, otherwise we break something else.
> 
> One trivial downside in this approach is that a secondary kernel will be
> loaded at an address different from the one of current kernel.
> While it is sane, it looks a bit odd that, every time kexec'ed, a new> kernel (code/data) is located back and forth :)

Yes, but all versions of the kernel that support kexec will be quite happy with
this. The memory below the kernel could be re-used since KASLR support was
merged before kexec.

I was more worried that the extra fragmentation would cause kexec-tools to stop
searching early, as it seems to have a #defined'd limit of how much of that file
it will parse. But, this would be an existing bug, because there could be many
nomap regions up-front before any large-enough chunk of system-ram appears.


Thanks,

James

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

      reply	other threads:[~2018-04-26 14:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14  8:29 [RFC] arm64: extra entries in /proc/iomem for kexec AKASHI Takahiro
2018-03-14  8:39 ` Ard Biesheuvel
2018-03-15  4:41   ` AKASHI Takahiro
2018-03-15  7:33     ` Ard Biesheuvel
2018-03-19 19:48 ` Bhupesh Sharma
2018-03-27 10:16   ` AKASHI Takahiro
2018-03-27 13:32     ` James Morse
2018-04-02  1:53       ` AKASHI Takahiro
2018-04-05  2:42         ` AKASHI Takahiro
2018-04-12 16:01           ` James Morse
2018-04-16 10:08             ` AKASHI Takahiro
2018-04-24 16:08               ` James Morse
2018-04-25  9:20                 ` AKASHI Takahiro
2018-04-25 13:22                   ` James Morse
2018-04-26  7:40                     ` AKASHI Takahiro
2018-04-26 14:26                       ` James Morse [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=4ed4afed-06a4-0079-8bf9-5fb31601f180@arm.com \
    --to=james.morse@arm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bhsharma@redhat.com \
    --cc=bhupesh.linux@gmail.com \
    --cc=jhugo@codeaurora.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=takahiro.akashi@linaro.org \
    --cc=tbaicar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox