grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 00/10] ppc64: Restrict memory allocations for kernel and i


From: Daniel Kiper
Subject: Re: [PATCH v7 00/10] ppc64: Restrict memory allocations for kernel and initrd
Date: Thu, 30 Nov 2023 14:44:31 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Nov 27, 2023 at 06:58:43AM -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 and i386.

This time the patch set breaks SPARC build... :-( I am attaching the
patch which fixes it and then all builds pass. Please merge the fix
into your patch set and resend it.

Daniel

diff --git a/grub-core/kern/ieee1275/ieee1275.c 
b/grub-core/kern/ieee1275/ieee1275.c
index fef3ccf1a..36ca2dbfc 100644
--- a/grub-core/kern/ieee1275/ieee1275.c
+++ b/grub-core/kern/ieee1275/ieee1275.c
@@ -590,8 +590,9 @@ grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, 
unsigned int align,
     *result = args.base;
   if (args.base == IEEE1275_CELL_INVALID)
     return -1;
-  grub_dprintf ("mmap", "CLAIMED: 0x%x (%d MiB)  size: %d MiB\n",
-               args.base, args.base >> 20, ALIGN_UP(size, 1 << 20) >> 20);
+  grub_dprintf ("mmap", "CLAIMED: 0x%" PRIxGRUB_IEEE1275_CELL_T " (%"
+               PRIuGRUB_IEEE1275_CELL_T " MiB)  size: %" PRIuGRUB_SIZE " 
MiB\n",
+               args.base, args.base >> 20, ALIGN_UP (size, 1 << 20) >> 20);
   return 0;
 }
 
diff --git a/include/grub/powerpc/ieee1275/ieee1275.h 
b/include/grub/powerpc/ieee1275/ieee1275.h
index 3c7683fad..4eb207018 100644
--- a/include/grub/powerpc/ieee1275/ieee1275.h
+++ b/include/grub/powerpc/ieee1275/ieee1275.h
@@ -25,4 +25,7 @@
 #define GRUB_IEEE1275_CELL_SIZEOF 4
 typedef grub_uint32_t grub_ieee1275_cell_t;
 
+#define PRIxGRUB_IEEE1275_CELL_T       PRIxGRUB_UINT32_T
+#define PRIuGRUB_IEEE1275_CELL_T       PRIuGRUB_UINT32_T
+
 #endif /* ! GRUB_IEEE1275_MACHINE_HEADER */
diff --git a/include/grub/sparc64/ieee1275/ieee1275.h 
b/include/grub/sparc64/ieee1275/ieee1275.h
index 4b18468d8..ccc71aac6 100644
--- a/include/grub/sparc64/ieee1275/ieee1275.h
+++ b/include/grub/sparc64/ieee1275/ieee1275.h
@@ -25,6 +25,9 @@
 #define GRUB_IEEE1275_CELL_SIZEOF 8
 typedef grub_uint64_t grub_ieee1275_cell_t;
 
+#define PRIxGRUB_IEEE1275_CELL_T       PRIxGRUB_UINT64_T
+#define PRIuGRUB_IEEE1275_CELL_T       PRIuGRUB_UINT64_T
+
 /* Encoding of 'mode' argument to grub_ieee1275_map_physical() */
 #define IEEE1275_MAP_WRITE     0x0001 /* Writable */
 #define IEEE1275_MAP_READ      0x0002 /* Readable */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]