grub2-dev: Stack and heap size

1 
1 7 Stack and heap size
1 *********************
1 
1 On emu stack and heap are just normal host OS stack and heap.  Stack is
1 typically 8 MiB although it's OS-dependent.
1 
1    On i386-pc, i386-coreboot, i386-qemu and i386-multiboot the stack is
1 60KiB. All available space between 1MiB and 4GiB marks is part of heap.
1 
1    On *-xen stack is 4MiB. If compiled for x86-64 with GCC 4.4 or later
1 adressable space is unlimited.  When compiled for x86-64 with older GCC
1 version adressable space is limited to 2GiB. When compiling for i386
1 adressable space is limited to 4GiB. All adressable pages except the
1 ones for stack, GRUB binary, special pages and page table are in the
1 heap.
1 
1    On *-efi GRUB uses same stack as EFI. If compiled for x86-64 with GCC
1 4.4 or later adressable space is unlimited.  When compiled for x86-64
1 with older GCC version adressable space is limited to 2GiB. For all
1 other platforms adressable space is limited to 4GiB. GRUB allocates
1 pages from EFI for its heap, at most 1.6 GiB.
1 
1    On i386-ieee1275 and powerpc-ieee1275 GRUB uses same stack as
1 IEEE1275.
1 
1    On i386-ieee1275, GRUB allocates at most 32MiB for its heap.  On
1 powerpc-ieee1275, GRUB allocates up to 1GiB.
1 
1    On sparc64-ieee1275 stack is 256KiB and heap is 2MiB.
1 
1    On mips(el)-qemu_mips and mipsel-loongson stack is 2MiB (everything
1 below GRUB image) and everything above GRUB image (from 2MiB + kernel
1 size) until 256MiB is part of heap.
1 
1    On mips-arc stack is 2MiB (everything below GRUB image) and
1 everything above GRUB image(from 2MiB + kernel size) until 128MiB is
1 part of heap.
1 
1    On mipsel-arc stack is 2MiB (everything below GRUB image which is not
1 part of ARC) and everything above GRUB image (from 7MiB + kernel size)
1 until 256MiB is part of heap.
1 
1    On arm-uboot stack is 256KiB and heap is 2MiB.
1 
1    In short:
1 
1 Platform    Stack              Heap
1 --------------------------------------------------------------------
1 emu         8 MiB              ?
1 i386-pc     60 KiB             < 4 GiB
1 i386-coreboot60 KiB            < 4 GiB
1 i386-multiboot60 KiB           < 4 GiB
1 i386-qemu   60 KiB             < 4 GiB
1 *-efi       ?                  < 1.6 GiB
1 i386-ieee1275?                 < 32 MiB
1 powerpc-ieee1275?              < 1 GiB
1 sparc64-ieee1275256KiB         2 MiB
1 arm-uboot   256KiB             2 MiB
1 mips(el)-qemu_mips2MiB         253 MiB
1 mipsel-loongson2MiB            253 MiB
1 mips-arc    2MiB               125 MiB
1 mipsel-arc  2MiB               248 MiB
1 x86_64-xen  4MiB               unlimited
1 (GCC >=
1 4.4)
1 x86_64-xen  4MiB               < 2GiB
1 (GCC <
1 4.4)
1 i386-xen    4MiB               < 4GiB
1