diff --git a/0177-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch b/0175-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch similarity index 100% rename from 0177-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch rename to 0175-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch diff --git a/0175-ieee1275-claim-more-memory.patch b/0175-ieee1275-claim-more-memory.patch deleted file mode 100644 index 6ec319b..0000000 --- a/0175-ieee1275-claim-more-memory.patch +++ /dev/null @@ -1,252 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Daniel Axtens -Date: Wed, 15 Apr 2020 23:28:29 +1000 -Subject: [PATCH] ieee1275: claim more memory - -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 - extremely difficult to change with appended signatures. - - We only have 32MB of heap. - - Distro kernels are now often around 30MB. - -So we want to claim more memory from OpenFirmware for our heap. - -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. A freshly created LPAR on a - PowerVM machine is likely to have only 256MB available to OpenFirmware - even if it has many gigabytes of memory allocated. - -EFI systems will attempt to allocate 1/4th of the available memory, -clamped to between 1M and 1600M. That seems like a good sort of -approach, we just need to figure out if 1/4 is the right fraction -for us. - -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 - -Ubuntu VMs struggle to boot with just 256MB under SLOF. -RHEL likewise has a higher minimum supported memory figure. -So lets first consider a distro kernel and 512MB of addressible memory. -(This is the default case for anything booting under PFW.) Say we lose -131MB to PFW (based on some tests). This leaves us 381MB. 1/4 of 381MB -is ~95MB. That should be enough to verify a 30MB vmlinux and should -leave plenty of space to load Linux and the initrd. - -If we consider 256MB of RMA under PFW, we have just 125MB remaining. 1/4 -of that is a smidge under 32MB, which gives us very poor odds of verifying -a distro-sized kernel. However, if we need 80MB just to put the kernel -and initrd in memory, we can't claim any more than 45MB anyway. So 1/4 -will do. We'll come back to this later. - -grub is always built as a 32-bit binary, even if it's loading a ppc64 -kernel. So we can't address memory beyond 4GB. This gives a natural cap -of 1GB for powerpc-ieee1275. - -Also apply this 1/4 approach to i386-ieee1275, but keep the 32MB cap. - -make check still works for both i386 and powerpc and I've booted -powerpc grub with this change under SLOF and PFW. - -Signed-off-by: Daniel Axtens ---- - grub-core/kern/ieee1275/init.c | 81 +++++++++++++++++++++++++++++++++--------- - docs/grub-dev.texi | 6 ++-- - 2 files changed, 69 insertions(+), 18 deletions(-) - -diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 0dcd114ce5..c61d91a028 100644 ---- a/grub-core/kern/ieee1275/init.c -+++ b/grub-core/kern/ieee1275/init.c -@@ -46,11 +46,12 @@ - #endif - #include - --/* The maximum heap size we're going to claim */ -+/* The maximum heap size we're going to claim. Not used by sparc. -+ We allocate 1/4 of the available memory under 4G, up to this limit. */ - #ifdef __i386__ - #define HEAP_MAX_SIZE (unsigned long) (64 * 1024 * 1024) --#else --#define HEAP_MAX_SIZE (unsigned long) (32 * 1024 * 1024) -+#else // __powerpc__ -+#define HEAP_MAX_SIZE (unsigned long) (1 * 1024 * 1024 * 1024) - #endif - - extern char _end[]; -@@ -147,16 +148,45 @@ grub_claim_heap (void) - + GRUB_KERNEL_MACHINE_STACK_SIZE), 0x200000); - } - #else --/* Helper for grub_claim_heap. */ -+/* Helper for grub_claim_heap on powerpc. */ -+static int -+heap_size (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, -+ void *data) -+{ -+ grub_uint32_t total = *(grub_uint32_t *)data; -+ -+ if (type != GRUB_MEMORY_AVAILABLE) -+ return 0; -+ -+ /* Do not consider memory beyond 4GB */ -+ if (addr > 0xffffffffUL) -+ return 0; -+ -+ if (addr + len > 0xffffffffUL) -+ len = 0xffffffffUL - addr; -+ -+ total += len; -+ *(grub_uint32_t *)data = total; -+ -+ return 0; -+} -+ - static int - heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, - void *data) - { -- unsigned long *total = data; -+ grub_uint32_t total = *(grub_uint32_t *)data; - - if (type != GRUB_MEMORY_AVAILABLE) - return 0; - -+ /* Do not consider memory beyond 4GB */ -+ if (addr > 0xffffffffUL) -+ return 0; -+ -+ if (addr + len > 0xffffffffUL) -+ len = 0xffffffffUL - addr; -+ - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM)) - { - if (addr + len <= 0x180000) -@@ -170,10 +200,6 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, - } - len -= 1; /* Required for some firmware. */ - -- /* Never exceed HEAP_MAX_SIZE */ -- if (*total + len > HEAP_MAX_SIZE) -- len = HEAP_MAX_SIZE - *total; -- - /* In theory, firmware should already prevent this from happening by not - listing our own image in /memory/available. The check below is intended - as a safeguard in case that doesn't happen. However, it doesn't protect -@@ -185,6 +211,18 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, - len = 0; - } - -+ /* If this block contains 0x30000000 (768MB), do not claim below that. -+ Linux likes to claim memory at min(RMO top, 768MB) and works down -+ without reference to /memory/available. */ -+ if ((addr < 0x30000000) && ((addr + len) > 0x30000000)) -+ { -+ len = len - (0x30000000 - addr); -+ addr = 0x30000000; -+ } -+ -+ if (len > total) -+ len = total; -+ - if (len) - { - grub_err_t err; -@@ -193,10 +231,12 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, - if (err) - return err; - grub_mm_init_region ((void *) (grub_addr_t) addr, len); -+ total -= len; - } - -- *total += len; -- if (*total >= HEAP_MAX_SIZE) -+ *(grub_uint32_t *)data = total; -+ -+ if (total == 0) - return 1; - - return 0; -@@ -205,13 +245,22 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, - static void - grub_claim_heap (void) - { -- unsigned long total = 0; -+ grub_uint32_t total = 0; - - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM)) -- heap_init (GRUB_IEEE1275_STATIC_HEAP_START, GRUB_IEEE1275_STATIC_HEAP_LEN, -- 1, &total); -- else -- grub_machine_mmap_iterate (heap_init, &total); -+ { -+ heap_init (GRUB_IEEE1275_STATIC_HEAP_START, GRUB_IEEE1275_STATIC_HEAP_LEN, -+ 1, &total); -+ return; -+ } -+ -+ grub_machine_mmap_iterate (heap_size, &total); -+ -+ total = total / 4; -+ if (total > HEAP_MAX_SIZE) -+ total = HEAP_MAX_SIZE; -+ -+ grub_machine_mmap_iterate (heap_init, &total); - } - #endif - -diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi -index 19f708ee66..90083772c8 100644 ---- a/docs/grub-dev.texi -+++ b/docs/grub-dev.texi -@@ -1047,7 +1047,9 @@ space is limited to 4GiB. GRUB allocates pages from EFI for its heap, at most - 1.6 GiB. - - On i386-ieee1275 and powerpc-ieee1275 GRUB uses same stack as IEEE1275. --It allocates at most 32MiB for its heap. -+ -+On i386-ieee1275, GRUB allocates at most 32MiB for its heap. On -+powerpc-ieee1275, GRUB allocates up to 1GiB. - - On sparc64-ieee1275 stack is 256KiB and heap is 2MiB. - -@@ -1075,7 +1077,7 @@ In short: - @item i386-qemu @tab 60 KiB @tab < 4 GiB - @item *-efi @tab ? @tab < 1.6 GiB - @item i386-ieee1275 @tab ? @tab < 32 MiB --@item powerpc-ieee1275 @tab ? @tab < 32 MiB -+@item powerpc-ieee1275 @tab ? @tab < 1 GiB - @item sparc64-ieee1275 @tab 256KiB @tab 2 MiB - @item arm-uboot @tab 256KiB @tab 2 MiB - @item mips(el)-qemu_mips @tab 2MiB @tab 253 MiB diff --git a/0178-ieee1275-ofdisk-retry-on-open-failure.patch b/0176-ieee1275-ofdisk-retry-on-open-failure.patch similarity index 100% rename from 0178-ieee1275-ofdisk-retry-on-open-failure.patch rename to 0176-ieee1275-ofdisk-retry-on-open-failure.patch diff --git a/0176-ieee1275-request-memory-with-ibm-client-architecture.patch b/0176-ieee1275-request-memory-with-ibm-client-architecture.patch deleted file mode 100644 index 4f3ab90..0000000 --- a/0176-ieee1275-request-memory-with-ibm-client-architecture.patch +++ /dev/null @@ -1,268 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Daniel Axtens -Date: Fri, 16 Apr 2021 11:48:46 +1000 -Subject: [PATCH] ieee1275: request memory with ibm,client-architecture-support - -On PowerVM, the first time we boot a Linux partition, we may only get -256MB of real memory area, even if the partition has more memory. - -This isn't really enough. Fortunately, the Power Architecture Platform -Reference (PAPR) defines a method we can call to ask for more memory. -This is part of the broad and powerful ibm,client-architecture-support -(CAS) method. - -CAS can do an enormous amount of things on a PAPR platform: as well as -asking for memory, you can set the supported processor level, the interrupt -controller, hash vs radix mmu, and so on. We want to touch as little of -this as possible because we don't want to step on the toes of the future OS. - -If: - - - we are running under what we think is PowerVM (compatible property of / - begins with "IBM"), and - - - the full amount of RMA is less than 512MB (as determined by the reg - property of /memory) - -then call CAS as follows: (refer to the Linux on Power Architecture -Reference, LoPAR, which is public, at B.5.2.3): - - - Use the "any" PVR value and supply 2 option vectors. - - - Set option vector 1 (PowerPC Server Processor Architecture Level) - to "ignore". - - - Set option vector 2 with default or Linux-like options, including a - min-rma-size of 512MB. - -This will cause a CAS reboot and the partition will restart with 512MB -of RMA. Grub will notice the 512MB and not call CAS again. - -(A partition can be configured with only 256MB of memory, which would -mean this request couldn't be satisfied, but PFW refuses to load with -only 256MB of memory, so it's a bit moot. SLOF will run fine with 256MB, -but we will never call CAS under qemu/SLOF because /compatible won't -begin with "IBM".) - -One of the first things Linux does while still running under OpenFirmware -is to call CAS with a much fuller set of options (including asking for -512MB of memory). This includes a much more restrictive set of PVR values -and processor support levels, and this will induce another reboot. On this -reboot grub will again notice the higher RMA, and not call CAS. We will get -to Linux, Linux will call CAS but because the values are now set for Linux -this will not induce another CAS reboot and we will finally boot. - -On all subsequent boots, everything will be configured with 512MB of RMA -and all the settings Linux likes, so there will be no further CAS reboots. - -(phyp is super sticky with the RMA size - it persists even on cold boots. -So if you've ever booted Linux in a partition, you'll probably never have -grub call CAS. It'll only ever fire the first time a partition loads grub, -or if you deliberately lower the amount of memory your partition has below -512MB.) - -Signed-off-by: Daniel Axtens ---- - grub-core/kern/ieee1275/cmain.c | 3 + - grub-core/kern/ieee1275/init.c | 144 ++++++++++++++++++++++++++++++++++++++- - include/grub/ieee1275/ieee1275.h | 8 ++- - 3 files changed, 152 insertions(+), 3 deletions(-) - -diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c -index 04df9d2c66..6435628ec5 100644 ---- a/grub-core/kern/ieee1275/cmain.c -+++ b/grub-core/kern/ieee1275/cmain.c -@@ -127,6 +127,9 @@ grub_ieee1275_find_options (void) - break; - } - } -+ -+ if (grub_strncmp (tmp, "IBM,", 4) == 0) -+ grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY); - } - - if (is_smartfirmware) -diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index c61d91a028..9704715c83 100644 ---- a/grub-core/kern/ieee1275/init.c -+++ b/grub-core/kern/ieee1275/init.c -@@ -242,6 +242,135 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, - return 0; - } - -+/* How much memory does OF believe it has? (regardless of whether -+ it's accessible or not) */ -+static grub_err_t -+grub_ieee1275_total_mem (grub_uint64_t *total) -+{ -+ grub_ieee1275_phandle_t root; -+ grub_ieee1275_phandle_t memory; -+ grub_uint32_t reg[4]; -+ grub_ssize_t reg_size; -+ grub_uint32_t address_cells = 1; -+ grub_uint32_t size_cells = 1; -+ grub_uint64_t size; -+ -+ /* If we fail to get to the end, report 0. */ -+ *total = 0; -+ -+ /* Determine the format of each entry in `reg'. */ -+ grub_ieee1275_finddevice ("/", &root); -+ grub_ieee1275_get_integer_property (root, "#address-cells", &address_cells, -+ sizeof address_cells, 0); -+ grub_ieee1275_get_integer_property (root, "#size-cells", &size_cells, -+ sizeof size_cells, 0); -+ -+ if (size_cells > address_cells) -+ address_cells = size_cells; -+ -+ /* Load `/memory/reg'. */ -+ if (grub_ieee1275_finddevice ("/memory", &memory)) -+ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, -+ "couldn't find /memory node"); -+ if (grub_ieee1275_get_integer_property (memory, "reg", reg, -+ sizeof reg, ®_size)) -+ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, -+ "couldn't examine /memory/reg property"); -+ if (reg_size < 0 || (grub_size_t) reg_size > sizeof (reg)) -+ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, -+ "/memory response buffer exceeded"); -+ -+ if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS)) -+ { -+ address_cells = 1; -+ size_cells = 1; -+ } -+ -+ /* Decode only the size */ -+ size = reg[address_cells]; -+ if (size_cells == 2) -+ size = (size << 32) | reg[address_cells + 1]; -+ -+ *total = size; -+ -+ return grub_errno; -+} -+ -+/* Based on linux - arch/powerpc/kernel/prom_init.c */ -+struct option_vector2 { -+ grub_uint8_t byte1; -+ grub_uint16_t reserved; -+ grub_uint32_t real_base; -+ grub_uint32_t real_size; -+ grub_uint32_t virt_base; -+ grub_uint32_t virt_size; -+ grub_uint32_t load_base; -+ grub_uint32_t min_rma; -+ grub_uint32_t min_load; -+ grub_uint8_t min_rma_percent; -+ grub_uint8_t max_pft_size; -+} __attribute__((packed)); -+ -+struct pvr_entry { -+ grub_uint32_t mask; -+ grub_uint32_t entry; -+}; -+ -+struct cas_vector { -+ struct { -+ struct pvr_entry terminal; -+ } pvr_list; -+ grub_uint8_t num_vecs; -+ grub_uint8_t vec1_size; -+ grub_uint8_t vec1; -+ grub_uint8_t vec2_size; -+ struct option_vector2 vec2; -+} __attribute__((packed)); -+ -+/* Call ibm,client-architecture-support to try to get more RMA. -+ We ask for 512MB which should be enough to verify a distro kernel. -+ We ignore most errors: if we don't succeed we'll proceed with whatever -+ memory we have. */ -+static void -+grub_ieee1275_ibm_cas (void) -+{ -+ int rc; -+ grub_ieee1275_ihandle_t root; -+ struct cas_args { -+ struct grub_ieee1275_common_hdr common; -+ grub_ieee1275_cell_t method; -+ grub_ieee1275_ihandle_t ihandle; -+ grub_ieee1275_cell_t cas_addr; -+ grub_ieee1275_cell_t result; -+ } args; -+ struct cas_vector vector = { -+ .pvr_list = { { 0x00000000, 0xffffffff } }, /* any processor */ -+ .num_vecs = 2 - 1, -+ .vec1_size = 0, -+ .vec1 = 0x80, /* ignore */ -+ .vec2_size = 1 + sizeof(struct option_vector2) - 2, -+ .vec2 = { -+ 0, 0, -1, -1, -1, -1, -1, 512, -1, 0, 48 -+ }, -+ }; -+ -+ INIT_IEEE1275_COMMON (&args.common, "call-method", 3, 2); -+ args.method = (grub_ieee1275_cell_t)"ibm,client-architecture-support"; -+ rc = grub_ieee1275_open("/", &root); -+ if (rc) { -+ grub_error (GRUB_ERR_IO, "could not open root when trying to call CAS"); -+ return; -+ } -+ args.ihandle = root; -+ args.cas_addr = (grub_ieee1275_cell_t)&vector; -+ -+ grub_printf("Calling ibm,client-architecture-support..."); -+ IEEE1275_CALL_ENTRY_FN (&args); -+ grub_printf("done\n"); -+ -+ grub_ieee1275_close(root); -+} -+ - static void - grub_claim_heap (void) - { -@@ -249,11 +378,22 @@ grub_claim_heap (void) - - if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM)) - { -- heap_init (GRUB_IEEE1275_STATIC_HEAP_START, GRUB_IEEE1275_STATIC_HEAP_LEN, -- 1, &total); -+ heap_init (GRUB_IEEE1275_STATIC_HEAP_START, -+ GRUB_IEEE1275_STATIC_HEAP_LEN, 1, &total); - return; - } - -+ if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY)) -+ { -+ grub_uint64_t rma_size; -+ grub_err_t err; -+ -+ err = grub_ieee1275_total_mem (&rma_size); -+ /* if we have an error, don't call CAS, just hope for the best */ -+ if (!err && rma_size < (512 * 1024 * 1024)) -+ grub_ieee1275_ibm_cas(); -+ } -+ - grub_machine_mmap_iterate (heap_size, &total); - - total = total / 4; -diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index b5a1d49bbc..e0a6c2ce1e 100644 ---- a/include/grub/ieee1275/ieee1275.h -+++ b/include/grub/ieee1275/ieee1275.h -@@ -149,7 +149,13 @@ enum grub_ieee1275_flag - - GRUB_IEEE1275_FLAG_RAW_DEVNAMES, - -- GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT -+ GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT, -+ -+ /* On PFW, the first time we boot a Linux partition, we may only get 256MB -+ of real memory area, even if the partition has more memory. Set this flag -+ if we think we're running under PFW. Then, if this flag is set, and the -+ RMA is only 256MB in size, try asking for more with CAS. */ -+ GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY, - }; - - extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag); diff --git a/0179-Allow-chainloading-EFI-apps-from-loop-mounts.patch b/0177-Allow-chainloading-EFI-apps-from-loop-mounts.patch similarity index 100% rename from 0179-Allow-chainloading-EFI-apps-from-loop-mounts.patch rename to 0177-Allow-chainloading-EFI-apps-from-loop-mounts.patch diff --git a/0180-efinet-Add-DHCP-proxy-support.patch b/0178-efinet-Add-DHCP-proxy-support.patch similarity index 100% rename from 0180-efinet-Add-DHCP-proxy-support.patch rename to 0178-efinet-Add-DHCP-proxy-support.patch diff --git a/0181-fs-ext2-Ignore-checksum-seed-incompat-feature.patch b/0179-fs-ext2-Ignore-checksum-seed-incompat-feature.patch similarity index 100% rename from 0181-fs-ext2-Ignore-checksum-seed-incompat-feature.patch rename to 0179-fs-ext2-Ignore-checksum-seed-incompat-feature.patch diff --git a/0182-Don-t-update-the-cmdline-when-generating-legacy-menu.patch b/0180-Don-t-update-the-cmdline-when-generating-legacy-menu.patch similarity index 100% rename from 0182-Don-t-update-the-cmdline-when-generating-legacy-menu.patch rename to 0180-Don-t-update-the-cmdline-when-generating-legacy-menu.patch diff --git a/0183-Suppress-gettext-error-message.patch b/0181-Suppress-gettext-error-message.patch similarity index 100% rename from 0183-Suppress-gettext-error-message.patch rename to 0181-Suppress-gettext-error-message.patch diff --git a/0184-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch b/0182-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch similarity index 100% rename from 0184-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch rename to 0182-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch diff --git a/0185-templates-Check-for-EFI-at-runtime-instead-of-config.patch b/0183-templates-Check-for-EFI-at-runtime-instead-of-config.patch similarity index 100% rename from 0185-templates-Check-for-EFI-at-runtime-instead-of-config.patch rename to 0183-templates-Check-for-EFI-at-runtime-instead-of-config.patch diff --git a/0186-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch b/0184-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch similarity index 100% rename from 0186-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch rename to 0184-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch diff --git a/0187-arm64-Fix-EFI-loader-kernel-image-allocation.patch b/0185-arm64-Fix-EFI-loader-kernel-image-allocation.patch similarity index 100% rename from 0187-arm64-Fix-EFI-loader-kernel-image-allocation.patch rename to 0185-arm64-Fix-EFI-loader-kernel-image-allocation.patch diff --git a/0188-normal-main-Discover-the-device-to-read-the-config-f.patch b/0186-normal-main-Discover-the-device-to-read-the-config-f.patch similarity index 100% rename from 0188-normal-main-Discover-the-device-to-read-the-config-f.patch rename to 0186-normal-main-Discover-the-device-to-read-the-config-f.patch diff --git a/0189-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch b/0187-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch similarity index 100% rename from 0189-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch rename to 0187-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch diff --git a/0190-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch b/0188-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch similarity index 100% rename from 0190-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch rename to 0188-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch diff --git a/0191-Print-module-name-on-license-check-failure.patch b/0189-Print-module-name-on-license-check-failure.patch similarity index 100% rename from 0191-Print-module-name-on-license-check-failure.patch rename to 0189-Print-module-name-on-license-check-failure.patch diff --git a/0192-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch b/0190-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch similarity index 100% rename from 0192-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch rename to 0190-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch diff --git a/0193-grub-mkconfig-restore-umask-for-grub.cfg.patch b/0191-grub-mkconfig-restore-umask-for-grub.cfg.patch similarity index 100% rename from 0193-grub-mkconfig-restore-umask-for-grub.cfg.patch rename to 0191-grub-mkconfig-restore-umask-for-grub.cfg.patch diff --git a/0194-fs-btrfs-Use-full-btrfs-bootloader-area.patch b/0192-fs-btrfs-Use-full-btrfs-bootloader-area.patch similarity index 100% rename from 0194-fs-btrfs-Use-full-btrfs-bootloader-area.patch rename to 0192-fs-btrfs-Use-full-btrfs-bootloader-area.patch diff --git a/0195-Add-Fedora-location-of-DejaVu-SANS-font.patch b/0193-Add-Fedora-location-of-DejaVu-SANS-font.patch similarity index 100% rename from 0195-Add-Fedora-location-of-DejaVu-SANS-font.patch rename to 0193-Add-Fedora-location-of-DejaVu-SANS-font.patch diff --git a/0196-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch b/0194-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch similarity index 100% rename from 0196-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch rename to 0194-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch diff --git a/0197-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch b/0195-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch similarity index 100% rename from 0197-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch rename to 0195-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch diff --git a/0198-EFI-console-Do-not-set-colorstate-until-the-first-te.patch b/0196-EFI-console-Do-not-set-colorstate-until-the-first-te.patch similarity index 100% rename from 0198-EFI-console-Do-not-set-colorstate-until-the-first-te.patch rename to 0196-EFI-console-Do-not-set-colorstate-until-the-first-te.patch diff --git a/0199-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch b/0197-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch similarity index 100% rename from 0199-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch rename to 0197-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch diff --git a/0200-Use-visual-indentation-in-config.h.in.patch b/0198-Use-visual-indentation-in-config.h.in.patch similarity index 100% rename from 0200-Use-visual-indentation-in-config.h.in.patch rename to 0198-Use-visual-indentation-in-config.h.in.patch diff --git a/0201-Where-present-ensure-config-util.h-precedes-config.h.patch b/0199-Where-present-ensure-config-util.h-precedes-config.h.patch similarity index 100% rename from 0201-Where-present-ensure-config-util.h-precedes-config.h.patch rename to 0199-Where-present-ensure-config-util.h-precedes-config.h.patch diff --git a/0202-Drop-gnulib-fix-base64.patch.patch b/0200-Drop-gnulib-fix-base64.patch.patch similarity index 100% rename from 0202-Drop-gnulib-fix-base64.patch.patch rename to 0200-Drop-gnulib-fix-base64.patch.patch diff --git a/0203-Drop-gnulib-no-abort.patch.patch b/0201-Drop-gnulib-no-abort.patch.patch similarity index 100% rename from 0203-Drop-gnulib-no-abort.patch.patch rename to 0201-Drop-gnulib-no-abort.patch.patch diff --git a/0204-Update-gnulib-version-and-drop-most-gnulib-patches.patch b/0202-Update-gnulib-version-and-drop-most-gnulib-patches.patch similarity index 100% rename from 0204-Update-gnulib-version-and-drop-most-gnulib-patches.patch rename to 0202-Update-gnulib-version-and-drop-most-gnulib-patches.patch diff --git a/0205-commands-search-Fix-bug-stopping-iteration-when-no-f.patch b/0203-commands-search-Fix-bug-stopping-iteration-when-no-f.patch similarity index 100% rename from 0205-commands-search-Fix-bug-stopping-iteration-when-no-f.patch rename to 0203-commands-search-Fix-bug-stopping-iteration-when-no-f.patch diff --git a/0206-search-new-efidisk-only-option-on-EFI-systems.patch b/0204-search-new-efidisk-only-option-on-EFI-systems.patch similarity index 100% rename from 0206-search-new-efidisk-only-option-on-EFI-systems.patch rename to 0204-search-new-efidisk-only-option-on-EFI-systems.patch diff --git a/0207-efi-new-connectefi-command.patch b/0205-efi-new-connectefi-command.patch similarity index 100% rename from 0207-efi-new-connectefi-command.patch rename to 0205-efi-new-connectefi-command.patch diff --git a/0208-grub-core-loader-i386-efi-linux.c-do-not-validate-ke.patch b/0206-grub-core-loader-i386-efi-linux.c-do-not-validate-ke.patch similarity index 100% rename from 0208-grub-core-loader-i386-efi-linux.c-do-not-validate-ke.patch rename to 0206-grub-core-loader-i386-efi-linux.c-do-not-validate-ke.patch diff --git a/0209-grub-core-loader-arm64-linux.c-do-not-validate-kerne.patch b/0207-grub-core-loader-arm64-linux.c-do-not-validate-kerne.patch similarity index 100% rename from 0209-grub-core-loader-arm64-linux.c-do-not-validate-kerne.patch rename to 0207-grub-core-loader-arm64-linux.c-do-not-validate-kerne.patch diff --git a/0210-grub-core-loader-efi-chainloader.c-do-not-validate-c.patch b/0208-grub-core-loader-efi-chainloader.c-do-not-validate-c.patch similarity index 100% rename from 0210-grub-core-loader-efi-chainloader.c-do-not-validate-c.patch rename to 0208-grub-core-loader-efi-chainloader.c-do-not-validate-c.patch diff --git a/0211-grub-core-loader-efi-linux.c-drop-now-unused-grub_li.patch b/0209-grub-core-loader-efi-linux.c-drop-now-unused-grub_li.patch similarity index 100% rename from 0211-grub-core-loader-efi-linux.c-drop-now-unused-grub_li.patch rename to 0209-grub-core-loader-efi-linux.c-drop-now-unused-grub_li.patch diff --git a/0213-powerpc-prefix-detection-support-device-names-with-c.patch b/0210-powerpc-prefix-detection-support-device-names-with-c.patch similarity index 100% rename from 0213-powerpc-prefix-detection-support-device-names-with-c.patch rename to 0210-powerpc-prefix-detection-support-device-names-with-c.patch diff --git a/0215-make-ofdisk_retries-optional.patch b/0211-make-ofdisk_retries-optional.patch similarity index 100% rename from 0215-make-ofdisk_retries-optional.patch rename to 0211-make-ofdisk_retries-optional.patch diff --git a/0216-loader-efi-chainloader-grub_load_and_start_image-doe.patch b/0212-loader-efi-chainloader-grub_load_and_start_image-doe.patch similarity index 100% rename from 0216-loader-efi-chainloader-grub_load_and_start_image-doe.patch rename to 0212-loader-efi-chainloader-grub_load_and_start_image-doe.patch diff --git a/0212-powerpc-do-CAS-in-a-more-compatible-way.patch b/0212-powerpc-do-CAS-in-a-more-compatible-way.patch deleted file mode 100644 index 20b95f7..0000000 --- a/0212-powerpc-do-CAS-in-a-more-compatible-way.patch +++ /dev/null @@ -1,110 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Daniel Axtens -Date: Fri, 8 Apr 2022 12:35:28 +1000 -Subject: [PATCH] powerpc: do CAS in a more compatible way - -I wrongly assumed that the most compatible way to perform CAS -negotiation was to only set the minimum number of vectors required -to ask for more memory. It turns out that this messes up booting -if the minimum VP capacity would be less than the default 10% in -vector 4. - -Linux configures the minimum capacity to be 1%, so copy it for that -and for vector 3 which we now need to specify as well. - -Signed-off-by: Daniel Axtens ---- - grub-core/kern/ieee1275/init.c | 54 ++++++++++++++++++++++++------------------ - 1 file changed, 31 insertions(+), 23 deletions(-) - -diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 9704715c83..ef55107467 100644 ---- a/grub-core/kern/ieee1275/init.c -+++ b/grub-core/kern/ieee1275/init.c -@@ -298,33 +298,37 @@ grub_ieee1275_total_mem (grub_uint64_t *total) - - /* Based on linux - arch/powerpc/kernel/prom_init.c */ - struct option_vector2 { -- grub_uint8_t byte1; -- grub_uint16_t reserved; -- grub_uint32_t real_base; -- grub_uint32_t real_size; -- grub_uint32_t virt_base; -- grub_uint32_t virt_size; -- grub_uint32_t load_base; -- grub_uint32_t min_rma; -- grub_uint32_t min_load; -- grub_uint8_t min_rma_percent; -- grub_uint8_t max_pft_size; -+ grub_uint8_t byte1; -+ grub_uint16_t reserved; -+ grub_uint32_t real_base; -+ grub_uint32_t real_size; -+ grub_uint32_t virt_base; -+ grub_uint32_t virt_size; -+ grub_uint32_t load_base; -+ grub_uint32_t min_rma; -+ grub_uint32_t min_load; -+ grub_uint8_t min_rma_percent; -+ grub_uint8_t max_pft_size; - } __attribute__((packed)); - - struct pvr_entry { -- grub_uint32_t mask; -- grub_uint32_t entry; -+ grub_uint32_t mask; -+ grub_uint32_t entry; - }; - - struct cas_vector { -- struct { -- struct pvr_entry terminal; -- } pvr_list; -- grub_uint8_t num_vecs; -- grub_uint8_t vec1_size; -- grub_uint8_t vec1; -- grub_uint8_t vec2_size; -- struct option_vector2 vec2; -+ struct { -+ struct pvr_entry terminal; -+ } pvr_list; -+ grub_uint8_t num_vecs; -+ grub_uint8_t vec1_size; -+ grub_uint8_t vec1; -+ grub_uint8_t vec2_size; -+ struct option_vector2 vec2; -+ grub_uint8_t vec3_size; -+ grub_uint16_t vec3; -+ grub_uint8_t vec4_size; -+ grub_uint16_t vec4; - } __attribute__((packed)); - - /* Call ibm,client-architecture-support to try to get more RMA. -@@ -345,13 +349,17 @@ grub_ieee1275_ibm_cas (void) - } args; - struct cas_vector vector = { - .pvr_list = { { 0x00000000, 0xffffffff } }, /* any processor */ -- .num_vecs = 2 - 1, -+ .num_vecs = 4 - 1, - .vec1_size = 0, - .vec1 = 0x80, /* ignore */ - .vec2_size = 1 + sizeof(struct option_vector2) - 2, - .vec2 = { - 0, 0, -1, -1, -1, -1, -1, 512, -1, 0, 48 - }, -+ .vec3_size = 2 - 1, -+ .vec3 = 0x00e0, // ask for FP + VMX + DFP but don't halt if unsatisfied -+ .vec4_size = 2 - 1, -+ .vec4 = 0x0001, // set required minimum capacity % to the lowest value - }; - - INIT_IEEE1275_COMMON (&args.common, "call-method", 3, 2); -@@ -364,7 +372,7 @@ grub_ieee1275_ibm_cas (void) - args.ihandle = root; - args.cas_addr = (grub_ieee1275_cell_t)&vector; - -- grub_printf("Calling ibm,client-architecture-support..."); -+ grub_printf("Calling ibm,client-architecture-support from grub..."); - IEEE1275_CALL_ENTRY_FN (&args); - grub_printf("done\n"); - diff --git a/0217-loader-efi-chainloader-simplify-the-loader-state.patch b/0213-loader-efi-chainloader-simplify-the-loader-state.patch similarity index 100% rename from 0217-loader-efi-chainloader-simplify-the-loader-state.patch rename to 0213-loader-efi-chainloader-simplify-the-loader-state.patch diff --git a/0218-commands-boot-Add-API-to-pass-context-to-loader.patch b/0214-commands-boot-Add-API-to-pass-context-to-loader.patch similarity index 100% rename from 0218-commands-boot-Add-API-to-pass-context-to-loader.patch rename to 0214-commands-boot-Add-API-to-pass-context-to-loader.patch diff --git a/0219-loader-efi-chainloader-Use-grub_loader_set_ex.patch b/0215-loader-efi-chainloader-Use-grub_loader_set_ex.patch similarity index 100% rename from 0219-loader-efi-chainloader-Use-grub_loader_set_ex.patch rename to 0215-loader-efi-chainloader-Use-grub_loader_set_ex.patch diff --git a/0220-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch b/0216-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch similarity index 100% rename from 0220-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch rename to 0216-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch diff --git a/0221-loader-i386-efi-linux-Use-grub_loader_set_ex.patch b/0217-loader-i386-efi-linux-Use-grub_loader_set_ex.patch similarity index 100% rename from 0221-loader-i386-efi-linux-Use-grub_loader_set_ex.patch rename to 0217-loader-i386-efi-linux-Use-grub_loader_set_ex.patch diff --git a/0222-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch b/0218-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch similarity index 100% rename from 0222-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch rename to 0218-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch diff --git a/0223-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch b/0219-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch similarity index 100% rename from 0223-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch rename to 0219-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch diff --git a/0224-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch b/0220-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch similarity index 100% rename from 0224-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch rename to 0220-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch diff --git a/0225-video-readers-png-Abort-sooner-if-a-read-operation-f.patch b/0221-video-readers-png-Abort-sooner-if-a-read-operation-f.patch similarity index 100% rename from 0225-video-readers-png-Abort-sooner-if-a-read-operation-f.patch rename to 0221-video-readers-png-Abort-sooner-if-a-read-operation-f.patch diff --git a/0226-video-readers-png-Refuse-to-handle-multiple-image-he.patch b/0222-video-readers-png-Refuse-to-handle-multiple-image-he.patch similarity index 100% rename from 0226-video-readers-png-Refuse-to-handle-multiple-image-he.patch rename to 0222-video-readers-png-Refuse-to-handle-multiple-image-he.patch diff --git a/0227-video-readers-png-Drop-greyscale-support-to-fix-heap.patch b/0223-video-readers-png-Drop-greyscale-support-to-fix-heap.patch similarity index 100% rename from 0227-video-readers-png-Drop-greyscale-support-to-fix-heap.patch rename to 0223-video-readers-png-Drop-greyscale-support-to-fix-heap.patch diff --git a/0228-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch b/0224-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch similarity index 100% rename from 0228-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch rename to 0224-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch diff --git a/0229-video-readers-png-Sanity-check-some-huffman-codes.patch b/0225-video-readers-png-Sanity-check-some-huffman-codes.patch similarity index 100% rename from 0229-video-readers-png-Sanity-check-some-huffman-codes.patch rename to 0225-video-readers-png-Sanity-check-some-huffman-codes.patch diff --git a/0230-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch b/0226-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch similarity index 100% rename from 0230-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch rename to 0226-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch diff --git a/0231-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch b/0227-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch similarity index 100% rename from 0231-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch rename to 0227-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch diff --git a/0232-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch b/0228-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch similarity index 100% rename from 0232-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch rename to 0228-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch diff --git a/0233-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch b/0229-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch similarity index 100% rename from 0233-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch rename to 0229-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch diff --git a/0234-normal-charset-Fix-array-out-of-bounds-formatting-un.patch b/0230-normal-charset-Fix-array-out-of-bounds-formatting-un.patch similarity index 100% rename from 0234-normal-charset-Fix-array-out-of-bounds-formatting-un.patch rename to 0230-normal-charset-Fix-array-out-of-bounds-formatting-un.patch diff --git a/0235-net-netbuff-Block-overly-large-netbuff-allocs.patch b/0231-net-netbuff-Block-overly-large-netbuff-allocs.patch similarity index 100% rename from 0235-net-netbuff-Block-overly-large-netbuff-allocs.patch rename to 0231-net-netbuff-Block-overly-large-netbuff-allocs.patch diff --git a/0236-net-ip-Do-IP-fragment-maths-safely.patch b/0232-net-ip-Do-IP-fragment-maths-safely.patch similarity index 100% rename from 0236-net-ip-Do-IP-fragment-maths-safely.patch rename to 0232-net-ip-Do-IP-fragment-maths-safely.patch diff --git a/0237-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch b/0233-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch similarity index 100% rename from 0237-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch rename to 0233-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch diff --git a/0238-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch b/0234-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch similarity index 100% rename from 0238-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch rename to 0234-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch diff --git a/0239-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch b/0235-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch similarity index 100% rename from 0239-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch rename to 0235-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch diff --git a/0240-net-tftp-Avoid-a-trivial-UAF.patch b/0236-net-tftp-Avoid-a-trivial-UAF.patch similarity index 100% rename from 0240-net-tftp-Avoid-a-trivial-UAF.patch rename to 0236-net-tftp-Avoid-a-trivial-UAF.patch diff --git a/0241-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch b/0237-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch similarity index 100% rename from 0241-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch rename to 0237-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch diff --git a/0242-net-http-Fix-OOB-write-for-split-http-headers.patch b/0238-net-http-Fix-OOB-write-for-split-http-headers.patch similarity index 100% rename from 0242-net-http-Fix-OOB-write-for-split-http-headers.patch rename to 0238-net-http-Fix-OOB-write-for-split-http-headers.patch diff --git a/0243-net-http-Error-out-on-headers-with-LF-without-CR.patch b/0239-net-http-Error-out-on-headers-with-LF-without-CR.patch similarity index 100% rename from 0243-net-http-Error-out-on-headers-with-LF-without-CR.patch rename to 0239-net-http-Error-out-on-headers-with-LF-without-CR.patch diff --git a/0244-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch b/0240-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch similarity index 100% rename from 0244-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch rename to 0240-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch diff --git a/0245-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch b/0241-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch similarity index 100% rename from 0245-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch rename to 0241-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch diff --git a/0246-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch b/0242-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch similarity index 100% rename from 0246-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch rename to 0242-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch diff --git a/0247-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch b/0243-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch similarity index 100% rename from 0247-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch rename to 0243-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch diff --git a/0248-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch b/0244-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch similarity index 100% rename from 0248-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch rename to 0244-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch diff --git a/0249-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch b/0245-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch similarity index 100% rename from 0249-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch rename to 0245-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch diff --git a/0250-misc-Make-grub_min-and-grub_max-more-resilient.patch b/0246-misc-Make-grub_min-and-grub_max-more-resilient.patch similarity index 100% rename from 0250-misc-Make-grub_min-and-grub_max-more-resilient.patch rename to 0246-misc-Make-grub_min-and-grub_max-more-resilient.patch diff --git a/0251-ReiserFS-switch-to-using-grub_min-grub_max.patch b/0247-ReiserFS-switch-to-using-grub_min-grub_max.patch similarity index 100% rename from 0251-ReiserFS-switch-to-using-grub_min-grub_max.patch rename to 0247-ReiserFS-switch-to-using-grub_min-grub_max.patch diff --git a/0252-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch b/0248-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch similarity index 100% rename from 0252-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch rename to 0248-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch diff --git a/0253-modules-make-.module_license-read-only.patch b/0249-modules-make-.module_license-read-only.patch similarity index 100% rename from 0253-modules-make-.module_license-read-only.patch rename to 0249-modules-make-.module_license-read-only.patch diff --git a/0254-modules-strip-.llvm_addrsig-sections-and-similar.patch b/0250-modules-strip-.llvm_addrsig-sections-and-similar.patch similarity index 100% rename from 0254-modules-strip-.llvm_addrsig-sections-and-similar.patch rename to 0250-modules-strip-.llvm_addrsig-sections-and-similar.patch diff --git a/0255-modules-Don-t-allocate-space-for-non-allocable-secti.patch b/0251-modules-Don-t-allocate-space-for-non-allocable-secti.patch similarity index 100% rename from 0255-modules-Don-t-allocate-space-for-non-allocable-secti.patch rename to 0251-modules-Don-t-allocate-space-for-non-allocable-secti.patch diff --git a/0256-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch b/0252-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch similarity index 100% rename from 0256-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch rename to 0252-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch diff --git a/0257-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch b/0253-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch similarity index 100% rename from 0257-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch rename to 0253-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch diff --git a/0258-modules-load-module-sections-at-page-aligned-address.patch b/0254-modules-load-module-sections-at-page-aligned-address.patch similarity index 99% rename from 0258-modules-load-module-sections-at-page-aligned-address.patch rename to 0254-modules-load-module-sections-at-page-aligned-address.patch index 9a5048c..eb171f5 100644 --- a/0258-modules-load-module-sections-at-page-aligned-address.patch +++ b/0254-modules-load-module-sections-at-page-aligned-address.patch @@ -360,7 +360,7 @@ index 618ae6f474..f36ed5cb17 100644 #if defined (_mips) diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi -index 90083772c8..c23ba313dc 100644 +index 19f708ee66..7b2455a8fe 100644 --- a/docs/grub-dev.texi +++ b/docs/grub-dev.texi @@ -755,9 +755,9 @@ declare startup asm file ($cpu_$platform_startup) as well as any other files diff --git a/0259-nx-add-memory-attribute-get-set-API.patch b/0255-nx-add-memory-attribute-get-set-API.patch similarity index 100% rename from 0259-nx-add-memory-attribute-get-set-API.patch rename to 0255-nx-add-memory-attribute-get-set-API.patch diff --git a/0260-nx-set-page-permissions-for-loaded-modules.patch b/0256-nx-set-page-permissions-for-loaded-modules.patch similarity index 100% rename from 0260-nx-set-page-permissions-for-loaded-modules.patch rename to 0256-nx-set-page-permissions-for-loaded-modules.patch diff --git a/0261-nx-set-attrs-in-our-kernel-loaders.patch b/0257-nx-set-attrs-in-our-kernel-loaders.patch similarity index 100% rename from 0261-nx-set-attrs-in-our-kernel-loaders.patch rename to 0257-nx-set-attrs-in-our-kernel-loaders.patch diff --git a/0262-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch b/0258-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch similarity index 100% rename from 0262-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch rename to 0258-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch diff --git a/0263-grub-probe-document-the-behavior-of-multiple-v.patch b/0259-grub-probe-document-the-behavior-of-multiple-v.patch similarity index 100% rename from 0263-grub-probe-document-the-behavior-of-multiple-v.patch rename to 0259-grub-probe-document-the-behavior-of-multiple-v.patch diff --git a/0264-grub_fs_probe-dprint-errors-from-filesystems.patch b/0260-grub_fs_probe-dprint-errors-from-filesystems.patch similarity index 100% rename from 0264-grub_fs_probe-dprint-errors-from-filesystems.patch rename to 0260-grub_fs_probe-dprint-errors-from-filesystems.patch diff --git a/0265-fs-fat-don-t-error-when-mtime-is-0.patch b/0261-fs-fat-don-t-error-when-mtime-is-0.patch similarity index 100% rename from 0265-fs-fat-don-t-error-when-mtime-is-0.patch rename to 0261-fs-fat-don-t-error-when-mtime-is-0.patch diff --git a/0266-Make-debug-file-show-which-file-filters-get-run.patch b/0262-Make-debug-file-show-which-file-filters-get-run.patch similarity index 100% rename from 0266-Make-debug-file-show-which-file-filters-get-run.patch rename to 0262-Make-debug-file-show-which-file-filters-get-run.patch diff --git a/0267-efi-use-enumerated-array-positions-for-our-allocatio.patch b/0263-efi-use-enumerated-array-positions-for-our-allocatio.patch similarity index 100% rename from 0267-efi-use-enumerated-array-positions-for-our-allocatio.patch rename to 0263-efi-use-enumerated-array-positions-for-our-allocatio.patch diff --git a/0268-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch b/0264-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch similarity index 100% rename from 0268-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch rename to 0264-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch diff --git a/0269-efi-allocate-the-initrd-within-the-bounds-expressed-.patch b/0265-efi-allocate-the-initrd-within-the-bounds-expressed-.patch similarity index 100% rename from 0269-efi-allocate-the-initrd-within-the-bounds-expressed-.patch rename to 0265-efi-allocate-the-initrd-within-the-bounds-expressed-.patch diff --git a/0270-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch b/0266-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch similarity index 100% rename from 0270-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch rename to 0266-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch diff --git a/0271-BLS-create-etc-kernel-cmdline-during-mkconfig.patch b/0267-BLS-create-etc-kernel-cmdline-during-mkconfig.patch similarity index 100% rename from 0271-BLS-create-etc-kernel-cmdline-during-mkconfig.patch rename to 0267-BLS-create-etc-kernel-cmdline-during-mkconfig.patch diff --git a/0272-squish-don-t-dup-rhgb-quiet-check-mtimes.patch b/0268-squish-don-t-dup-rhgb-quiet-check-mtimes.patch similarity index 100% rename from 0272-squish-don-t-dup-rhgb-quiet-check-mtimes.patch rename to 0268-squish-don-t-dup-rhgb-quiet-check-mtimes.patch diff --git a/0273-squish-give-up-on-rhgb-quiet.patch b/0269-squish-give-up-on-rhgb-quiet.patch similarity index 100% rename from 0273-squish-give-up-on-rhgb-quiet.patch rename to 0269-squish-give-up-on-rhgb-quiet.patch diff --git a/0274-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch b/0270-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch similarity index 100% rename from 0274-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch rename to 0270-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch diff --git a/0276-blscfg-Don-t-root-device-in-emu-builds.patch b/0271-blscfg-Don-t-root-device-in-emu-builds.patch similarity index 100% rename from 0276-blscfg-Don-t-root-device-in-emu-builds.patch rename to 0271-blscfg-Don-t-root-device-in-emu-builds.patch diff --git a/0277-loader-arm64-linux-Remove-magic-number-header-field-.patch b/0272-loader-arm64-linux-Remove-magic-number-header-field-.patch similarity index 100% rename from 0277-loader-arm64-linux-Remove-magic-number-header-field-.patch rename to 0272-loader-arm64-linux-Remove-magic-number-header-field-.patch diff --git a/0278-Correct-BSS-zeroing-on-aarch64.patch b/0273-Correct-BSS-zeroing-on-aarch64.patch similarity index 100% rename from 0278-Correct-BSS-zeroing-on-aarch64.patch rename to 0273-Correct-BSS-zeroing-on-aarch64.patch diff --git a/0279-linuxefi-Invalidate-i-cache-before-starting-the-kern.patch b/0274-linuxefi-Invalidate-i-cache-before-starting-the-kern.patch similarity index 100% rename from 0279-linuxefi-Invalidate-i-cache-before-starting-the-kern.patch rename to 0274-linuxefi-Invalidate-i-cache-before-starting-the-kern.patch diff --git a/0275-ieee1275-implement-vec5-for-cas-negotiation.patch b/0275-ieee1275-implement-vec5-for-cas-negotiation.patch deleted file mode 100644 index 2749d10..0000000 --- a/0275-ieee1275-implement-vec5-for-cas-negotiation.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Diego Domingos -Date: Thu, 25 Aug 2022 11:37:56 -0400 -Subject: [PATCH] ieee1275: implement vec5 for cas negotiation - -As a legacy support, if the vector 5 is not implemented, Power -Hypervisor will consider the max CPUs as 64 instead 256 currently -supported during client-architecture-support negotiation. - -This patch implements the vector 5 and set the MAX CPUs to 256 while -setting the others values to 0 (default). - -Signed-off-by: Diego Domingos -Signed-off-by: Robbie Harwood ---- - grub-core/kern/ieee1275/init.c | 20 +++++++++++++++++++- - 1 file changed, 19 insertions(+), 1 deletion(-) - -diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index ef55107467..6a51c9efab 100644 ---- a/grub-core/kern/ieee1275/init.c -+++ b/grub-core/kern/ieee1275/init.c -@@ -311,6 +311,18 @@ struct option_vector2 { - grub_uint8_t max_pft_size; - } __attribute__((packed)); - -+struct option_vector5 { -+ grub_uint8_t byte1; -+ grub_uint8_t byte2; -+ grub_uint8_t byte3; -+ grub_uint8_t cmo; -+ grub_uint8_t associativity; -+ grub_uint8_t bin_opts; -+ grub_uint8_t micro_checkpoint; -+ grub_uint8_t reserved0; -+ grub_uint32_t max_cpus; -+} __attribute__((packed)); -+ - struct pvr_entry { - grub_uint32_t mask; - grub_uint32_t entry; -@@ -329,6 +341,8 @@ struct cas_vector { - grub_uint16_t vec3; - grub_uint8_t vec4_size; - grub_uint16_t vec4; -+ grub_uint8_t vec5_size; -+ struct option_vector5 vec5; - } __attribute__((packed)); - - /* Call ibm,client-architecture-support to try to get more RMA. -@@ -349,7 +363,7 @@ grub_ieee1275_ibm_cas (void) - } args; - struct cas_vector vector = { - .pvr_list = { { 0x00000000, 0xffffffff } }, /* any processor */ -- .num_vecs = 4 - 1, -+ .num_vecs = 5 - 1, - .vec1_size = 0, - .vec1 = 0x80, /* ignore */ - .vec2_size = 1 + sizeof(struct option_vector2) - 2, -@@ -360,6 +374,10 @@ grub_ieee1275_ibm_cas (void) - .vec3 = 0x00e0, // ask for FP + VMX + DFP but don't halt if unsatisfied - .vec4_size = 2 - 1, - .vec4 = 0x0001, // set required minimum capacity % to the lowest value -+ .vec5_size = 1 + sizeof(struct option_vector5) - 2, -+ .vec5 = { -+ 0, 0, 0, 0, 0, 0, 0, 0, 256 -+ } - }; - - INIT_IEEE1275_COMMON (&args.common, "call-method", 3, 2); diff --git a/0280-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch b/0275-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch similarity index 100% rename from 0280-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch rename to 0275-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch diff --git a/0281-commands-efi-tpm-Refine-the-status-of-log-event.patch b/0276-commands-efi-tpm-Refine-the-status-of-log-event.patch similarity index 100% rename from 0281-commands-efi-tpm-Refine-the-status-of-log-event.patch rename to 0276-commands-efi-tpm-Refine-the-status-of-log-event.patch diff --git a/0282-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch b/0277-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch similarity index 100% rename from 0282-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch rename to 0277-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch diff --git a/0283-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch b/0278-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch similarity index 100% rename from 0283-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch rename to 0278-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch diff --git a/0284-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch b/0279-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch similarity index 100% rename from 0284-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch rename to 0279-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch diff --git a/0285-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch b/0280-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch similarity index 100% rename from 0285-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch rename to 0280-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch diff --git a/0286-font-Fix-several-integer-overflows-in-grub_font_cons.patch b/0281-font-Fix-several-integer-overflows-in-grub_font_cons.patch similarity index 100% rename from 0286-font-Fix-several-integer-overflows-in-grub_font_cons.patch rename to 0281-font-Fix-several-integer-overflows-in-grub_font_cons.patch diff --git a/0287-font-Remove-grub_font_dup_glyph.patch b/0282-font-Remove-grub_font_dup_glyph.patch similarity index 100% rename from 0287-font-Remove-grub_font_dup_glyph.patch rename to 0282-font-Remove-grub_font_dup_glyph.patch diff --git a/0288-font-Fix-integer-overflow-in-ensure_comb_space.patch b/0283-font-Fix-integer-overflow-in-ensure_comb_space.patch similarity index 100% rename from 0288-font-Fix-integer-overflow-in-ensure_comb_space.patch rename to 0283-font-Fix-integer-overflow-in-ensure_comb_space.patch diff --git a/0289-font-Fix-integer-overflow-in-BMP-index.patch b/0284-font-Fix-integer-overflow-in-BMP-index.patch similarity index 100% rename from 0289-font-Fix-integer-overflow-in-BMP-index.patch rename to 0284-font-Fix-integer-overflow-in-BMP-index.patch diff --git a/0290-font-Fix-integer-underflow-in-binary-search-of-char-.patch b/0285-font-Fix-integer-underflow-in-binary-search-of-char-.patch similarity index 100% rename from 0290-font-Fix-integer-underflow-in-binary-search-of-char-.patch rename to 0285-font-Fix-integer-underflow-in-binary-search-of-char-.patch diff --git a/0291-kern-efi-sb-Enforce-verification-of-font-files.patch b/0286-kern-efi-sb-Enforce-verification-of-font-files.patch similarity index 100% rename from 0291-kern-efi-sb-Enforce-verification-of-font-files.patch rename to 0286-kern-efi-sb-Enforce-verification-of-font-files.patch diff --git a/0292-fbutil-Fix-integer-overflow.patch b/0287-fbutil-Fix-integer-overflow.patch similarity index 100% rename from 0292-fbutil-Fix-integer-overflow.patch rename to 0287-fbutil-Fix-integer-overflow.patch diff --git a/0293-font-Fix-an-integer-underflow-in-blit_comb.patch b/0288-font-Fix-an-integer-underflow-in-blit_comb.patch similarity index 100% rename from 0293-font-Fix-an-integer-underflow-in-blit_comb.patch rename to 0288-font-Fix-an-integer-underflow-in-blit_comb.patch diff --git a/0294-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch b/0289-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch similarity index 100% rename from 0294-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch rename to 0289-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch diff --git a/0295-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch b/0290-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch similarity index 100% rename from 0295-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch rename to 0290-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch diff --git a/0296-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch b/0291-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch similarity index 100% rename from 0296-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch rename to 0291-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch diff --git a/0297-font-Try-opening-fonts-from-the-bundled-memdisk.patch b/0292-font-Try-opening-fonts-from-the-bundled-memdisk.patch similarity index 100% rename from 0297-font-Try-opening-fonts-from-the-bundled-memdisk.patch rename to 0292-font-Try-opening-fonts-from-the-bundled-memdisk.patch diff --git a/0299-mm-Clarify-grub_real_malloc.patch b/0293-mm-Clarify-grub_real_malloc.patch similarity index 100% rename from 0299-mm-Clarify-grub_real_malloc.patch rename to 0293-mm-Clarify-grub_real_malloc.patch diff --git a/0300-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch b/0294-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch similarity index 100% rename from 0300-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch rename to 0294-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch diff --git a/0301-mm-Document-grub_free.patch b/0295-mm-Document-grub_free.patch similarity index 100% rename from 0301-mm-Document-grub_free.patch rename to 0295-mm-Document-grub_free.patch diff --git a/0302-mm-Document-grub_mm_init_region.patch b/0296-mm-Document-grub_mm_init_region.patch similarity index 100% rename from 0302-mm-Document-grub_mm_init_region.patch rename to 0296-mm-Document-grub_mm_init_region.patch diff --git a/0303-mm-Document-GRUB-internal-memory-management-structur.patch b/0297-mm-Document-GRUB-internal-memory-management-structur.patch similarity index 100% rename from 0303-mm-Document-GRUB-internal-memory-management-structur.patch rename to 0297-mm-Document-GRUB-internal-memory-management-structur.patch diff --git a/0298-Correction-in-vector-5-values.patch b/0298-Correction-in-vector-5-values.patch deleted file mode 100644 index 9be1f4a..0000000 --- a/0298-Correction-in-vector-5-values.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Avnish Chouhan -Date: Tue, 22 Nov 2022 08:01:47 -0500 -Subject: [PATCH] Correction in vector 5 values - -This patch is to update the vector 5 values which is troubling some -machines to bootup properly. Max out the values of all the properties of -Vector 5 (similar to vector 2) except max cpu property, which were set -as 0 earlier. - -Signed-off-by: Avnish Chouhan -[rharwood: rewrap comit message] -Signed-off-by: Robbie Harwood ---- - grub-core/kern/ieee1275/init.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c -index 6a51c9efab..28a3bd4621 100644 ---- a/grub-core/kern/ieee1275/init.c -+++ b/grub-core/kern/ieee1275/init.c -@@ -376,7 +376,7 @@ grub_ieee1275_ibm_cas (void) - .vec4 = 0x0001, // set required minimum capacity % to the lowest value - .vec5_size = 1 + sizeof(struct option_vector5) - 2, - .vec5 = { -- 0, 0, 0, 0, 0, 0, 0, 0, 256 -+ -1, -1, -1, -1, -1, -1, -1, -1, 256 - } - }; - diff --git a/0304-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch b/0298-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch similarity index 100% rename from 0304-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch rename to 0298-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch diff --git a/0305-mm-When-adding-a-region-merge-with-region-after-as-w.patch b/0299-mm-When-adding-a-region-merge-with-region-after-as-w.patch similarity index 100% rename from 0305-mm-When-adding-a-region-merge-with-region-after-as-w.patch rename to 0299-mm-When-adding-a-region-merge-with-region-after-as-w.patch diff --git a/0306-mm-Debug-support-for-region-operations.patch b/0300-mm-Debug-support-for-region-operations.patch similarity index 100% rename from 0306-mm-Debug-support-for-region-operations.patch rename to 0300-mm-Debug-support-for-region-operations.patch diff --git a/0307-mm-Drop-unused-unloading-of-modules-on-OOM.patch b/0301-mm-Drop-unused-unloading-of-modules-on-OOM.patch similarity index 100% rename from 0307-mm-Drop-unused-unloading-of-modules-on-OOM.patch rename to 0301-mm-Drop-unused-unloading-of-modules-on-OOM.patch diff --git a/0308-mm-Allow-dynamically-requesting-additional-memory-re.patch b/0302-mm-Allow-dynamically-requesting-additional-memory-re.patch similarity index 100% rename from 0308-mm-Allow-dynamically-requesting-additional-memory-re.patch rename to 0302-mm-Allow-dynamically-requesting-additional-memory-re.patch diff --git a/0309-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch b/0303-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch similarity index 100% rename from 0309-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch rename to 0303-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch diff --git a/0310-kern-efi-mm-Extract-function-to-add-memory-regions.patch b/0304-kern-efi-mm-Extract-function-to-add-memory-regions.patch similarity index 100% rename from 0310-kern-efi-mm-Extract-function-to-add-memory-regions.patch rename to 0304-kern-efi-mm-Extract-function-to-add-memory-regions.patch diff --git a/0311-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch b/0305-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch similarity index 100% rename from 0311-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch rename to 0305-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch diff --git a/0312-kern-efi-mm-Implement-runtime-addition-of-pages.patch b/0306-kern-efi-mm-Implement-runtime-addition-of-pages.patch similarity index 100% rename from 0312-kern-efi-mm-Implement-runtime-addition-of-pages.patch rename to 0306-kern-efi-mm-Implement-runtime-addition-of-pages.patch diff --git a/0313-efi-Increase-default-memory-allocation-to-32-MiB.patch b/0307-efi-Increase-default-memory-allocation-to-32-MiB.patch similarity index 100% rename from 0313-efi-Increase-default-memory-allocation-to-32-MiB.patch rename to 0307-efi-Increase-default-memory-allocation-to-32-MiB.patch diff --git a/0314-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch b/0308-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch similarity index 100% rename from 0314-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch rename to 0308-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch diff --git a/0315-ppc64le-signed-boot-media-changes.patch b/0309-ppc64le-signed-boot-media-changes.patch similarity index 100% rename from 0315-ppc64le-signed-boot-media-changes.patch rename to 0309-ppc64le-signed-boot-media-changes.patch diff --git a/0316-core-Fix-several-implicit-function-declarations.patch b/0310-core-Fix-several-implicit-function-declarations.patch similarity index 100% rename from 0316-core-Fix-several-implicit-function-declarations.patch rename to 0310-core-Fix-several-implicit-function-declarations.patch diff --git a/0317-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch b/0311-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch similarity index 99% rename from 0317-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch rename to 0311-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch index 61fe876..65834d8 100644 --- a/0317-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch +++ b/0311-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch @@ -41,10 +41,10 @@ Reviewed-by: Daniel Kiper create mode 100644 grub-core/loader/emu/linux.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index e038c5e6fd..02ea718652 100644 +index 741a033978..f21da23213 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def -@@ -1871,11 +1871,8 @@ module = { +@@ -1864,11 +1864,8 @@ module = { riscv32 = loader/riscv/linux.c; riscv64 = loader/riscv/linux.c; emu = loader/emu/linux.c; @@ -367,7 +367,7 @@ index ff9c48a649..01056954b9 100644 #ifdef HAVE_DEVICE_MAPPER diff --git a/docs/grub.texi b/docs/grub.texi -index c433240f34..825278a7f3 100644 +index a4da9c2a1b..1750b72ee9 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -923,17 +923,17 @@ magic. diff --git a/0312-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch b/0312-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch new file mode 100644 index 0000000..735075a --- /dev/null +++ b/0312-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch @@ -0,0 +1,111 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Axtens +Date: Mon, 6 Sep 2021 15:46:12 +1000 +Subject: [PATCH] powerpc: Drop Open Hack'Ware - remove + GRUB_IEEE1275_FLAG_FORCE_CLAIM + +Open Hack'Ware was the only user. It added a lot of complexity. + +Signed-off-by: Daniel Axtens +Reviewed-by: Daniel Kiper +(cherry picked from commit 333e63b356f1ce833cda1937ed8351618cbdf9d3) +--- + grub-core/kern/ieee1275/init.c | 6 +----- + grub-core/lib/ieee1275/relocator.c | 4 ---- + grub-core/loader/powerpc/ieee1275/linux.c | 14 -------------- + include/grub/ieee1275/ieee1275.h | 11 ----------- + 4 files changed, 1 insertion(+), 34 deletions(-) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index 0dcd114ce5..6581c2c996 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -207,11 +207,7 @@ grub_claim_heap (void) + { + unsigned long total = 0; + +- if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM)) +- heap_init (GRUB_IEEE1275_STATIC_HEAP_START, GRUB_IEEE1275_STATIC_HEAP_LEN, +- 1, &total); +- else +- grub_machine_mmap_iterate (heap_init, &total); ++ grub_machine_mmap_iterate (heap_init, &total); + } + #endif + +diff --git a/grub-core/lib/ieee1275/relocator.c b/grub-core/lib/ieee1275/relocator.c +index c6dd8facb0..d1bb45c75e 100644 +--- a/grub-core/lib/ieee1275/relocator.c ++++ b/grub-core/lib/ieee1275/relocator.c +@@ -38,8 +38,6 @@ grub_relocator_firmware_get_max_events (void) + { + int counter = 0; + +- if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM)) +- return 0; + grub_machine_mmap_iterate (count, &counter); + return 2 * counter; + } +@@ -92,8 +90,6 @@ grub_relocator_firmware_fill_events (struct grub_relocator_mmap_event *events) + .counter = 0 + }; + +- if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM)) +- return 0; + grub_machine_mmap_iterate (grub_relocator_firmware_fill_events_iter, &ctx); + return ctx.counter; + } +diff --git a/grub-core/loader/powerpc/ieee1275/linux.c b/grub-core/loader/powerpc/ieee1275/linux.c +index 818b2a86d1..6fdd863130 100644 +--- a/grub-core/loader/powerpc/ieee1275/linux.c ++++ b/grub-core/loader/powerpc/ieee1275/linux.c +@@ -111,20 +111,6 @@ grub_linux_claimmap_iterate (grub_addr_t target, grub_size_t size, + .found_addr = (grub_addr_t) -1 + }; + +- if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM)) +- { +- grub_uint64_t addr = target; +- if (addr < GRUB_IEEE1275_STATIC_HEAP_START +- + GRUB_IEEE1275_STATIC_HEAP_LEN) +- addr = GRUB_IEEE1275_STATIC_HEAP_START +- + GRUB_IEEE1275_STATIC_HEAP_LEN; +- addr = ALIGN_UP (addr, align); +- if (grub_claimmap (addr, size) == GRUB_ERR_NONE) +- return addr; +- return (grub_addr_t) -1; +- } +- +- + grub_machine_mmap_iterate (alloc_mem, &ctx); + + return ctx.found_addr; +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index b5a1d49bbc..6a1d3e5d70 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -85,14 +85,6 @@ extern grub_ieee1275_ihandle_t EXPORT_VAR(grub_ieee1275_mmu); + + extern int (* EXPORT_VAR(grub_ieee1275_entry_fn)) (void *) GRUB_IEEE1275_ENTRY_FN_ATTRIBUTE; + +-/* Static heap, used only if FORCE_CLAIM is set, +- happens on Open Hack'Ware. Should be in platform-specific +- header but is used only on PPC anyway. +-*/ +-#define GRUB_IEEE1275_STATIC_HEAP_START 0x1000000 +-#define GRUB_IEEE1275_STATIC_HEAP_LEN 0x1000000 +- +- + enum grub_ieee1275_flag + { + /* Old World Macintosh firmware fails seek when "dev:0" is opened. */ +@@ -119,9 +111,6 @@ enum grub_ieee1275_flag + /* Open Hack'Ware stops when grub_ieee1275_interpret is used. */ + GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, + +- /* Open Hack'Ware has no memory map, just claim what we need. */ +- GRUB_IEEE1275_FLAG_FORCE_CLAIM, +- + /* Open Hack'Ware don't support the ANSI sequence. */ + GRUB_IEEE1275_FLAG_NO_ANSI, + diff --git a/0313-ieee1275-request-memory-with-ibm-client-architecture.patch b/0313-ieee1275-request-memory-with-ibm-client-architecture.patch new file mode 100644 index 0000000..4e95630 --- /dev/null +++ b/0313-ieee1275-request-memory-with-ibm-client-architecture.patch @@ -0,0 +1,308 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Axtens +Date: Mon, 6 Feb 2023 10:03:20 -0500 +Subject: [PATCH] ieee1275: request memory with ibm, + client-architecture-support + +On PowerVM, the first time we boot a Linux partition, we may only get +256MB of real memory area, even if the partition has more memory. + +This isn't enough to reliably verify a kernel. Fortunately, the Power +Architecture Platform Reference (PAPR) defines a method we can call to ask +for more memory: the broad and powerful ibm,client-architecture-support +(CAS) method. + +CAS can do an enormous amount of things on a PAPR platform: as well as +asking for memory, you can set the supported processor level, the interrupt +controller, hash vs radix mmu, and so on. + +If: + + - we are running under what we think is PowerVM (compatible property of / + begins with "IBM"), and + + - the full amount of RMA is less than 512MB (as determined by the reg + property of /memory) + +then call CAS as follows: (refer to the Linux on Power Architecture +Reference, LoPAR, which is public, at B.5.2.3): + + - Use the "any" PVR value and supply 2 option vectors. + + - Set option vector 1 (PowerPC Server Processor Architecture Level) + to "ignore". + + - Set option vector 2 with default or Linux-like options, including a + min-rma-size of 512MB. + + - Set option vector 3 to request Floating Point, VMX and Decimal Floating + point, but don't abort the boot if we can't get them. + + - Set option vector 4 to request a minimum VP percentage to 1%, which is + what Linux requests, and is below the default of 10%. Without this, + some systems with very large or very small configurations fail to boot. + +This will cause a CAS reboot and the partition will restart with 512MB +of RMA. Importantly, grub will notice the 512MB and not call CAS again. + +Notes about the choices of parameters: + + - A partition can be configured with only 256MB of memory, which would + mean this request couldn't be satisfied, but PFW refuses to load with + only 256MB of memory, so it's a bit moot. SLOF will run fine with 256MB, + but we will never call CAS under qemu/SLOF because /compatible won't + begin with "IBM".) + + - unspecified CAS vectors take on default values. Some of these values + might restrict the ability of certain hardware configurations to boot. + This is why we need to specify the VP percentage in vector 4, which is + in turn why we need to specify vector 3. + +Finally, we should have enough memory to verify a kernel, and we will +reach Linux. One of the first things Linux does while still running under +OpenFirmware is to call CAS with a much fuller set of options (including +asking for 512MB of memory). Linux includes a much more restrictive set of +PVR values and processor support levels, and this CAS invocation will likely +induce another reboot. On this reboot grub will again notice the higher RMA, +and not call CAS. We will get to Linux again, Linux will call CAS again, but +because the values are now set for Linux this will not induce another CAS +reboot and we will finally boot all the way to userspace. + +On all subsequent boots, everything will be configured with 512MB of RMA, +so there will be no further CAS reboots from grub. (phyp is super sticky +with the RMA size - it persists even on cold boots. So if you've ever booted +Linux in a partition, you'll probably never have grub call CAS. It'll only +ever fire the first time a partition loads grub, or if you deliberately lower +the amount of memory your partition has below 512MB.) + +Signed-off-by: Daniel Axtens +Signed-off-by: Stefan Berger +Reviewed-by: Daniel Kiper +(cherry picked from commit d5571590b7de61887efac1c298901455697ba307) +--- + grub-core/kern/ieee1275/cmain.c | 5 ++ + grub-core/kern/ieee1275/init.c | 167 ++++++++++++++++++++++++++++++++++++++- + include/grub/ieee1275/ieee1275.h | 12 ++- + 3 files changed, 182 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c +index 04df9d2c66..dce7b84922 100644 +--- a/grub-core/kern/ieee1275/cmain.c ++++ b/grub-core/kern/ieee1275/cmain.c +@@ -127,6 +127,11 @@ grub_ieee1275_find_options (void) + break; + } + } ++ ++#if defined(__powerpc__) ++ if (grub_strncmp (tmp, "IBM,", 4) == 0) ++ grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY); ++#endif + } + + if (is_smartfirmware) +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index 6581c2c996..8ae405bc79 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -202,11 +202,176 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, + return 0; + } + +-static void ++/* ++ * How much memory does OF believe it has? (regardless of whether ++ * it's accessible or not) ++ */ ++static grub_err_t ++grub_ieee1275_total_mem (grub_uint64_t *total) ++{ ++ grub_ieee1275_phandle_t root; ++ grub_ieee1275_phandle_t memory; ++ grub_uint32_t reg[4]; ++ grub_ssize_t reg_size; ++ grub_uint32_t address_cells = 1; ++ grub_uint32_t size_cells = 1; ++ grub_uint64_t size; ++ ++ /* If we fail to get to the end, report 0. */ ++ *total = 0; ++ ++ /* Determine the format of each entry in `reg'. */ ++ if (grub_ieee1275_finddevice ("/", &root)) ++ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "couldn't find / node"); ++ if (grub_ieee1275_get_integer_property (root, "#address-cells", &address_cells, ++ sizeof (address_cells), 0)) ++ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "couldn't examine #address-cells"); ++ if (grub_ieee1275_get_integer_property (root, "#size-cells", &size_cells, ++ sizeof (size_cells), 0)) ++ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "couldn't examine #size-cells"); ++ ++ if (size_cells > address_cells) ++ address_cells = size_cells; ++ ++ /* Load `/memory/reg'. */ ++ if (grub_ieee1275_finddevice ("/memory", &memory)) ++ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "couldn't find /memory node"); ++ if (grub_ieee1275_get_integer_property (memory, "reg", reg, ++ sizeof (reg), ®_size)) ++ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "couldn't examine /memory/reg property"); ++ if (reg_size < 0 || (grub_size_t) reg_size > sizeof (reg)) ++ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "/memory response buffer exceeded"); ++ ++ if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_ADDRESS_CELLS)) ++ { ++ address_cells = 1; ++ size_cells = 1; ++ } ++ ++ /* Decode only the size */ ++ size = reg[address_cells]; ++ if (size_cells == 2) ++ size = (size << 32) | reg[address_cells + 1]; ++ ++ *total = size; ++ ++ return grub_errno; ++} ++ ++#if defined(__powerpc__) ++ ++/* See PAPR or arch/powerpc/kernel/prom_init.c */ ++struct option_vector2 ++{ ++ grub_uint8_t byte1; ++ grub_uint16_t reserved; ++ grub_uint32_t real_base; ++ grub_uint32_t real_size; ++ grub_uint32_t virt_base; ++ grub_uint32_t virt_size; ++ grub_uint32_t load_base; ++ grub_uint32_t min_rma; ++ grub_uint32_t min_load; ++ grub_uint8_t min_rma_percent; ++ grub_uint8_t max_pft_size; ++} GRUB_PACKED; ++ ++struct pvr_entry ++{ ++ grub_uint32_t mask; ++ grub_uint32_t entry; ++}; ++ ++struct cas_vector ++{ ++ struct ++ { ++ struct pvr_entry terminal; ++ } pvr_list; ++ grub_uint8_t num_vecs; ++ grub_uint8_t vec1_size; ++ grub_uint8_t vec1; ++ grub_uint8_t vec2_size; ++ struct option_vector2 vec2; ++ grub_uint8_t vec3_size; ++ grub_uint16_t vec3; ++ grub_uint8_t vec4_size; ++ grub_uint16_t vec4; ++} GRUB_PACKED; ++ ++/* ++ * Call ibm,client-architecture-support to try to get more RMA. ++ * We ask for 512MB which should be enough to verify a distro kernel. ++ * We ignore most errors: if we don't succeed we'll proceed with whatever ++ * memory we have. ++ */ ++static void ++grub_ieee1275_ibm_cas (void) ++{ ++ int rc; ++ grub_ieee1275_ihandle_t root; ++ struct cas_args ++ { ++ struct grub_ieee1275_common_hdr common; ++ grub_ieee1275_cell_t method; ++ grub_ieee1275_ihandle_t ihandle; ++ grub_ieee1275_cell_t cas_addr; ++ grub_ieee1275_cell_t result; ++ } args; ++ struct cas_vector vector = ++ { ++ .pvr_list = { { 0x00000000, 0xffffffff } }, /* any processor */ ++ .num_vecs = 4 - 1, ++ .vec1_size = 0, ++ .vec1 = 0x80, /* ignore */ ++ .vec2_size = 1 + sizeof (struct option_vector2) - 2, ++ .vec2 = { ++ 0, 0, -1, -1, -1, -1, -1, 512, -1, 0, 48 ++ }, ++ .vec3_size = 2 - 1, ++ .vec3 = 0x00e0, /* ask for FP + VMX + DFP but don't halt if unsatisfied */ ++ .vec4_size = 2 - 1, ++ .vec4 = 0x0001, /* set required minimum capacity % to the lowest value */ ++ }; ++ ++ INIT_IEEE1275_COMMON (&args.common, "call-method", 3, 2); ++ args.method = (grub_ieee1275_cell_t) "ibm,client-architecture-support"; ++ rc = grub_ieee1275_open ("/", &root); ++ if (rc) ++ { ++ grub_error (GRUB_ERR_IO, "could not open root when trying to call CAS"); ++ return; ++ } ++ args.ihandle = root; ++ args.cas_addr = (grub_ieee1275_cell_t) &vector; ++ ++ grub_printf ("Calling ibm,client-architecture-support from grub..."); ++ IEEE1275_CALL_ENTRY_FN (&args); ++ grub_printf ("done\n"); ++ ++ grub_ieee1275_close (root); ++} ++ ++#endif /* __powerpc__ */ ++ ++static void + grub_claim_heap (void) + { + unsigned long total = 0; + ++#if defined(__powerpc__) ++ if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY)) ++ { ++ grub_uint64_t rma_size; ++ grub_err_t err; ++ ++ err = grub_ieee1275_total_mem (&rma_size); ++ /* if we have an error, don't call CAS, just hope for the best */ ++ if (err == GRUB_ERR_NONE && rma_size < (512 * 1024 * 1024)) ++ grub_ieee1275_ibm_cas (); ++ } ++#endif ++ + grub_machine_mmap_iterate (heap_init, &total); + } + #endif +diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h +index 6a1d3e5d70..560c968460 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -138,7 +138,17 @@ enum grub_ieee1275_flag + + GRUB_IEEE1275_FLAG_RAW_DEVNAMES, + +- GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT ++ GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT, ++ ++#if defined(__powerpc__) ++ /* ++ * On PFW, the first time we boot a Linux partition, we may only get 256MB of ++ * real memory area, even if the partition has more memory. Set this flag if ++ * we think we're running under PFW. Then, if this flag is set, and the RMA is ++ * only 256MB in size, try asking for more with CAS. ++ */ ++ GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY, ++#endif + }; + + extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag); diff --git a/0314-ieee1275-drop-len-1-quirk-in-heap_init.patch b/0314-ieee1275-drop-len-1-quirk-in-heap_init.patch new file mode 100644 index 0000000..4ce064b --- /dev/null +++ b/0314-ieee1275-drop-len-1-quirk-in-heap_init.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Axtens +Date: Mon, 6 Feb 2023 10:03:21 -0500 +Subject: [PATCH] ieee1275: drop len -= 1 quirk in heap_init + +This was apparently 'required by some firmware': commit dc9468500919 +("2007-02-12 Hollis Blanchard "). + +It's not clear what firmware that was, and what platform from 14 years ago +which exhibited the bug then is still both in use and buggy now. + +It doesn't cause issues on qemu (mac99 or pseries) or under PFW for Power8. + +I don't have access to old Mac hardware, but if anyone feels especially +strongly we can put it under some feature flag. I really want to disable +it under pseries because it will mess with region merging. + +Signed-off-by: Daniel Axtens +Reviewed-by: Daniel Kiper +(cherry picked from commit fc639d430297321ee4f77c5d2d698f698cec0dc7) +--- + grub-core/kern/ieee1275/init.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index 8ae405bc79..c8d551759d 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -168,7 +168,6 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, + addr = 0x180000; + } + } +- len -= 1; /* Required for some firmware. */ + + /* Never exceed HEAP_MAX_SIZE */ + if (*total + len > HEAP_MAX_SIZE) diff --git a/0315-ieee1275-support-runtime-memory-claiming.patch b/0315-ieee1275-support-runtime-memory-claiming.patch new file mode 100644 index 0000000..17ad61d --- /dev/null +++ b/0315-ieee1275-support-runtime-memory-claiming.patch @@ -0,0 +1,435 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Axtens +Date: Mon, 6 Feb 2023 10:03:22 -0500 +Subject: [PATCH] ieee1275: support runtime memory claiming + +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 +Signed-off-by: Daniel Axtens +(cherry picked from commit a5c710789ccdd27a84ae4a34c7d453bd585e2b66) +[rharwood: _start?] +--- + grub-core/kern/ieee1275/init.c | 270 ++++++++++++++++++++++++++++++++++++++--- + docs/grub-dev.texi | 7 +- + 2 files changed, 257 insertions(+), 20 deletions(-) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index c8d551759d..85af8fa97b 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -46,13 +46,26 @@ + #endif + #include + +-/* The maximum heap size we're going to claim */ ++/* The maximum heap size we're going to claim at boot. Not used by sparc. */ + #ifdef __i386__ + #define HEAP_MAX_SIZE (unsigned long) (64 * 1024 * 1024) +-#else ++#else /* __powerpc__ */ + #define HEAP_MAX_SIZE (unsigned long) (32 * 1024 * 1024) + #endif + ++/* RMO max. address at 768 MB */ ++#define RMO_ADDR_MAX (grub_uint64_t) (768 * 1024 * 1024) ++ ++/* ++ * The amount of OF space we will not claim here so as to leave space for ++ * the loader and linux to service early allocations. ++ * ++ * In 2021, Daniel Axtens claims that we should leave at least 128MB to ++ * ensure we can load a stock kernel and initrd on a pseries guest with ++ * a 512MB real memory area under PowerVM. ++ */ ++#define RUNTIME_MIN_SPACE (128UL * 1024 * 1024) ++ + extern char _end[]; + + #ifdef __sparc__ +@@ -147,16 +160,52 @@ grub_claim_heap (void) + + GRUB_KERNEL_MACHINE_STACK_SIZE), 0x200000); + } + #else +-/* Helper for grub_claim_heap. */ ++/* Helpers for mm on powerpc. */ ++ ++/* ++ * How much memory does OF believe exists in total? ++ * ++ * This isn't necessarily the true total. It can be the total memory ++ * accessible in real mode for a pseries guest, for example. ++ */ ++static grub_uint64_t rmo_top; ++ + static int +-heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, +- void *data) ++count_free (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, ++ void *data) + { +- unsigned long *total = data; ++ if (type != GRUB_MEMORY_AVAILABLE) ++ return 0; ++ ++ /* Do not consider memory beyond 4GB */ ++ if (addr > 0xffffffffULL) ++ return 0; ++ ++ if (addr + len > 0xffffffffULL) ++ len = 0xffffffffULL - addr; ++ ++ *(grub_uint32_t *) data += len; ++ ++ return 0; ++} ++ ++static int ++regions_claim (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, ++ unsigned int flags, void *data) ++{ ++ grub_uint32_t total = *(grub_uint32_t *) data; ++ grub_uint64_t linux_rmo_save; + + if (type != GRUB_MEMORY_AVAILABLE) + return 0; + ++ /* Do not consider memory beyond 4GB */ ++ if (addr > 0xffffffffULL) ++ return 0; ++ ++ if (addr + len > 0xffffffffULL) ++ len = 0xffffffffULL - addr; ++ + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PRE1_5M_CLAIM)) + { + if (addr + len <= 0x180000) +@@ -169,10 +218,6 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, + } + } + +- /* Never exceed HEAP_MAX_SIZE */ +- if (*total + len > HEAP_MAX_SIZE) +- len = HEAP_MAX_SIZE - *total; +- + /* In theory, firmware should already prevent this from happening by not + listing our own image in /memory/available. The check below is intended + as a safeguard in case that doesn't happen. However, it doesn't protect +@@ -184,6 +229,108 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, + len = 0; + } + ++ /* ++ * Linux likes to claim memory at min(RMO top, 768MB) and works down ++ * without reference to /memory/available. (See prom_init.c::alloc_down) ++ * ++ * If this block contains min(RMO top, 768MB), do not claim below that for ++ * at least a few MB (this is where RTAS, SML and potentially TCEs live). ++ * ++ * We also need to leave enough space for the DT in the RMA. (See ++ * prom_init.c::alloc_up) ++ * ++ * Finally, we also want to make sure that when grub loads the kernel, ++ * it isn't going to use up all the memory we're trying to reserve! So ++ * enforce our entire RUNTIME_MIN_SPACE here: ++ * ++ * |---------- Top of memory ----------| ++ * | | ++ * | available | ++ * | | ++ * |---------- 768 MB ----------| ++ * | | ++ * | reserved | ++ * | | ++ * |--- 768 MB - runtime min space ---| ++ * | | ++ * | available | ++ * | | ++ * |---------- 0 MB ----------| ++ * ++ * Edge cases: ++ * ++ * - Total memory less than RUNTIME_MIN_SPACE: only claim up to HEAP_MAX_SIZE. ++ * (enforced elsewhere) ++ * ++ * - Total memory between RUNTIME_MIN_SPACE and 768MB: ++ * ++ * |---------- Top of memory ----------| ++ * | | ++ * | reserved | ++ * | | ++ * |---- top - runtime min space ----| ++ * | | ++ * | available | ++ * | | ++ * |---------- 0 MB ----------| ++ * ++ * This by itself would not leave us with RUNTIME_MIN_SPACE of free bytes: if ++ * rmo_top < 768MB, we will almost certainly have FW claims in the reserved ++ * region. We try to address that elsewhere: grub_ieee1275_mm_add_region will ++ * not call us if the resulting free space would be less than RUNTIME_MIN_SPACE. ++ */ ++ linux_rmo_save = grub_min (RMO_ADDR_MAX, rmo_top) - RUNTIME_MIN_SPACE; ++ if (rmo_top > RUNTIME_MIN_SPACE) ++ { ++ if (rmo_top <= RMO_ADDR_MAX) ++ { ++ if (addr > linux_rmo_save) ++ { ++ grub_dprintf ("ieee1275", "rejecting region in RUNTIME_MIN_SPACE reservation (%llx)\n", ++ addr); ++ return 0; ++ } ++ else if (addr + len > linux_rmo_save) ++ { ++ grub_dprintf ("ieee1275", "capping region: (%llx -> %llx) -> (%llx -> %llx)\n", ++ addr, addr + len, addr, rmo_top - RUNTIME_MIN_SPACE); ++ len = linux_rmo_save - addr; ++ } ++ } ++ else ++ { ++ /* ++ * we order these cases to prefer higher addresses and avoid some ++ * splitting issues ++ */ ++ if (addr < RMO_ADDR_MAX && (addr + len) > RMO_ADDR_MAX) ++ { ++ grub_dprintf ("ieee1275", ++ "adjusting region for RUNTIME_MIN_SPACE: (%llx -> %llx) -> (%llx -> %llx)\n", ++ addr, addr + len, RMO_ADDR_MAX, addr + len); ++ len = (addr + len) - RMO_ADDR_MAX; ++ addr = RMO_ADDR_MAX; ++ } ++ else if ((addr < linux_rmo_save) && ((addr + len) > linux_rmo_save)) ++ { ++ grub_dprintf ("ieee1275", "capping region: (%llx -> %llx) -> (%llx -> %llx)\n", ++ addr, addr + len, addr, linux_rmo_save); ++ len = linux_rmo_save - addr; ++ } ++ else if (addr >= linux_rmo_save && (addr + len) <= RMO_ADDR_MAX) ++ { ++ grub_dprintf ("ieee1275", "rejecting region in RUNTIME_MIN_SPACE reservation (%llx)\n", ++ addr); ++ return 0; ++ } ++ } ++ } ++ if (flags & GRUB_MM_ADD_REGION_CONSECUTIVE && len < total) ++ return 0; ++ ++ if (len > total) ++ len = total; ++ + if (len) + { + grub_err_t err; +@@ -192,15 +339,95 @@ heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, + if (err) + return err; + grub_mm_init_region ((void *) (grub_addr_t) addr, len); ++ total -= len; + } + +- *total += len; +- if (*total >= HEAP_MAX_SIZE) ++ *(grub_uint32_t *) data = total; ++ ++ if (total == 0) + return 1; + + return 0; + } + ++static int ++heap_init (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, ++ void *data) ++{ ++ return regions_claim (addr, len, type, GRUB_MM_ADD_REGION_NONE, data); ++} ++ ++static int ++region_claim (grub_uint64_t addr, grub_uint64_t len, grub_memory_type_t type, ++ void *data) ++{ ++ return regions_claim (addr, len, type, GRUB_MM_ADD_REGION_CONSECUTIVE, data); ++} ++ ++static grub_err_t ++grub_ieee1275_mm_add_region (grub_size_t size, unsigned int flags) ++{ ++ grub_uint32_t free_memory = 0; ++ grub_uint32_t avail = 0; ++ grub_uint32_t total; ++ ++ grub_dprintf ("ieee1275", "mm requested region of size %x, flags %x\n", ++ size, flags); ++ ++ /* ++ * Update free memory each time, which is a bit inefficient but guards us ++ * against a situation where some OF driver goes out to firmware for ++ * memory and we don't realise. ++ */ ++ grub_machine_mmap_iterate (count_free, &free_memory); ++ ++ /* Ensure we leave enough space to boot. */ ++ if (free_memory <= RUNTIME_MIN_SPACE + size) ++ { ++ grub_dprintf ("ieee1275", "Cannot satisfy allocation and retain minimum runtime space\n"); ++ return GRUB_ERR_OUT_OF_MEMORY; ++ } ++ ++ if (free_memory > RUNTIME_MIN_SPACE) ++ avail = free_memory - RUNTIME_MIN_SPACE; ++ ++ grub_dprintf ("ieee1275", "free = 0x%x available = 0x%x\n", free_memory, avail); ++ ++ if (flags & GRUB_MM_ADD_REGION_CONSECUTIVE) ++ { ++ /* first try rounding up hard for the sake of speed */ ++ total = grub_max (ALIGN_UP (size, 1024 * 1024) + 1024 * 1024, 32 * 1024 * 1024); ++ total = grub_min (avail, total); ++ ++ grub_dprintf ("ieee1275", "looking for %x bytes of memory (%x requested)\n", total, size); ++ ++ grub_machine_mmap_iterate (region_claim, &total); ++ grub_dprintf ("ieee1275", "get memory from fw %s\n", total == 0 ? "succeeded" : "failed"); ++ ++ if (total != 0) ++ { ++ total = grub_min (avail, size); ++ ++ grub_dprintf ("ieee1275", "fallback for %x bytes of memory (%x requested)\n", total, size); ++ ++ grub_machine_mmap_iterate (region_claim, &total); ++ grub_dprintf ("ieee1275", "fallback from fw %s\n", total == 0 ? "succeeded" : "failed"); ++ } ++ } ++ else ++ { ++ /* provide padding for a grub_mm_header_t and region */ ++ total = grub_min (avail, size); ++ grub_machine_mmap_iterate (heap_init, &total); ++ grub_dprintf ("ieee1275", "get noncontig memory from fw %s\n", total == 0 ? "succeeded" : "failed"); ++ } ++ ++ if (total == 0) ++ return GRUB_ERR_NONE; ++ else ++ return GRUB_ERR_OUT_OF_MEMORY; ++} ++ + /* + * How much memory does OF believe it has? (regardless of whether + * it's accessible or not) +@@ -356,17 +583,24 @@ grub_ieee1275_ibm_cas (void) + static void + grub_claim_heap (void) + { +- unsigned long total = 0; ++ grub_err_t err; ++ grub_uint32_t total = HEAP_MAX_SIZE; ++ ++ err = grub_ieee1275_total_mem (&rmo_top); ++ ++ /* ++ * If we cannot size the available memory, we can't be sure we're leaving ++ * space for the kernel, initrd and things Linux loads early in boot. So only ++ * allow further allocations from firmware on success ++ */ ++ if (err == GRUB_ERR_NONE) ++ grub_mm_add_region_fn = grub_ieee1275_mm_add_region; + + #if defined(__powerpc__) + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CAN_TRY_CAS_FOR_MORE_MEMORY)) + { +- grub_uint64_t rma_size; +- grub_err_t err; +- +- err = grub_ieee1275_total_mem (&rma_size); + /* if we have an error, don't call CAS, just hope for the best */ +- if (err == GRUB_ERR_NONE && rma_size < (512 * 1024 * 1024)) ++ if (err == GRUB_ERR_NONE && rmo_top < (512 * 1024 * 1024)) + grub_ieee1275_ibm_cas (); + } + #endif +diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi +index 7b2455a8fe..7edc5b7e2b 100644 +--- a/docs/grub-dev.texi ++++ b/docs/grub-dev.texi +@@ -1047,7 +1047,10 @@ space is limited to 4GiB. GRUB allocates pages from EFI for its heap, at most + 1.6 GiB. + + On i386-ieee1275 and powerpc-ieee1275 GRUB uses same stack as IEEE1275. +-It allocates at most 32MiB for its heap. ++ ++On i386-ieee1275 and powerpc-ieee1275, GRUB will allocate 32MiB for its heap on ++startup. It may allocate more at runtime, as long as at least 128MiB remain free ++in OpenFirmware. + + On sparc64-ieee1275 stack is 256KiB and heap is 2MiB. + +@@ -1075,7 +1078,7 @@ In short: + @item i386-qemu @tab 60 KiB @tab < 4 GiB + @item *-efi @tab ? @tab < 1.6 GiB + @item i386-ieee1275 @tab ? @tab < 32 MiB +-@item powerpc-ieee1275 @tab ? @tab < 32 MiB ++@item powerpc-ieee1275 @tab ? @tab available memory - 128MiB + @item sparc64-ieee1275 @tab 256KiB @tab 2 MiB + @item arm-uboot @tab 256KiB @tab 2 MiB + @item mips(el)-qemu_mips @tab 2MiB @tab 253 MiB diff --git a/0316-ieee1275-implement-vec5-for-cas-negotiation.patch b/0316-ieee1275-implement-vec5-for-cas-negotiation.patch new file mode 100644 index 0000000..fad39db --- /dev/null +++ b/0316-ieee1275-implement-vec5-for-cas-negotiation.patch @@ -0,0 +1,74 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Diego Domingos +Date: Mon, 6 Feb 2023 10:03:23 -0500 +Subject: [PATCH] ieee1275: implement vec5 for cas negotiation + +As a legacy support, if the vector 5 is not implemented, Power Hypervisor will +consider the max CPUs as 64 instead 256 currently supported during +client-architecture-support negotiation. + +This patch implements the vector 5 and set the MAX CPUs to 256 while setting the +others values to 0 (default). + +Signed-off-by: Diego Domingos +Acked-by: Daniel Axtens +Signed-off-by: Stefan Berger +Signed-off-by: Avnish Chouhan +(cherry picked from commit 942f19959fe7465fb52a1da39ff271a7ab704892) +--- + grub-core/kern/ieee1275/init.c | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/grub-core/kern/ieee1275/init.c b/grub-core/kern/ieee1275/init.c +index 85af8fa97b..72d4fed312 100644 +--- a/grub-core/kern/ieee1275/init.c ++++ b/grub-core/kern/ieee1275/init.c +@@ -502,6 +502,19 @@ struct option_vector2 + grub_uint8_t max_pft_size; + } GRUB_PACKED; + ++struct option_vector5 ++{ ++ grub_uint8_t byte1; ++ grub_uint8_t byte2; ++ grub_uint8_t byte3; ++ grub_uint8_t cmo; ++ grub_uint8_t associativity; ++ grub_uint8_t bin_opts; ++ grub_uint8_t micro_checkpoint; ++ grub_uint8_t reserved0; ++ grub_uint32_t max_cpus; ++} GRUB_PACKED; ++ + struct pvr_entry + { + grub_uint32_t mask; +@@ -523,6 +536,8 @@ struct cas_vector + grub_uint16_t vec3; + grub_uint8_t vec4_size; + grub_uint16_t vec4; ++ grub_uint8_t vec5_size; ++ struct option_vector5 vec5; + } GRUB_PACKED; + + /* +@@ -547,7 +562,7 @@ grub_ieee1275_ibm_cas (void) + struct cas_vector vector = + { + .pvr_list = { { 0x00000000, 0xffffffff } }, /* any processor */ +- .num_vecs = 4 - 1, ++ .num_vecs = 5 - 1, + .vec1_size = 0, + .vec1 = 0x80, /* ignore */ + .vec2_size = 1 + sizeof (struct option_vector2) - 2, +@@ -558,6 +573,10 @@ grub_ieee1275_ibm_cas (void) + .vec3 = 0x00e0, /* ask for FP + VMX + DFP but don't halt if unsatisfied */ + .vec4_size = 2 - 1, + .vec4 = 0x0001, /* set required minimum capacity % to the lowest value */ ++ .vec5_size = 1 + sizeof (struct option_vector5) - 2, ++ .vec5 = { ++ 0, 192, 0, 128, 0, 0, 0, 0, 256 ++ } + }; + + INIT_IEEE1275_COMMON (&args.common, "call-method", 3, 2); diff --git a/0214-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch b/0317-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch similarity index 80% rename from 0214-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch rename to 0317-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch index 5e3a794..02c0282 100644 --- a/0214-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch +++ b/0317-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Stefan Berger -Date: Sun, 15 Mar 2020 12:37:10 -0400 +Date: Mon, 6 Feb 2023 10:03:25 -0500 Subject: [PATCH] ibmvtpm: Add support for trusted boot using a vTPM 2.0 Add support for trusted boot using a vTPM 2.0 on the IBM IEEE1275 @@ -10,6 +10,10 @@ does. This patch requires Daniel Axtens's patches for claiming more memory. +Note: The tpm_init() function cannot be called from GRUB_MOD_INIT() since +it does not find the device nodes upon module initialization and +therefore the call to tpm_init() must be deferred to grub_tpm_measure(). + For vTPM support to work on PowerVM, system driver levels 1010.30 or 1020.00 are required. @@ -22,16 +26,19 @@ above. Cc: Eric Snowberg Signed-off-by: Stefan Berger +Signed-off-by: Daniel Axtens +Reviewed-by: Daniel Kiper +(cherry picked from commit 2aa5ef83743dfea79377309ff4f5e9c9a55de355) --- grub-core/Makefile.core.def | 7 ++ - grub-core/commands/ieee1275/ibmvtpm.c | 152 ++++++++++++++++++++++++++++++++++ + grub-core/commands/ieee1275/ibmvtpm.c | 155 ++++++++++++++++++++++++++++++++++ include/grub/ieee1275/ieee1275.h | 3 + docs/grub.texi | 3 +- - 4 files changed, 164 insertions(+), 1 deletion(-) + 4 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 grub-core/commands/ieee1275/ibmvtpm.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 741a033978..e038c5e6fd 100644 +index f21da23213..02ea718652 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1175,6 +1175,13 @@ module = { @@ -50,14 +57,14 @@ index 741a033978..e038c5e6fd 100644 common = commands/terminal.c; diff --git a/grub-core/commands/ieee1275/ibmvtpm.c b/grub-core/commands/ieee1275/ibmvtpm.c new file mode 100644 -index 0000000000..e68b8448bc +index 0000000000..239942d27e --- /dev/null +++ b/grub-core/commands/ieee1275/ibmvtpm.c -@@ -0,0 +1,152 @@ +@@ -0,0 +1,155 @@ +/* + * GRUB -- GRand Unified Bootloader -+ * Copyright (C) 2021 Free Software Foundation, Inc. -+ * Copyright (C) 2021 IBM Corporation ++ * Copyright (C) 2022 Free Software Foundation, Inc. ++ * Copyright (C) 2022 IBM Corporation + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by @@ -85,7 +92,7 @@ index 0000000000..e68b8448bc +static grub_ieee1275_ihandle_t tpm_ihandle; +static grub_uint8_t tpm_version; + -+#define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_ihandle_t)0) ++#define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_ihandle_t) 0) + +static void +tpm_get_tpm_version (void) @@ -107,10 +114,11 @@ index 0000000000..e68b8448bc + + if (!init_success) + { -+ if (grub_ieee1275_open ("/vdevice/vtpm", &tpm_ihandle) < 0) { -+ tpm_ihandle = IEEE1275_IHANDLE_INVALID; -+ return GRUB_ERR_UNKNOWN_DEVICE; -+ } ++ if (grub_ieee1275_open ("/vdevice/vtpm", &tpm_ihandle) < 0) ++ { ++ tpm_ihandle = IEEE1275_IHANDLE_INVALID; ++ return GRUB_ERR_UNKNOWN_DEVICE; ++ } + + init_success = 1; + @@ -140,8 +148,8 @@ index 0000000000..e68b8448bc + grub_ieee1275_cell_t pcrindex; + grub_ieee1275_cell_t catch_result; + grub_ieee1275_cell_t rc; -+ } -+ args; ++ }; ++ struct tpm_2hash_ext_log args; + + INIT_IEEE1275_COMMON (&args.common, "call-method", 8, 2); + args.method = (grub_ieee1275_cell_t) "2hash-ext-log"; @@ -167,22 +175,20 @@ index 0000000000..e68b8448bc +} + +static grub_err_t -+tpm2_log_event (unsigned char *buf, -+ grub_size_t size, grub_uint8_t pcr, ++tpm2_log_event (unsigned char *buf, grub_size_t size, grub_uint8_t pcr, + const char *description) +{ + static int error_displayed = 0; -+ int err; ++ int rc; + -+ err = ibmvtpm_2hash_ext_log (pcr, EV_IPL, -+ description, -+ grub_strlen(description) + 1, -+ buf, size); -+ if (err && !error_displayed) ++ rc = ibmvtpm_2hash_ext_log (pcr, EV_IPL, ++ description, grub_strlen(description) + 1, ++ buf, size); ++ if (rc && !error_displayed) + { + error_displayed++; + return grub_error (GRUB_ERR_BAD_DEVICE, -+ "2HASH-EXT-LOG failed: Firmware is likely too old.\n"); ++ "2HASH-EXT-LOG failed: Firmware is likely too old.\n"); + } + + return GRUB_ERR_NONE; @@ -192,7 +198,11 @@ index 0000000000..e68b8448bc +grub_tpm_measure (unsigned char *buf, grub_size_t size, grub_uint8_t pcr, + const char *description) +{ -+ grub_err_t err = tpm_init(); ++ /* ++ * Call tpm_init() 'late' rather than from GRUB_MOD_INIT() so that device nodes ++ * can be found. ++ */ ++ grub_err_t err = tpm_init (); + + /* Absence of a TPM isn't a failure. */ + if (err != GRUB_ERR_NONE) @@ -207,7 +217,7 @@ index 0000000000..e68b8448bc + return GRUB_ERR_NONE; +} diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index e0a6c2ce1e..f4c85265fe 100644 +index 560c968460..27b9cf259b 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -24,6 +24,9 @@ @@ -221,10 +231,10 @@ index e0a6c2ce1e..f4c85265fe 100644 { unsigned int start; diff --git a/docs/grub.texi b/docs/grub.texi -index a4da9c2a1b..c433240f34 100644 +index 1750b72ee9..825278a7f3 100644 --- a/docs/grub.texi +++ b/docs/grub.texi -@@ -6221,7 +6221,8 @@ tpm module is loaded. As such it is recommended that the tpm module be built +@@ -6235,7 +6235,8 @@ tpm module is loaded. As such it is recommended that the tpm module be built into @file{core.img} in order to avoid a potential gap in measurement between @file{core.img} being loaded and the tpm module being loaded. diff --git a/0318-powerpc-Drop-Open-Hack-Ware.patch b/0318-powerpc-Drop-Open-Hack-Ware.patch new file mode 100644 index 0000000..1d201d3 --- /dev/null +++ b/0318-powerpc-Drop-Open-Hack-Ware.patch @@ -0,0 +1,69 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Daniel Axtens +Date: Mon, 6 Sep 2021 15:46:11 +1000 +Subject: [PATCH] powerpc: Drop Open Hack'Ware + +Open Hack'Ware was an alternative firmware of powerpc under QEMU. + +The last commit to any Open Hack'Ware repo I can find is from 2014 [1]. + +Open Hack'Ware was used for the QEMU "prep" machine type, which was +deprecated in QEMU in commit 54c86f5a4844 (hw/ppc: deprecate the +machine type 'prep', replaced by '40p') in QEMU v3.1, and had reportedly +been broken for years before without anyone noticing. Support was removed +in February 2020 by commit b2ce76a0730e (hw/ppc/prep: Remove the +deprecated "prep" machine and the OpenHackware BIOS). + +Open Hack'Ware's limitations require some messy code in GRUB. This +complexity is not worth carrying any more. + +Remove detection of Open Hack'Ware. We will clean up the feature flags +in following commits. + +[1]: https://github.com/qemu/openhackware and + https://repo.or.cz/w/openhackware.git are QEMU submodules. They have + only small changes on top of OHW v0.4.1, which was imported into + QEMU SCM in 2010. I can't find anything resembling an official repo + any more. + +Signed-off-by: Daniel Axtens +Reviewed-by: Daniel Kiper +(cherry picked from commit f9ce538eec88c5cffbfde021c4e8a95a5e9d0e8f) +--- + grub-core/kern/ieee1275/cmain.c | 16 ---------------- + 1 file changed, 16 deletions(-) + +diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c +index dce7b84922..cb42f60ebe 100644 +--- a/grub-core/kern/ieee1275/cmain.c ++++ b/grub-core/kern/ieee1275/cmain.c +@@ -49,7 +49,6 @@ grub_ieee1275_find_options (void) + grub_ieee1275_phandle_t root; + grub_ieee1275_phandle_t options; + grub_ieee1275_phandle_t openprom; +- grub_ieee1275_phandle_t bootrom; + int rc; + grub_uint32_t realmode = 0; + char tmp[256]; +@@ -198,21 +197,6 @@ grub_ieee1275_find_options (void) + + grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_HAS_CURSORONOFF); + } +- +- if (! grub_ieee1275_finddevice ("/rom/boot-rom", &bootrom) +- || ! grub_ieee1275_finddevice ("/boot-rom", &bootrom)) +- { +- rc = grub_ieee1275_get_property (bootrom, "model", tmp, sizeof (tmp), 0); +- if (rc >= 0 && !grub_strncmp (tmp, "PPC Open Hack'Ware", +- sizeof ("PPC Open Hack'Ware") - 1)) +- { +- grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_BROKEN_OUTPUT); +- grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_CANNOT_SET_COLORS); +- grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET); +- grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM); +- grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_ANSI); +- } +- } + } + + void diff --git a/grub.patches b/grub.patches index ae57994..45eb553 100644 --- a/grub.patches +++ b/grub.patches @@ -172,146 +172,147 @@ Patch0171: 0171-appended-signatures-verification-tests.patch Patch0172: 0172-appended-signatures-documentation.patch Patch0173: 0173-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch Patch0174: 0174-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch -Patch0175: 0175-ieee1275-claim-more-memory.patch -Patch0176: 0176-ieee1275-request-memory-with-ibm-client-architecture.patch -Patch0177: 0177-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch -Patch0178: 0178-ieee1275-ofdisk-retry-on-open-failure.patch -Patch0179: 0179-Allow-chainloading-EFI-apps-from-loop-mounts.patch -Patch0180: 0180-efinet-Add-DHCP-proxy-support.patch -Patch0181: 0181-fs-ext2-Ignore-checksum-seed-incompat-feature.patch -Patch0182: 0182-Don-t-update-the-cmdline-when-generating-legacy-menu.patch -Patch0183: 0183-Suppress-gettext-error-message.patch -Patch0184: 0184-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch -Patch0185: 0185-templates-Check-for-EFI-at-runtime-instead-of-config.patch -Patch0186: 0186-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch -Patch0187: 0187-arm64-Fix-EFI-loader-kernel-image-allocation.patch -Patch0188: 0188-normal-main-Discover-the-device-to-read-the-config-f.patch -Patch0189: 0189-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch -Patch0190: 0190-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch -Patch0191: 0191-Print-module-name-on-license-check-failure.patch -Patch0192: 0192-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch -Patch0193: 0193-grub-mkconfig-restore-umask-for-grub.cfg.patch -Patch0194: 0194-fs-btrfs-Use-full-btrfs-bootloader-area.patch -Patch0195: 0195-Add-Fedora-location-of-DejaVu-SANS-font.patch -Patch0196: 0196-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch -Patch0197: 0197-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch -Patch0198: 0198-EFI-console-Do-not-set-colorstate-until-the-first-te.patch -Patch0199: 0199-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch -Patch0200: 0200-Use-visual-indentation-in-config.h.in.patch -Patch0201: 0201-Where-present-ensure-config-util.h-precedes-config.h.patch -Patch0202: 0202-Drop-gnulib-fix-base64.patch.patch -Patch0203: 0203-Drop-gnulib-no-abort.patch.patch -Patch0204: 0204-Update-gnulib-version-and-drop-most-gnulib-patches.patch -Patch0205: 0205-commands-search-Fix-bug-stopping-iteration-when-no-f.patch -Patch0206: 0206-search-new-efidisk-only-option-on-EFI-systems.patch -Patch0207: 0207-efi-new-connectefi-command.patch -Patch0208: 0208-grub-core-loader-i386-efi-linux.c-do-not-validate-ke.patch -Patch0209: 0209-grub-core-loader-arm64-linux.c-do-not-validate-kerne.patch -Patch0210: 0210-grub-core-loader-efi-chainloader.c-do-not-validate-c.patch -Patch0211: 0211-grub-core-loader-efi-linux.c-drop-now-unused-grub_li.patch -Patch0212: 0212-powerpc-do-CAS-in-a-more-compatible-way.patch -Patch0213: 0213-powerpc-prefix-detection-support-device-names-with-c.patch -Patch0214: 0214-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch -Patch0215: 0215-make-ofdisk_retries-optional.patch -Patch0216: 0216-loader-efi-chainloader-grub_load_and_start_image-doe.patch -Patch0217: 0217-loader-efi-chainloader-simplify-the-loader-state.patch -Patch0218: 0218-commands-boot-Add-API-to-pass-context-to-loader.patch -Patch0219: 0219-loader-efi-chainloader-Use-grub_loader_set_ex.patch -Patch0220: 0220-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch -Patch0221: 0221-loader-i386-efi-linux-Use-grub_loader_set_ex.patch -Patch0222: 0222-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch -Patch0223: 0223-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch -Patch0224: 0224-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch -Patch0225: 0225-video-readers-png-Abort-sooner-if-a-read-operation-f.patch -Patch0226: 0226-video-readers-png-Refuse-to-handle-multiple-image-he.patch -Patch0227: 0227-video-readers-png-Drop-greyscale-support-to-fix-heap.patch -Patch0228: 0228-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch -Patch0229: 0229-video-readers-png-Sanity-check-some-huffman-codes.patch -Patch0230: 0230-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch -Patch0231: 0231-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch -Patch0232: 0232-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch -Patch0233: 0233-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch -Patch0234: 0234-normal-charset-Fix-array-out-of-bounds-formatting-un.patch -Patch0235: 0235-net-netbuff-Block-overly-large-netbuff-allocs.patch -Patch0236: 0236-net-ip-Do-IP-fragment-maths-safely.patch -Patch0237: 0237-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch -Patch0238: 0238-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch -Patch0239: 0239-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch -Patch0240: 0240-net-tftp-Avoid-a-trivial-UAF.patch -Patch0241: 0241-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch -Patch0242: 0242-net-http-Fix-OOB-write-for-split-http-headers.patch -Patch0243: 0243-net-http-Error-out-on-headers-with-LF-without-CR.patch -Patch0244: 0244-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch -Patch0245: 0245-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch -Patch0246: 0246-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch -Patch0247: 0247-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch -Patch0248: 0248-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch -Patch0249: 0249-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch -Patch0250: 0250-misc-Make-grub_min-and-grub_max-more-resilient.patch -Patch0251: 0251-ReiserFS-switch-to-using-grub_min-grub_max.patch -Patch0252: 0252-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch -Patch0253: 0253-modules-make-.module_license-read-only.patch -Patch0254: 0254-modules-strip-.llvm_addrsig-sections-and-similar.patch -Patch0255: 0255-modules-Don-t-allocate-space-for-non-allocable-secti.patch -Patch0256: 0256-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch -Patch0257: 0257-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch -Patch0258: 0258-modules-load-module-sections-at-page-aligned-address.patch -Patch0259: 0259-nx-add-memory-attribute-get-set-API.patch -Patch0260: 0260-nx-set-page-permissions-for-loaded-modules.patch -Patch0261: 0261-nx-set-attrs-in-our-kernel-loaders.patch -Patch0262: 0262-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch -Patch0263: 0263-grub-probe-document-the-behavior-of-multiple-v.patch -Patch0264: 0264-grub_fs_probe-dprint-errors-from-filesystems.patch -Patch0265: 0265-fs-fat-don-t-error-when-mtime-is-0.patch -Patch0266: 0266-Make-debug-file-show-which-file-filters-get-run.patch -Patch0267: 0267-efi-use-enumerated-array-positions-for-our-allocatio.patch -Patch0268: 0268-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch -Patch0269: 0269-efi-allocate-the-initrd-within-the-bounds-expressed-.patch -Patch0270: 0270-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch -Patch0271: 0271-BLS-create-etc-kernel-cmdline-during-mkconfig.patch -Patch0272: 0272-squish-don-t-dup-rhgb-quiet-check-mtimes.patch -Patch0273: 0273-squish-give-up-on-rhgb-quiet.patch -Patch0274: 0274-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch -Patch0275: 0275-ieee1275-implement-vec5-for-cas-negotiation.patch -Patch0276: 0276-blscfg-Don-t-root-device-in-emu-builds.patch -Patch0277: 0277-loader-arm64-linux-Remove-magic-number-header-field-.patch -Patch0278: 0278-Correct-BSS-zeroing-on-aarch64.patch -Patch0279: 0279-linuxefi-Invalidate-i-cache-before-starting-the-kern.patch -Patch0280: 0280-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch -Patch0281: 0281-commands-efi-tpm-Refine-the-status-of-log-event.patch -Patch0282: 0282-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch -Patch0283: 0283-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch -Patch0284: 0284-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch -Patch0285: 0285-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch -Patch0286: 0286-font-Fix-several-integer-overflows-in-grub_font_cons.patch -Patch0287: 0287-font-Remove-grub_font_dup_glyph.patch -Patch0288: 0288-font-Fix-integer-overflow-in-ensure_comb_space.patch -Patch0289: 0289-font-Fix-integer-overflow-in-BMP-index.patch -Patch0290: 0290-font-Fix-integer-underflow-in-binary-search-of-char-.patch -Patch0291: 0291-kern-efi-sb-Enforce-verification-of-font-files.patch -Patch0292: 0292-fbutil-Fix-integer-overflow.patch -Patch0293: 0293-font-Fix-an-integer-underflow-in-blit_comb.patch -Patch0294: 0294-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch -Patch0295: 0295-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch -Patch0296: 0296-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch -Patch0297: 0297-font-Try-opening-fonts-from-the-bundled-memdisk.patch -Patch0298: 0298-Correction-in-vector-5-values.patch -Patch0299: 0299-mm-Clarify-grub_real_malloc.patch -Patch0300: 0300-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch -Patch0301: 0301-mm-Document-grub_free.patch -Patch0302: 0302-mm-Document-grub_mm_init_region.patch -Patch0303: 0303-mm-Document-GRUB-internal-memory-management-structur.patch -Patch0304: 0304-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch -Patch0305: 0305-mm-When-adding-a-region-merge-with-region-after-as-w.patch -Patch0306: 0306-mm-Debug-support-for-region-operations.patch -Patch0307: 0307-mm-Drop-unused-unloading-of-modules-on-OOM.patch -Patch0308: 0308-mm-Allow-dynamically-requesting-additional-memory-re.patch -Patch0309: 0309-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch -Patch0310: 0310-kern-efi-mm-Extract-function-to-add-memory-regions.patch -Patch0311: 0311-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch -Patch0312: 0312-kern-efi-mm-Implement-runtime-addition-of-pages.patch -Patch0313: 0313-efi-Increase-default-memory-allocation-to-32-MiB.patch -Patch0314: 0314-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch -Patch0315: 0315-ppc64le-signed-boot-media-changes.patch -Patch0316: 0316-core-Fix-several-implicit-function-declarations.patch -Patch0317: 0317-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch +Patch0175: 0175-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch +Patch0176: 0176-ieee1275-ofdisk-retry-on-open-failure.patch +Patch0177: 0177-Allow-chainloading-EFI-apps-from-loop-mounts.patch +Patch0178: 0178-efinet-Add-DHCP-proxy-support.patch +Patch0179: 0179-fs-ext2-Ignore-checksum-seed-incompat-feature.patch +Patch0180: 0180-Don-t-update-the-cmdline-when-generating-legacy-menu.patch +Patch0181: 0181-Suppress-gettext-error-message.patch +Patch0182: 0182-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch +Patch0183: 0183-templates-Check-for-EFI-at-runtime-instead-of-config.patch +Patch0184: 0184-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch +Patch0185: 0185-arm64-Fix-EFI-loader-kernel-image-allocation.patch +Patch0186: 0186-normal-main-Discover-the-device-to-read-the-config-f.patch +Patch0187: 0187-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch +Patch0188: 0188-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch +Patch0189: 0189-Print-module-name-on-license-check-failure.patch +Patch0190: 0190-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch +Patch0191: 0191-grub-mkconfig-restore-umask-for-grub.cfg.patch +Patch0192: 0192-fs-btrfs-Use-full-btrfs-bootloader-area.patch +Patch0193: 0193-Add-Fedora-location-of-DejaVu-SANS-font.patch +Patch0194: 0194-normal-menu-Don-t-show-Booting-s-msg-when-auto-booti.patch +Patch0195: 0195-EFI-suppress-the-Welcome-to-GRUB-message-in-EFI-buil.patch +Patch0196: 0196-EFI-console-Do-not-set-colorstate-until-the-first-te.patch +Patch0197: 0197-EFI-console-Do-not-set-cursor-until-the-first-text-o.patch +Patch0198: 0198-Use-visual-indentation-in-config.h.in.patch +Patch0199: 0199-Where-present-ensure-config-util.h-precedes-config.h.patch +Patch0200: 0200-Drop-gnulib-fix-base64.patch.patch +Patch0201: 0201-Drop-gnulib-no-abort.patch.patch +Patch0202: 0202-Update-gnulib-version-and-drop-most-gnulib-patches.patch +Patch0203: 0203-commands-search-Fix-bug-stopping-iteration-when-no-f.patch +Patch0204: 0204-search-new-efidisk-only-option-on-EFI-systems.patch +Patch0205: 0205-efi-new-connectefi-command.patch +Patch0206: 0206-grub-core-loader-i386-efi-linux.c-do-not-validate-ke.patch +Patch0207: 0207-grub-core-loader-arm64-linux.c-do-not-validate-kerne.patch +Patch0208: 0208-grub-core-loader-efi-chainloader.c-do-not-validate-c.patch +Patch0209: 0209-grub-core-loader-efi-linux.c-drop-now-unused-grub_li.patch +Patch0210: 0210-powerpc-prefix-detection-support-device-names-with-c.patch +Patch0211: 0211-make-ofdisk_retries-optional.patch +Patch0212: 0212-loader-efi-chainloader-grub_load_and_start_image-doe.patch +Patch0213: 0213-loader-efi-chainloader-simplify-the-loader-state.patch +Patch0214: 0214-commands-boot-Add-API-to-pass-context-to-loader.patch +Patch0215: 0215-loader-efi-chainloader-Use-grub_loader_set_ex.patch +Patch0216: 0216-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch +Patch0217: 0217-loader-i386-efi-linux-Use-grub_loader_set_ex.patch +Patch0218: 0218-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch +Patch0219: 0219-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch +Patch0220: 0220-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch +Patch0221: 0221-video-readers-png-Abort-sooner-if-a-read-operation-f.patch +Patch0222: 0222-video-readers-png-Refuse-to-handle-multiple-image-he.patch +Patch0223: 0223-video-readers-png-Drop-greyscale-support-to-fix-heap.patch +Patch0224: 0224-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch +Patch0225: 0225-video-readers-png-Sanity-check-some-huffman-codes.patch +Patch0226: 0226-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch +Patch0227: 0227-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch +Patch0228: 0228-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch +Patch0229: 0229-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch +Patch0230: 0230-normal-charset-Fix-array-out-of-bounds-formatting-un.patch +Patch0231: 0231-net-netbuff-Block-overly-large-netbuff-allocs.patch +Patch0232: 0232-net-ip-Do-IP-fragment-maths-safely.patch +Patch0233: 0233-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch +Patch0234: 0234-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch +Patch0235: 0235-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch +Patch0236: 0236-net-tftp-Avoid-a-trivial-UAF.patch +Patch0237: 0237-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch +Patch0238: 0238-net-http-Fix-OOB-write-for-split-http-headers.patch +Patch0239: 0239-net-http-Error-out-on-headers-with-LF-without-CR.patch +Patch0240: 0240-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch +Patch0241: 0241-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch +Patch0242: 0242-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch +Patch0243: 0243-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch +Patch0244: 0244-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch +Patch0245: 0245-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch +Patch0246: 0246-misc-Make-grub_min-and-grub_max-more-resilient.patch +Patch0247: 0247-ReiserFS-switch-to-using-grub_min-grub_max.patch +Patch0248: 0248-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch +Patch0249: 0249-modules-make-.module_license-read-only.patch +Patch0250: 0250-modules-strip-.llvm_addrsig-sections-and-similar.patch +Patch0251: 0251-modules-Don-t-allocate-space-for-non-allocable-secti.patch +Patch0252: 0252-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch +Patch0253: 0253-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch +Patch0254: 0254-modules-load-module-sections-at-page-aligned-address.patch +Patch0255: 0255-nx-add-memory-attribute-get-set-API.patch +Patch0256: 0256-nx-set-page-permissions-for-loaded-modules.patch +Patch0257: 0257-nx-set-attrs-in-our-kernel-loaders.patch +Patch0258: 0258-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch +Patch0259: 0259-grub-probe-document-the-behavior-of-multiple-v.patch +Patch0260: 0260-grub_fs_probe-dprint-errors-from-filesystems.patch +Patch0261: 0261-fs-fat-don-t-error-when-mtime-is-0.patch +Patch0262: 0262-Make-debug-file-show-which-file-filters-get-run.patch +Patch0263: 0263-efi-use-enumerated-array-positions-for-our-allocatio.patch +Patch0264: 0264-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch +Patch0265: 0265-efi-allocate-the-initrd-within-the-bounds-expressed-.patch +Patch0266: 0266-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch +Patch0267: 0267-BLS-create-etc-kernel-cmdline-during-mkconfig.patch +Patch0268: 0268-squish-don-t-dup-rhgb-quiet-check-mtimes.patch +Patch0269: 0269-squish-give-up-on-rhgb-quiet.patch +Patch0270: 0270-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch +Patch0271: 0271-blscfg-Don-t-root-device-in-emu-builds.patch +Patch0272: 0272-loader-arm64-linux-Remove-magic-number-header-field-.patch +Patch0273: 0273-Correct-BSS-zeroing-on-aarch64.patch +Patch0274: 0274-linuxefi-Invalidate-i-cache-before-starting-the-kern.patch +Patch0275: 0275-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch +Patch0276: 0276-commands-efi-tpm-Refine-the-status-of-log-event.patch +Patch0277: 0277-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch +Patch0278: 0278-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch +Patch0279: 0279-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch +Patch0280: 0280-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch +Patch0281: 0281-font-Fix-several-integer-overflows-in-grub_font_cons.patch +Patch0282: 0282-font-Remove-grub_font_dup_glyph.patch +Patch0283: 0283-font-Fix-integer-overflow-in-ensure_comb_space.patch +Patch0284: 0284-font-Fix-integer-overflow-in-BMP-index.patch +Patch0285: 0285-font-Fix-integer-underflow-in-binary-search-of-char-.patch +Patch0286: 0286-kern-efi-sb-Enforce-verification-of-font-files.patch +Patch0287: 0287-fbutil-Fix-integer-overflow.patch +Patch0288: 0288-font-Fix-an-integer-underflow-in-blit_comb.patch +Patch0289: 0289-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch +Patch0290: 0290-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch +Patch0291: 0291-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch +Patch0292: 0292-font-Try-opening-fonts-from-the-bundled-memdisk.patch +Patch0293: 0293-mm-Clarify-grub_real_malloc.patch +Patch0294: 0294-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch +Patch0295: 0295-mm-Document-grub_free.patch +Patch0296: 0296-mm-Document-grub_mm_init_region.patch +Patch0297: 0297-mm-Document-GRUB-internal-memory-management-structur.patch +Patch0298: 0298-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch +Patch0299: 0299-mm-When-adding-a-region-merge-with-region-after-as-w.patch +Patch0300: 0300-mm-Debug-support-for-region-operations.patch +Patch0301: 0301-mm-Drop-unused-unloading-of-modules-on-OOM.patch +Patch0302: 0302-mm-Allow-dynamically-requesting-additional-memory-re.patch +Patch0303: 0303-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch +Patch0304: 0304-kern-efi-mm-Extract-function-to-add-memory-regions.patch +Patch0305: 0305-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch +Patch0306: 0306-kern-efi-mm-Implement-runtime-addition-of-pages.patch +Patch0307: 0307-efi-Increase-default-memory-allocation-to-32-MiB.patch +Patch0308: 0308-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch +Patch0309: 0309-ppc64le-signed-boot-media-changes.patch +Patch0310: 0310-core-Fix-several-implicit-function-declarations.patch +Patch0311: 0311-loader-Add-support-for-grub-emu-to-kexec-Linux-menu-.patch +Patch0312: 0312-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch +Patch0313: 0313-ieee1275-request-memory-with-ibm-client-architecture.patch +Patch0314: 0314-ieee1275-drop-len-1-quirk-in-heap_init.patch +Patch0315: 0315-ieee1275-support-runtime-memory-claiming.patch +Patch0316: 0316-ieee1275-implement-vec5-for-cas-negotiation.patch +Patch0317: 0317-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch +Patch0318: 0318-powerpc-Drop-Open-Hack-Ware.patch diff --git a/grub2.spec b/grub2.spec index d4fa238..1367fe6 100644 --- a/grub2.spec +++ b/grub2.spec @@ -17,7 +17,7 @@ Name: grub2 Epoch: 1 Version: 2.06 -Release: 84%{?dist} +Release: 85%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -544,6 +544,9 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog +* Wed Feb 08 2023 Robbie Harwood - 2.06-85 +- ppc64le: sync cas/tpm patchset with upstream + * Mon Feb 06 2023 Robbie Harwood - 2.06-84 - emu: support newer kexec syscall