grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Kiper <dkiper@net-space.pl>
To: Stefan Berger <stefanb@linux.ibm.com>
Cc: The development of GNU GRUB <grub-devel@gnu.org>,
	hbathini@linux.ibm.com, pavrampu@in.ibm.com, mpe@ellerman.id.au,
	cpscherr@us.ibm.com, mahesh@linux.ibm.com,
	sourabhjain@linux.ibm.com, avnish.chouhan@ibm.com
Subject: Re: [PATCH v6 00/10] ppc64: Restrict memory allocations for kernel and initrd
Date: Fri, 24 Nov 2023 22:31:00 +0100	[thread overview]
Message-ID: <20231124213100.kgalwoybiagst6zq@tomti.i.net-space.pl> (raw)
In-Reply-To: <4afcfa7c-02b3-4970-9dfa-e8e4bae8fc37@linux.ibm.com>

On Fri, Nov 24, 2023 at 02:10:05PM -0500, Stefan Berger wrote:
> On 11/23/23 11:38, Daniel Kiper wrote:
> > On Mon, Nov 20, 2023 at 09:49:57AM -0500, Stefan Berger wrote:
> > > This series of patches converts the PowerPC ieee1275 memory allocator
> > > for kernel and initrd to use the (PowerPC) regions_claim memory allocator
> > > that takes into account memory regions that are not allowed to be used,
> > > such as the gap between 640MB and 768MB as well as memory regions beyond
> > > an address in case an fadump is present. Otherwise those two could be
> > > loaded into restricted memory regions and either cause a crash or
> > > corruption of the fadump.
> > >
> > > I adjusted the kernel and initrd load in loader/powerpc/ieee1275 to use the
> > > new memory allocator only on PowerVM and PowerKVM since this code is shared
> > > with other platforms, such as old PowerMACs.
> >
> > Sadly your patch set breaks at least i386/ieee1275 build...
> >
> >    ./configure --target=i386 --with-platform=ieee1275 ...
> >    make
> >
> >    kern/ieee1275/cmain.c: In function ‘grub_ieee1275_find_options’:
> >    kern/ieee1275/cmain.c:199:31: error: ‘GRUB_IEEE1275_FLAG_POWER_KVM’ undeclared (first use in this function)
> >           grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_POWER_KVM);
> >                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > ... or...
> >
> >    kern/ieee1275/init.c:322:1: error: no previous prototype for ‘grub_regions_claim’ [-Werror=missing-prototypes]
> >      322 | grub_regions_claim (grub_uint64_t addr, grub_uint64_t len,
> >          | ^~~~~~~~~~~~~~~~~~
> >    kern/ieee1275/init.c: In function ‘grub_regions_claim’:
> >    kern/ieee1275/init.c:510:10: error: invalid use of undefined type ‘struct regions_claim_request’
> >      510 |   if (rcr->align)
> >          |          ^~
> >    In file included from ../include/grub/dl.h:29,
> >                     from kern/ieee1275/init.c:23:
> >    kern/ieee1275/init.c:512:53: error: invalid use of undefined type ‘struct regions_claim_request’
> >      512 |       grub_uint64_t align_addr = ALIGN_UP (addr, rcr->align);
> >          |                                                     ^~
> >    ../include/grub/misc.h:31:37: note: in definition of macro ‘ALIGN_UP’
> >       31 |         (((addr) + (typeof (addr)) (align) - 1) & ~((typeof (addr)) (align) - 1))
> >          |                                     ^~~~~
> >    ...
> >
> > Please fix these issues...
>
> This required two fixes:
> - move include/grub/powerpc/ieee1275/alloc.h to
> include/grub/ieee1275/alloc.h
> - move the 2 new #defines for POWER_VM and KVM out of #ifdef __powerpc__

I think we need some more #ifdef __powerpc__ instead, e.g. around
grub_ieee1275_set_flag(GRUB_IEEE1275_FLAG_POWER_KVM).

>  Can I keep your Reviewed-by tags?

If changes are not that big and you provide git range-diff then yes.

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

      reply	other threads:[~2023-11-24 21:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 14:49 [PATCH v6 00/10] ppc64: Restrict memory allocations for kernel and initrd Stefan Berger
2023-11-20 14:49 ` [PATCH v6 01/10] kern/ieee1275/init: ppc64: Introduce a request for regions_claim Stefan Berger
2023-11-20 14:49 ` [PATCH v6 02/10] kern/ieee1275/init: ppc64: Decide by request whether to initialize region Stefan Berger
2023-11-20 14:50 ` [PATCH v6 03/10] kern/ieee1275/init: ppc64: Return allocated address using context Stefan Berger
2023-11-20 14:50 ` [PATCH v6 04/10] kern/ieee1275/init: ppc64: Add support for alignment requirements Stefan Berger
2023-11-20 14:50 ` [PATCH v6 05/10] kern/ieee1275/init: ppc64: Rename regions_claim to grub_regions_claim Stefan Berger
2023-11-20 14:50 ` [PATCH v6 06/10] kern/ieee1275/cmain: ppc64: Introduce flags to identify KVM and Power VM Stefan Berger
2023-11-20 14:50 ` [PATCH v6 07/10] loader/powerpc/ieee1275: Use new allocation function for kernel and initrd Stefan Berger
2023-11-20 14:50 ` [PATCH v6 08/10] kern/ieee1275/ieee1275: debug: Display successful memory claims Stefan Berger
2023-11-20 14:50 ` [PATCH v6 09/10] kern/ieee1275/init: ppc64: Fix a comment Stefan Berger
2023-11-21 15:48   ` Daniel Kiper
2023-11-20 14:50 ` [PATCH v6 10/10] kern/ieee1275/init: ppc64: Display upper_mem_limit for debugging Stefan Berger
2023-11-21 15:50   ` Daniel Kiper
2023-11-23 16:38 ` [PATCH v6 00/10] ppc64: Restrict memory allocations for kernel and initrd Daniel Kiper
2023-11-24 19:10   ` Stefan Berger
2023-11-24 21:31     ` Daniel Kiper [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=20231124213100.kgalwoybiagst6zq@tomti.i.net-space.pl \
    --to=dkiper@net-space.pl \
    --cc=avnish.chouhan@ibm.com \
    --cc=cpscherr@us.ibm.com \
    --cc=grub-devel@gnu.org \
    --cc=hbathini@linux.ibm.com \
    --cc=mahesh@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=pavrampu@in.ibm.com \
    --cc=sourabhjain@linux.ibm.com \
    --cc=stefanb@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 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 read-only IMAP folder(s) and NNTP newsgroup(s).