All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robbie Harwood <rharwood@redhat.com>
To: Stefan Berger <stefanb@linux.ibm.com>,
	grub-devel@gnu.org, dkiper@net-space.pl
Cc: development@efficientek.com, dja@axtens.net,
	sudhakar@linux.ibm.com, nasastry@in.ibm.com,
	avnish@imap.linux.ibm.com, Stefan Berger <stefanb@linux.ibm.com>
Subject: Re: [PATCH v4 3/6] ieee1275: support runtime memory claiming
Date: Thu, 16 Feb 2023 09:27:59 -0500	[thread overview]
Message-ID: <jlg4jrlsn0w.fsf@redhat.com> (raw)
In-Reply-To: <20230206150325.3756840-4-stefanb@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 2501 bytes --]

Stefan Berger <stefanb@linux.ibm.com> writes:

> From: Daniel Axtens <dja@axtens.net>
>
> On powerpc-ieee1275, we are running out of memory trying to verify
> anything. This is because:
>
>  - we have to load an entire file into memory to verify it. This is
>    difficult to change with appended signatures.
>  - We only have 32MB of heap.
>  - Distro kernels are now often around 30MB.
>
> So we want to be able to claim more memory from OpenFirmware for our heap
> at runtime.
>
> There are some complications:
>
>  - The grub mm code isn't the only thing that will make claims on
>    memory from OpenFirmware:
>
>     * PFW/SLOF will have claimed some for their own use.
>
>     * The ieee1275 loader will try to find other bits of memory that we
>       haven't claimed to place the kernel and initrd when we go to boot.
>
>     * Once we load Linux, it will also try to claim memory. It claims
>       memory without any reference to /memory/available, it just starts
>       at min(top of RMO, 768MB) and works down. So we need to avoid this
>       area. See arch/powerpc/kernel/prom_init.c as of v5.11.
>
>  - The smallest amount of memory a ppc64 KVM guest can have is 256MB.
>    It doesn't work with distro kernels but can work with custom kernels.
>    We should maintain support for that. (ppc32 can boot with even less,
>    and we shouldn't break that either.)
>
>  - Even if a VM has more memory, the memory OpenFirmware makes available
>    as Real Memory Area can be restricted. Even with our CAS work, an LPAR
>    on a PowerVM box is likely to have only 512MB available to OpenFirmware
>    even if it has many gigabytes of memory allocated.
>
> What should we do?
>
> We don't know in advance how big the kernel and initrd are going to be,
> which makes figuring out how much memory we can take a bit tricky.
>
> To figure out how much memory we should leave unused, I looked at:
>
>  - an Ubuntu 20.04.1 ppc64le pseries KVM guest:
>     vmlinux: ~30MB
>     initrd:  ~50MB
>
>  - a RHEL8.2 ppc64le pseries KVM guest:
>     vmlinux: ~30MB
>     initrd:  ~30MB
>
> So to give us a little wriggle room, I think we want to leave at least
> 128MB for the loader to put vmlinux and initrd in memory and leave Linux
> with space to satisfy its early allocations.
>
> Allow other space to be allocated at runtime.
>
> Tested-by: Stefan Berger <stefanb@linux.ibm.com>
> Signed-off-by: Daniel Axtens <dja@axtens.net>

Reviewed-by: Robbie Harwood <rharwood@redhat.com>

Be well,
--Robbie

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  parent reply	other threads:[~2023-02-16 14:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 15:03 [PATCH v4 0/6] Dynamic allocation of memory regions and IBM vTPM 2.0 Stefan Berger
2023-02-06 15:03 ` [PATCH v4 1/6] ieee1275: request memory with ibm, client-architecture-support Stefan Berger
2023-02-06 15:03 ` [PATCH v4 2/6] ieee1275: drop len -= 1 quirk in heap_init Stefan Berger
2023-02-16 14:27   ` Robbie Harwood
2023-02-06 15:03 ` [PATCH v4 3/6] ieee1275: support runtime memory claiming Stefan Berger
2023-02-06 20:09   ` Robbie Harwood
2023-02-06 20:59     ` Stefan Berger
2023-02-16 14:27   ` Robbie Harwood [this message]
2023-02-06 15:03 ` [PATCH v4 4/6] ieee1275: implement vec5 for cas negotiation Stefan Berger
2023-02-06 15:03 ` [PATCH v4 5/6] Add memtool module with memory allocation stress-test Stefan Berger
2023-02-06 15:03 ` [PATCH v4 6/6] ibmvtpm: Add support for trusted boot using a vTPM 2.0 Stefan Berger
2023-02-06 20:12   ` Robbie Harwood
2023-02-13 12:58 ` [PATCH v4 0/6] Dynamic allocation of memory regions and IBM " Nageswara R Sastry
2023-02-28 17:50 ` Robbie Harwood
2023-03-01 13:11   ` Daniel Kiper

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=jlg4jrlsn0w.fsf@redhat.com \
    --to=rharwood@redhat.com \
    --cc=avnish@imap.linux.ibm.com \
    --cc=development@efficientek.com \
    --cc=dja@axtens.net \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=nasastry@in.ibm.com \
    --cc=stefanb@linux.ibm.com \
    --cc=sudhakar@linux.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 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.