linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Hari Bathini <hbathini@linux.vnet.ibm.com>
Cc: linuxppc-dev <linuxppc-dev@ozlabs.org>,
	Ankit Kumar <ankit@linux.vnet.ibm.com>,
	Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com>
Subject: Re: [RESEND, v2] powerpc/fadump: set an upper limit for boot memory size
Date: Mon,  5 Jun 2017 20:21:55 +1000 (AEST)	[thread overview]
Message-ID: <3wh9pq5DCjz9s1h@ozlabs.org> (raw)
In-Reply-To: <149638860805.20682.16651712989980265609.stgit@hbathini.in.ibm.com>

On Fri, 2017-06-02 at 07:30:27 UTC, Hari Bathini wrote:
> By default, 5% of system RAM is reserved for preserving boot memory.
> Alternatively, a user can specify the amount of memory to reserve.
> See Documentation/powerpc/firmware-assisted-dump.txt for details. In
> addition to the memory reserved for preserving boot memory, some more
> memory is reserved, to save HPTE region, CPU state data and ELF core
> headers.
> 
> Memory Reservation during first kernel looks like below:
> 
>   Low memory                                        Top of memory
>   0      boot memory size                                       |
>   |           |                       |<--Reserved dump area -->|
>   V           V                       |   Permanent Reservation V
>   +-----------+----------/ /----------+---+----+-----------+----+
>   |           |                       |CPU|HPTE|  DUMP     |ELF |
>   +-----------+----------/ /----------+---+----+-----------+----+
>         |                                           ^
>         |                                           |
>         \                                           /
>          -------------------------------------------
>           Boot memory content gets transferred to
>           reserved area by firmware at the time of
>           crash
> 
> This implicitly means that the sum of the sizes of boot memory, CPU
> state data, HPTE region, DUMP preserving area and ELF core headers
> can't be greater than the total memory size. But currently, a user is
> allowed to specify any value as boot memory size. So, the above rule
> is violated when a boot memory size around 50% of the total available
> memory is specified. As the kernel is not handling this currently, it
> may lead to undefined behavior. Fix it by setting an upper limit for
> boot memory size to 25% of the total available memory. Also, instead
> of using memblock_end_of_DRAM(), which doesn't take the holes, if any,
> in the memory layout into account, use memblock_phys_mem_size() to
> calculate the percentage of total available memory.
> 
> Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/48a316e350974739235c234430ec0e

cheers

      reply	other threads:[~2017-06-05 10:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02  7:30 [RESEND PATCH v2] powerpc/fadump: set an upper limit for boot memory size Hari Bathini
2017-06-05 10:21 ` Michael Ellerman [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=3wh9pq5DCjz9s1h@ozlabs.org \
    --to=patch-notifications@ellerman.id.au \
    --cc=ankit@linux.vnet.ibm.com \
    --cc=hbathini@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mahesh@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).