From 5ad247ff668f0a9e659c6549b6a2d38cd84002cf Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Wed, 8 Feb 2023 20:08:58 +0000 Subject: [PATCH] ppc64le: sync cas/tpm patchset with upstream Resolves: #2143420 Signed-off-by: Robbie Harwood --- ...video-support-for-IBM-power-machines.patch | 8 +- ...-Also-handle-the-Extended-Key-Usage-.patch | 6 +- 0199-ieee1275-claim-more-memory.patch | 252 ---------- ...eee1275-ofdisk-retry-on-open-failure.patch | 4 +- ...-memory-with-ibm-client-architecture.patch | 268 ----------- ...nu_auto_hide.in-fix-a-then-than-typo.patch | 2 +- ... => 0202-Fix-disabling-grub-rpm-sort.patch | 4 +- ...-Don-t-check-for-rpmvercmp-in-librpm.patch | 2 +- ...ainloading-EFI-apps-from-loop-mounts.patch | 6 +- ...> 0205-efinet-Add-DHCP-proxy-support.patch | 2 +- ...gnore-checksum-seed-incompat-feature.patch | 2 +- ...-cmdline-when-generating-legacy-menu.patch | 2 +- ... 0208-Suppress-gettext-error-message.patch | 2 +- ...s.timer-Only-run-if-not-in-a-contain.patch | 2 +- ...d-Always-use-boot-grub2-user.cfg-as-.patch | 2 +- ...Remove-outdated-URL-for-BLS-document.patch | 2 +- ...for-EFI-at-runtime-instead-of-config.patch | 2 +- ...or-if-boot-to-firmware-setup-is-not-.patch | 2 +- ...x-EFI-loader-kernel-image-allocation.patch | 2 +- ...over-the-device-to-read-the-config-f.patch | 2 +- ...etting-of-prefix-for-signed-binary-c.patch | 2 +- ...ix-signed-grub-special-case-for-Powe.patch | 2 +- ...r-the-PE-magic-for-the-compiled-arch.patch | 6 +- ...adable-filesystem-with-v4-superblock.patch | 2 +- ...module-name-on-license-check-failure.patch | 2 +- ...pc-ieee1275-load-grub-at-4MB-not-2MB.patch | 4 +- ...-mkconfig-restore-umask-for-grub.cfg.patch | 2 +- ...Fix-bug-stopping-iteration-when-no-f.patch | 2 +- ...w-efidisk-only-option-on-EFI-systems.patch | 6 +- ...h => 0225-efi-new-connectefi-command.patch | 16 +- ...etection-support-device-names-with-c.patch | 0 ...=> 0227-make-ofdisk_retries-optional.patch | 0 ...loader-grub_load_and_start_image-doe.patch | 0 ...erpc-do-CAS-in-a-more-compatible-way.patch | 111 ----- ...hainloader-simplify-the-loader-state.patch | 0 ...ot-Add-API-to-pass-context-to-loader.patch | 0 ...i-chainloader-Use-grub_loader_set_ex.patch | 0 ...linux-Avoid-a-use-after-free-in-the-.patch | 0 ...386-efi-linux-Use-grub_loader_set_ex.patch | 0 ...linux-Fix-a-memory-leak-in-the-initr.patch | 0 ...ct-non-kernel-files-in-the-shim_lock.patch | 0 ...-leak-device_name-on-error-in-grub_f.patch | 0 ...g-Abort-sooner-if-a-read-operation-f.patch | 0 ...g-Refuse-to-handle-multiple-image-he.patch | 0 ...g-Drop-greyscale-support-to-fix-heap.patch | 0 ...g-Avoid-heap-OOB-R-W-inserting-huff-.patch | 0 ...-png-Sanity-check-some-huffman-codes.patch | 0 ...eg-Abort-sooner-if-a-read-operation-.patch | 0 ...eg-Do-not-reallocate-a-given-huff-ta.patch | 0 ...eg-Refuse-to-handle-multiple-start-o.patch | 0 ...eg-Block-int-underflow-wild-pointer-.patch | 0 ...ix-array-out-of-bounds-formatting-un.patch | 0 ...ff-Block-overly-large-netbuff-allocs.patch | 0 ...8-net-ip-Do-IP-fragment-maths-safely.patch | 0 ...le-free-addresses-on-corrupt-DNS-res.patch | 0 ...ad-past-the-end-of-the-string-we-re-.patch | 0 ...-a-UAF-and-double-free-from-a-failed.patch | 0 ...=> 0252-net-tftp-Avoid-a-trivial-UAF.patch | 0 ...tear-down-socket-if-it-s-already-bee.patch | 0 ...Fix-OOB-write-for-split-http-headers.patch | 0 ...or-out-on-headers-with-LF-without-CR.patch | 0 ...ead-past-the-end-of-nat-journal-entr.patch | 0 ...-not-read-past-the-end-of-nat-bitmap.patch | 0 ...ot-copy-file-names-that-are-too-long.patch | 0 ...eral-fuzz-issues-with-invalid-dir-it.patch | 0 ...e-ASAN-and-SEGV-issues-found-with-fu.patch | 0 ...x-more-fuzz-issues-related-to-chunks.patch | 0 ...grub_min-and-grub_max-more-resilient.patch | 0 ...FS-switch-to-using-grub_min-grub_max.patch | 0 ...oot_time-also-call-grub_dprintf-boot.patch | 0 ...dules-make-.module_license-read-only.patch | 0 ...p-.llvm_addrsig-sections-and-similar.patch | 0 ...locate-space-for-non-allocable-secti.patch | 0 ...eader-struct-and-fix-some-bad-naming.patch | 0 ...nel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch | 0 ...ule-sections-at-page-aligned-address.patch | 2 +- ...-nx-add-memory-attribute-get-set-API.patch | 0 ...-page-permissions-for-loaded-modules.patch | 0 ...3-nx-set-attrs-in-our-kernel-loaders.patch | 0 ...x-compatible-flag-in-EFI-grub-images.patch | 0 ...file-show-which-file-filters-get-run.patch | 0 ...ed-array-positions-for-our-allocatio.patch | 0 ...tion-policy-for-kernel-vs-initrd-mem.patch | 0 ...-initrd-within-the-bounds-expressed-.patch | 0 ...ER_-CODE-DATA-for-kernel-and-initrd-.patch | 0 ...e-etc-kernel-cmdline-during-mkconfig.patch | 0 ...sh-don-t-dup-rhgb-quiet-check-mtimes.patch | 0 ...=> 0282-squish-give-up-on-rhgb-quiet.patch | 0 ...write-etc-kernel-cmdline-if-writable.patch | 0 ...ncorrect-array-size-in-kernel-alloca.patch | 0 ...i-tpm-Refine-the-status-of-log-event.patch | 0 ...5-implement-vec5-for-cas-negotiation.patch | 71 --- ...-Use-grub_strcpy-instead-of-grub_mem.patch | 0 ...-EFI_CC_MEASUREMENT_PROTOCOL-support.patch | 0 ...hs-exceeds-font-max_glyph_width-or-f.patch | 0 ...erflow-in-grub_font_get_glyph_intern.patch | 0 ...-integer-overflows-in-grub_font_cons.patch | 0 ...0291-font-Remove-grub_font_dup_glyph.patch | 0 ...nteger-overflow-in-ensure_comb_space.patch | 0 ...nt-Fix-integer-overflow-in-BMP-index.patch | 0 ...-underflow-in-binary-search-of-char-.patch | 0 ...b-Enforce-verification-of-font-files.patch | 0 ... => 0296-fbutil-Fix-integer-overflow.patch | 0 ...ix-an-integer-underflow-in-blit_comb.patch | 0 ..._font_blit_glyph-and-grub_font_blit_.patch | 0 ...l_font-to-glyphs-in-ascii_font_glyph.patch | 0 ...ix-an-integer-overflow-in-grub_unico.patch | 0 ...01-ppc64le-signed-boot-media-changes.patch | 0 ... => 0302-mm-Clarify-grub_real_malloc.patch | 0 ...loc-Make-small-allocs-comment-match-.patch | 0 ....patch => 0304-mm-Document-grub_free.patch | 0 ...0305-mm-Document-grub_mm_init_region.patch | 0 ...-internal-memory-management-structur.patch | 0 ...e-preserve-header-vs-region-alignmen.patch | 0 ...-region-merge-with-region-after-as-w.patch | 0 ...-Debug-support-for-region-operations.patch | 0 ...p-unused-unloading-of-modules-on-OOM.patch | 0 ...ally-requesting-additional-memory-re.patch | 0 ...ys-request-a-fixed-number-of-pages-o.patch | 0 ...tract-function-to-add-memory-regions.patch | 0 ...ss-up-errors-from-add_memory_regions.patch | 0 ...-Implement-runtime-addition-of-pages.patch | 0 ...-default-memory-allocation-to-32-MiB.patch | 0 ...e-disk-caches-last-when-out-of-memor.patch | 0 ...n-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch | 111 +++++ ...-memory-with-ibm-client-architecture.patch | 307 ++++++++++++ ...ee1275-drop-len-1-quirk-in-heap_init.patch | 36 ++ ...1275-support-runtime-memory-claiming.patch | 435 ++++++++++++++++++ ...5-implement-vec5-for-cas-negotiation.patch | 74 +++ ...le-shared-processor-mode-in-vector-5.patch | 27 -- ...ort-for-trusted-boot-using-a-vTPM-2..patch | 61 +-- 0324-powerpc-Drop-Open-Hack-Ware.patch | 69 +++ grub.patches | 251 +++++----- grub2.spec | 6 +- 134 files changed, 1248 insertions(+), 931 deletions(-) rename 0201-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch => 0199-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch (99%) delete mode 100644 0199-ieee1275-claim-more-memory.patch rename 0202-ieee1275-ofdisk-retry-on-open-failure.patch => 0200-ieee1275-ofdisk-retry-on-open-failure.patch (97%) delete mode 100644 0200-ieee1275-request-memory-with-ibm-client-architecture.patch rename 0203-01_menu_auto_hide.in-fix-a-then-than-typo.patch => 0201-01_menu_auto_hide.in-fix-a-then-than-typo.patch (96%) rename 0204-Fix-disabling-grub-rpm-sort.patch => 0202-Fix-disabling-grub-rpm-sort.patch (96%) rename 0205-Don-t-check-for-rpmvercmp-in-librpm.patch => 0203-Don-t-check-for-rpmvercmp-in-librpm.patch (97%) rename 0206-Allow-chainloading-EFI-apps-from-loop-mounts.patch => 0204-Allow-chainloading-EFI-apps-from-loop-mounts.patch (97%) rename 0207-efinet-Add-DHCP-proxy-support.patch => 0205-efinet-Add-DHCP-proxy-support.patch (98%) rename 0208-fs-ext2-Ignore-checksum-seed-incompat-feature.patch => 0206-fs-ext2-Ignore-checksum-seed-incompat-feature.patch (98%) rename 0209-Don-t-update-the-cmdline-when-generating-legacy-menu.patch => 0207-Don-t-update-the-cmdline-when-generating-legacy-menu.patch (97%) rename 0210-Suppress-gettext-error-message.patch => 0208-Suppress-gettext-error-message.patch (96%) rename 0211-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch => 0209-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch (97%) rename 0212-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch => 0210-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch (97%) rename 0213-Remove-outdated-URL-for-BLS-document.patch => 0211-Remove-outdated-URL-for-BLS-document.patch (96%) rename 0214-templates-Check-for-EFI-at-runtime-instead-of-config.patch => 0212-templates-Check-for-EFI-at-runtime-instead-of-config.patch (98%) rename 0215-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch => 0213-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch (98%) rename 0216-arm64-Fix-EFI-loader-kernel-image-allocation.patch => 0214-arm64-Fix-EFI-loader-kernel-image-allocation.patch (99%) rename 0217-normal-main-Discover-the-device-to-read-the-config-f.patch => 0215-normal-main-Discover-the-device-to-read-the-config-f.patch (98%) rename 0218-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch => 0216-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch (98%) rename 0219-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch => 0217-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch (97%) rename 0220-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch => 0218-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch (95%) rename 0221-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch => 0219-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch (99%) rename 0222-Print-module-name-on-license-check-failure.patch => 0220-Print-module-name-on-license-check-failure.patch (98%) rename 0223-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch => 0221-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch (98%) rename 0224-grub-mkconfig-restore-umask-for-grub.cfg.patch => 0222-grub-mkconfig-restore-umask-for-grub.cfg.patch (97%) rename 0225-commands-search-Fix-bug-stopping-iteration-when-no-f.patch => 0223-commands-search-Fix-bug-stopping-iteration-when-no-f.patch (97%) rename 0226-search-new-efidisk-only-option-on-EFI-systems.patch => 0224-search-new-efidisk-only-option-on-EFI-systems.patch (98%) rename 0227-efi-new-connectefi-command.patch => 0225-efi-new-connectefi-command.patch (97%) rename 0229-powerpc-prefix-detection-support-device-names-with-c.patch => 0226-powerpc-prefix-detection-support-device-names-with-c.patch (100%) rename 0231-make-ofdisk_retries-optional.patch => 0227-make-ofdisk_retries-optional.patch (100%) rename 0232-loader-efi-chainloader-grub_load_and_start_image-doe.patch => 0228-loader-efi-chainloader-grub_load_and_start_image-doe.patch (100%) delete mode 100644 0228-powerpc-do-CAS-in-a-more-compatible-way.patch rename 0233-loader-efi-chainloader-simplify-the-loader-state.patch => 0229-loader-efi-chainloader-simplify-the-loader-state.patch (100%) rename 0234-commands-boot-Add-API-to-pass-context-to-loader.patch => 0230-commands-boot-Add-API-to-pass-context-to-loader.patch (100%) rename 0235-loader-efi-chainloader-Use-grub_loader_set_ex.patch => 0231-loader-efi-chainloader-Use-grub_loader_set_ex.patch (100%) rename 0236-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch => 0232-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch (100%) rename 0237-loader-i386-efi-linux-Use-grub_loader_set_ex.patch => 0233-loader-i386-efi-linux-Use-grub_loader_set_ex.patch (100%) rename 0238-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch => 0234-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch (100%) rename 0239-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch => 0235-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch (100%) rename 0240-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch => 0236-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch (100%) rename 0241-video-readers-png-Abort-sooner-if-a-read-operation-f.patch => 0237-video-readers-png-Abort-sooner-if-a-read-operation-f.patch (100%) rename 0242-video-readers-png-Refuse-to-handle-multiple-image-he.patch => 0238-video-readers-png-Refuse-to-handle-multiple-image-he.patch (100%) rename 0243-video-readers-png-Drop-greyscale-support-to-fix-heap.patch => 0239-video-readers-png-Drop-greyscale-support-to-fix-heap.patch (100%) rename 0244-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch => 0240-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch (100%) rename 0245-video-readers-png-Sanity-check-some-huffman-codes.patch => 0241-video-readers-png-Sanity-check-some-huffman-codes.patch (100%) rename 0246-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch => 0242-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch (100%) rename 0247-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch => 0243-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch (100%) rename 0248-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch => 0244-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch (100%) rename 0249-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch => 0245-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch (100%) rename 0250-normal-charset-Fix-array-out-of-bounds-formatting-un.patch => 0246-normal-charset-Fix-array-out-of-bounds-formatting-un.patch (100%) rename 0251-net-netbuff-Block-overly-large-netbuff-allocs.patch => 0247-net-netbuff-Block-overly-large-netbuff-allocs.patch (100%) rename 0252-net-ip-Do-IP-fragment-maths-safely.patch => 0248-net-ip-Do-IP-fragment-maths-safely.patch (100%) rename 0253-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch => 0249-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch (100%) rename 0254-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch => 0250-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch (100%) rename 0255-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch => 0251-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch (100%) rename 0256-net-tftp-Avoid-a-trivial-UAF.patch => 0252-net-tftp-Avoid-a-trivial-UAF.patch (100%) rename 0257-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch => 0253-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch (100%) rename 0258-net-http-Fix-OOB-write-for-split-http-headers.patch => 0254-net-http-Fix-OOB-write-for-split-http-headers.patch (100%) rename 0259-net-http-Error-out-on-headers-with-LF-without-CR.patch => 0255-net-http-Error-out-on-headers-with-LF-without-CR.patch (100%) rename 0260-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch => 0256-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch (100%) rename 0261-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch => 0257-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch (100%) rename 0262-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch => 0258-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch (100%) rename 0263-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch => 0259-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch (100%) rename 0264-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch => 0260-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch (100%) rename 0265-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch => 0261-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch (100%) rename 0266-misc-Make-grub_min-and-grub_max-more-resilient.patch => 0262-misc-Make-grub_min-and-grub_max-more-resilient.patch (100%) rename 0267-ReiserFS-switch-to-using-grub_min-grub_max.patch => 0263-ReiserFS-switch-to-using-grub_min-grub_max.patch (100%) rename 0268-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch => 0264-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch (100%) rename 0269-modules-make-.module_license-read-only.patch => 0265-modules-make-.module_license-read-only.patch (100%) rename 0270-modules-strip-.llvm_addrsig-sections-and-similar.patch => 0266-modules-strip-.llvm_addrsig-sections-and-similar.patch (100%) rename 0271-modules-Don-t-allocate-space-for-non-allocable-secti.patch => 0267-modules-Don-t-allocate-space-for-non-allocable-secti.patch (100%) rename 0272-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch => 0268-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch (100%) rename 0273-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch => 0269-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch (100%) rename 0274-modules-load-module-sections-at-page-aligned-address.patch => 0270-modules-load-module-sections-at-page-aligned-address.patch (99%) rename 0275-nx-add-memory-attribute-get-set-API.patch => 0271-nx-add-memory-attribute-get-set-API.patch (100%) rename 0276-nx-set-page-permissions-for-loaded-modules.patch => 0272-nx-set-page-permissions-for-loaded-modules.patch (100%) rename 0277-nx-set-attrs-in-our-kernel-loaders.patch => 0273-nx-set-attrs-in-our-kernel-loaders.patch (100%) rename 0278-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch => 0274-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch (100%) rename 0279-Make-debug-file-show-which-file-filters-get-run.patch => 0275-Make-debug-file-show-which-file-filters-get-run.patch (100%) rename 0280-efi-use-enumerated-array-positions-for-our-allocatio.patch => 0276-efi-use-enumerated-array-positions-for-our-allocatio.patch (100%) rename 0281-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch => 0277-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch (100%) rename 0282-efi-allocate-the-initrd-within-the-bounds-expressed-.patch => 0278-efi-allocate-the-initrd-within-the-bounds-expressed-.patch (100%) rename 0283-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch => 0279-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch (100%) rename 0284-BLS-create-etc-kernel-cmdline-during-mkconfig.patch => 0280-BLS-create-etc-kernel-cmdline-during-mkconfig.patch (100%) rename 0286-squish-don-t-dup-rhgb-quiet-check-mtimes.patch => 0281-squish-don-t-dup-rhgb-quiet-check-mtimes.patch (100%) rename 0287-squish-give-up-on-rhgb-quiet.patch => 0282-squish-give-up-on-rhgb-quiet.patch (100%) rename 0288-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch => 0283-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch (100%) rename 0289-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch => 0284-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch (100%) rename 0290-commands-efi-tpm-Refine-the-status-of-log-event.patch => 0285-commands-efi-tpm-Refine-the-status-of-log-event.patch (100%) delete mode 100644 0285-ieee1275-implement-vec5-for-cas-negotiation.patch rename 0291-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch => 0286-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch (100%) rename 0292-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch => 0287-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch (100%) rename 0293-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch => 0288-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch (100%) rename 0294-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch => 0289-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch (100%) rename 0295-font-Fix-several-integer-overflows-in-grub_font_cons.patch => 0290-font-Fix-several-integer-overflows-in-grub_font_cons.patch (100%) rename 0296-font-Remove-grub_font_dup_glyph.patch => 0291-font-Remove-grub_font_dup_glyph.patch (100%) rename 0297-font-Fix-integer-overflow-in-ensure_comb_space.patch => 0292-font-Fix-integer-overflow-in-ensure_comb_space.patch (100%) rename 0298-font-Fix-integer-overflow-in-BMP-index.patch => 0293-font-Fix-integer-overflow-in-BMP-index.patch (100%) rename 0299-font-Fix-integer-underflow-in-binary-search-of-char-.patch => 0294-font-Fix-integer-underflow-in-binary-search-of-char-.patch (100%) rename 0300-kern-efi-sb-Enforce-verification-of-font-files.patch => 0295-kern-efi-sb-Enforce-verification-of-font-files.patch (100%) rename 0301-fbutil-Fix-integer-overflow.patch => 0296-fbutil-Fix-integer-overflow.patch (100%) rename 0302-font-Fix-an-integer-underflow-in-blit_comb.patch => 0297-font-Fix-an-integer-underflow-in-blit_comb.patch (100%) rename 0303-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch => 0298-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch (100%) rename 0304-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch => 0299-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch (100%) rename 0305-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch => 0300-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch (100%) rename 0306-ppc64le-signed-boot-media-changes.patch => 0301-ppc64le-signed-boot-media-changes.patch (100%) rename 0307-mm-Clarify-grub_real_malloc.patch => 0302-mm-Clarify-grub_real_malloc.patch (100%) rename 0308-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch => 0303-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch (100%) rename 0309-mm-Document-grub_free.patch => 0304-mm-Document-grub_free.patch (100%) rename 0310-mm-Document-grub_mm_init_region.patch => 0305-mm-Document-grub_mm_init_region.patch (100%) rename 0311-mm-Document-GRUB-internal-memory-management-structur.patch => 0306-mm-Document-GRUB-internal-memory-management-structur.patch (100%) rename 0312-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch => 0307-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch (100%) rename 0313-mm-When-adding-a-region-merge-with-region-after-as-w.patch => 0308-mm-When-adding-a-region-merge-with-region-after-as-w.patch (100%) rename 0314-mm-Debug-support-for-region-operations.patch => 0309-mm-Debug-support-for-region-operations.patch (100%) rename 0315-mm-Drop-unused-unloading-of-modules-on-OOM.patch => 0310-mm-Drop-unused-unloading-of-modules-on-OOM.patch (100%) rename 0316-mm-Allow-dynamically-requesting-additional-memory-re.patch => 0311-mm-Allow-dynamically-requesting-additional-memory-re.patch (100%) rename 0317-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch => 0312-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch (100%) rename 0318-kern-efi-mm-Extract-function-to-add-memory-regions.patch => 0313-kern-efi-mm-Extract-function-to-add-memory-regions.patch (100%) rename 0319-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch => 0314-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch (100%) rename 0320-kern-efi-mm-Implement-runtime-addition-of-pages.patch => 0315-kern-efi-mm-Implement-runtime-addition-of-pages.patch (100%) rename 0321-efi-Increase-default-memory-allocation-to-32-MiB.patch => 0316-efi-Increase-default-memory-allocation-to-32-MiB.patch (100%) rename 0322-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch => 0317-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch (100%) create mode 100644 0318-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch create mode 100644 0319-ieee1275-request-memory-with-ibm-client-architecture.patch create mode 100644 0320-ieee1275-drop-len-1-quirk-in-heap_init.patch create mode 100644 0321-ieee1275-support-runtime-memory-claiming.patch create mode 100644 0322-ieee1275-implement-vec5-for-cas-negotiation.patch delete mode 100644 0323-Enable-shared-processor-mode-in-vector-5.patch rename 0230-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch => 0323-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch (82%) create mode 100644 0324-powerpc-Drop-Open-Hack-Ware.patch diff --git a/0013-Disable-GRUB-video-support-for-IBM-power-machines.patch b/0013-Disable-GRUB-video-support-for-IBM-power-machines.patch index 430f600..1d1ad1d 100644 --- a/0013-Disable-GRUB-video-support-for-IBM-power-machines.patch +++ b/0013-Disable-GRUB-video-support-for-IBM-power-machines.patch @@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=973205 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c -index 20cbbd761ec..04df9d2c667 100644 +index 20cbbd761e..04df9d2c66 100644 --- a/grub-core/kern/ieee1275/cmain.c +++ b/grub-core/kern/ieee1275/cmain.c @@ -90,7 +90,10 @@ grub_ieee1275_find_options (void) @@ -28,7 +28,7 @@ index 20cbbd761ec..04df9d2c667 100644 /* Old Macs have no key repeat, newer ones have fully working one. The ones inbetween when repeated key generates an escaoe sequence diff --git a/grub-core/video/ieee1275.c b/grub-core/video/ieee1275.c -index 17a3dbbb575..b8e4b3feb32 100644 +index 17a3dbbb57..b8e4b3feb3 100644 --- a/grub-core/video/ieee1275.c +++ b/grub-core/video/ieee1275.c @@ -352,9 +352,12 @@ static struct grub_video_adapter grub_video_ieee1275_adapter = @@ -48,7 +48,7 @@ index 17a3dbbb575..b8e4b3feb32 100644 GRUB_MOD_FINI(ieee1275_fb) diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h -index 0a599607f31..b5a1d49bbc3 100644 +index 0a599607f3..49dbd2ebfb 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -148,6 +148,8 @@ enum grub_ieee1275_flag @@ -56,7 +56,7 @@ index 0a599607f31..b5a1d49bbc3 100644 GRUB_IEEE1275_FLAG_RAW_DEVNAMES, + -+ GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT ++ GRUB_IEEE1275_FLAG_DISABLE_VIDEO_SUPPORT, }; extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag); diff --git a/0201-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch b/0199-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch similarity index 99% rename from 0201-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch rename to 0199-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch index a237a21..5728f26 100644 --- a/0201-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch +++ b/0199-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch @@ -23,7 +23,7 @@ Signed-off-by: Daniel Axtens 3 files changed, 201 insertions(+), 3 deletions(-) diff --git a/grub-core/commands/appendedsig/x509.c b/grub-core/commands/appendedsig/x509.c -index 2b38b3670a2..42ec65c54aa 100644 +index 2b38b3670a..42ec65c54a 100644 --- a/grub-core/commands/appendedsig/x509.c +++ b/grub-core/commands/appendedsig/x509.c @@ -47,6 +47,12 @@ const char *keyUsage_oid = "2.5.29.15"; @@ -156,7 +156,7 @@ index 2b38b3670a2..42ec65c54aa 100644 cleanup_value: diff --git a/grub-core/tests/appended_signature_test.c b/grub-core/tests/appended_signature_test.c -index 88a485200d8..dbba0616621 100644 +index 88a485200d..dbba061662 100644 --- a/grub-core/tests/appended_signature_test.c +++ b/grub-core/tests/appended_signature_test.c @@ -111,6 +111,22 @@ static struct grub_procfs_entry certificate_printable_der_entry = { @@ -225,7 +225,7 @@ index 88a485200d8..dbba0616621 100644 GRUB_FUNCTIONAL_TEST (appended_signature_test, appended_signature_test); diff --git a/grub-core/tests/appended_signatures.h b/grub-core/tests/appended_signatures.h -index aa3dc6278e3..2e5ebd7d8bd 100644 +index aa3dc6278e..2e5ebd7d8b 100644 --- a/grub-core/tests/appended_signatures.h +++ b/grub-core/tests/appended_signatures.h @@ -555,3 +555,84 @@ unsigned char certificate_printable_der[] = { diff --git a/0199-ieee1275-claim-more-memory.patch b/0199-ieee1275-claim-more-memory.patch deleted file mode 100644 index 001a9df..0000000 --- a/0199-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 0dcd114ce54..c61d91a0285 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 19f708ee662..90083772c8a 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/0202-ieee1275-ofdisk-retry-on-open-failure.patch b/0200-ieee1275-ofdisk-retry-on-open-failure.patch similarity index 97% rename from 0202-ieee1275-ofdisk-retry-on-open-failure.patch rename to 0200-ieee1275-ofdisk-retry-on-open-failure.patch index 275d14f..9149773 100644 --- a/0202-ieee1275-ofdisk-retry-on-open-failure.patch +++ b/0200-ieee1275-ofdisk-retry-on-open-failure.patch @@ -16,7 +16,7 @@ Signed-off-by: Diego Domingos 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c -index ea7f78ac7d8..55346849d35 100644 +index ea7f78ac7d..55346849d3 100644 --- a/grub-core/disk/ieee1275/ofdisk.c +++ b/grub-core/disk/ieee1275/ofdisk.c @@ -225,7 +225,9 @@ dev_iterate (const struct grub_ieee1275_devalias *alias) @@ -85,7 +85,7 @@ index ea7f78ac7d8..55346849d35 100644 } diff --git a/include/grub/ieee1275/ofdisk.h b/include/grub/ieee1275/ofdisk.h -index 2f69e3f191d..7d2d5409305 100644 +index 2f69e3f191..7d2d540930 100644 --- a/include/grub/ieee1275/ofdisk.h +++ b/include/grub/ieee1275/ofdisk.h @@ -22,4 +22,12 @@ diff --git a/0200-ieee1275-request-memory-with-ibm-client-architecture.patch b/0200-ieee1275-request-memory-with-ibm-client-architecture.patch deleted file mode 100644 index 6e6c1f0..0000000 --- a/0200-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 04df9d2c667..6435628ec57 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 c61d91a0285..9704715c837 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 b5a1d49bbc3..e0a6c2ce1e6 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/0203-01_menu_auto_hide.in-fix-a-then-than-typo.patch b/0201-01_menu_auto_hide.in-fix-a-then-than-typo.patch similarity index 96% rename from 0203-01_menu_auto_hide.in-fix-a-then-than-typo.patch rename to 0201-01_menu_auto_hide.in-fix-a-then-than-typo.patch index 4847ef9..d1b3f2e 100644 --- a/0203-01_menu_auto_hide.in-fix-a-then-than-typo.patch +++ b/0201-01_menu_auto_hide.in-fix-a-then-than-typo.patch @@ -12,7 +12,7 @@ Signed-off-by: Jan Pokorný 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub.d/10_reset_boot_success.in b/util/grub.d/10_reset_boot_success.in -index 737e1ae5b68..e73f4137b36 100644 +index 737e1ae5b6..e73f4137b3 100644 --- a/util/grub.d/10_reset_boot_success.in +++ b/util/grub.d/10_reset_boot_success.in @@ -15,7 +15,7 @@ fi diff --git a/0204-Fix-disabling-grub-rpm-sort.patch b/0202-Fix-disabling-grub-rpm-sort.patch similarity index 96% rename from 0204-Fix-disabling-grub-rpm-sort.patch rename to 0202-Fix-disabling-grub-rpm-sort.patch index dccde3c..dd1bec0 100644 --- a/0204-Fix-disabling-grub-rpm-sort.patch +++ b/0202-Fix-disabling-grub-rpm-sort.patch @@ -13,7 +13,7 @@ debug output to ./configure and fixes #44. 2 files changed, 9 insertions(+) diff --git a/configure.ac b/configure.ac -index d5d2a28b4ef..c7842ec29d8 100644 +index d5d2a28b4e..c7842ec29d 100644 --- a/configure.ac +++ b/configure.ac @@ -1936,6 +1936,8 @@ AC_ARG_ENABLE([rpm-sort], @@ -46,7 +46,7 @@ index d5d2a28b4ef..c7842ec29d8 100644 echo starfield theme: Yes echo With DejaVuSans font from $DJVU_FONT_SOURCE diff --git a/Makefile.util.def b/Makefile.util.def -index 8cfbe69a76e..3f191aa8095 100644 +index 8cfbe69a76..3f191aa809 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -774,6 +774,7 @@ program = { diff --git a/0205-Don-t-check-for-rpmvercmp-in-librpm.patch b/0203-Don-t-check-for-rpmvercmp-in-librpm.patch similarity index 97% rename from 0205-Don-t-check-for-rpmvercmp-in-librpm.patch rename to 0203-Don-t-check-for-rpmvercmp-in-librpm.patch index c21dca4..4cf5325 100644 --- a/0205-Don-t-check-for-rpmvercmp-in-librpm.patch +++ b/0203-Don-t-check-for-rpmvercmp-in-librpm.patch @@ -22,7 +22,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac -index c7842ec29d8..3c808a72230 100644 +index c7842ec29d..3c808a7223 100644 --- a/configure.ac +++ b/configure.ac @@ -1947,24 +1947,15 @@ if test x"$rpm_sort_excuse" = x ; then diff --git a/0206-Allow-chainloading-EFI-apps-from-loop-mounts.patch b/0204-Allow-chainloading-EFI-apps-from-loop-mounts.patch similarity index 97% rename from 0206-Allow-chainloading-EFI-apps-from-loop-mounts.patch rename to 0204-Allow-chainloading-EFI-apps-from-loop-mounts.patch index e48f102..f485054 100644 --- a/0206-Allow-chainloading-EFI-apps-from-loop-mounts.patch +++ b/0204-Allow-chainloading-EFI-apps-from-loop-mounts.patch @@ -11,7 +11,7 @@ Subject: [PATCH] Allow chainloading EFI apps from loop mounts. create mode 100644 include/grub/loopback.h diff --git a/grub-core/disk/loopback.c b/grub-core/disk/loopback.c -index 41bebd14fe3..99f47924ec2 100644 +index 41bebd14fe..99f47924ec 100644 --- a/grub-core/disk/loopback.c +++ b/grub-core/disk/loopback.c @@ -21,20 +21,13 @@ @@ -37,7 +37,7 @@ index 41bebd14fe3..99f47924ec2 100644 static unsigned long last_id = 0; diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c -index d41e8ea14a8..3af6b122926 100644 +index d41e8ea14a..3af6b12292 100644 --- a/grub-core/loader/efi/chainloader.c +++ b/grub-core/loader/efi/chainloader.c @@ -24,6 +24,7 @@ @@ -100,7 +100,7 @@ index d41e8ea14a8..3af6b122926 100644 diff --git a/include/grub/loopback.h b/include/grub/loopback.h new file mode 100644 -index 00000000000..3b9a9e32e80 +index 0000000000..3b9a9e32e8 --- /dev/null +++ b/include/grub/loopback.h @@ -0,0 +1,30 @@ diff --git a/0207-efinet-Add-DHCP-proxy-support.patch b/0205-efinet-Add-DHCP-proxy-support.patch similarity index 98% rename from 0207-efinet-Add-DHCP-proxy-support.patch rename to 0205-efinet-Add-DHCP-proxy-support.patch index a8755a3..25065ad 100644 --- a/0207-efinet-Add-DHCP-proxy-support.patch +++ b/0205-efinet-Add-DHCP-proxy-support.patch @@ -11,7 +11,7 @@ server ack packet. Currently that case is not handled, add support for it. 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c -index e11d759f19a..1a24f38a21a 100644 +index e11d759f19..1a24f38a21 100644 --- a/grub-core/net/drivers/efi/efinet.c +++ b/grub-core/net/drivers/efi/efinet.c @@ -850,10 +850,31 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device, diff --git a/0208-fs-ext2-Ignore-checksum-seed-incompat-feature.patch b/0206-fs-ext2-Ignore-checksum-seed-incompat-feature.patch similarity index 98% rename from 0208-fs-ext2-Ignore-checksum-seed-incompat-feature.patch rename to 0206-fs-ext2-Ignore-checksum-seed-incompat-feature.patch index b4a5fd4..3d7c641 100644 --- a/0208-fs-ext2-Ignore-checksum-seed-incompat-feature.patch +++ b/0206-fs-ext2-Ignore-checksum-seed-incompat-feature.patch @@ -23,7 +23,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c -index e7dd78e6635..731d346f886 100644 +index e7dd78e663..731d346f88 100644 --- a/grub-core/fs/ext2.c +++ b/grub-core/fs/ext2.c @@ -103,6 +103,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); diff --git a/0209-Don-t-update-the-cmdline-when-generating-legacy-menu.patch b/0207-Don-t-update-the-cmdline-when-generating-legacy-menu.patch similarity index 97% rename from 0209-Don-t-update-the-cmdline-when-generating-legacy-menu.patch rename to 0207-Don-t-update-the-cmdline-when-generating-legacy-menu.patch index c55b7e3..8025271 100644 --- a/0209-Don-t-update-the-cmdline-when-generating-legacy-menu.patch +++ b/0207-Don-t-update-the-cmdline-when-generating-legacy-menu.patch @@ -20,7 +20,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index 68adb55d893..c9296154f51 100644 +index 68adb55d89..c9296154f5 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -261,7 +261,9 @@ if [ -z "\${kernelopts}" ]; then diff --git a/0210-Suppress-gettext-error-message.patch b/0208-Suppress-gettext-error-message.patch similarity index 96% rename from 0210-Suppress-gettext-error-message.patch rename to 0208-Suppress-gettext-error-message.patch index c57e7ff..dd87a98 100644 --- a/0210-Suppress-gettext-error-message.patch +++ b/0208-Suppress-gettext-error-message.patch @@ -14,7 +14,7 @@ Signed-off-by: Paulo Flabiano Smorigo 1 file changed, 7 insertions(+) diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c -index 84d520cd494..87a912ac6e5 100644 +index 84d520cd49..87a912ac6e 100644 --- a/grub-core/gettext/gettext.c +++ b/grub-core/gettext/gettext.c @@ -424,6 +424,13 @@ grub_gettext_init_ext (struct grub_gettext_context *ctx, diff --git a/0211-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch b/0209-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch similarity index 97% rename from 0211-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch rename to 0209-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch index 61d0f6d..017d4cb 100644 --- a/0211-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch +++ b/0209-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch @@ -19,7 +19,7 @@ Resolves: rhbz#1914571 1 file changed, 1 insertion(+) diff --git a/docs/grub-boot-success.timer b/docs/grub-boot-success.timer -index 5d8fcba21aa..406f1720056 100644 +index 5d8fcba21a..406f172005 100644 --- a/docs/grub-boot-success.timer +++ b/docs/grub-boot-success.timer @@ -1,6 +1,7 @@ diff --git a/0212-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch b/0210-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch similarity index 97% rename from 0212-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch rename to 0210-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch index 7ecea22..b5d5e5c 100644 --- a/0212-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch +++ b/0210-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch @@ -15,7 +15,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/util/grub-set-password.in b/util/grub-set-password.in -index c0b5ebbfdc5..d8005e5a142 100644 +index c0b5ebbfdc..d8005e5a14 100644 --- a/util/grub-set-password.in +++ b/util/grub-set-password.in @@ -1,11 +1,6 @@ diff --git a/0213-Remove-outdated-URL-for-BLS-document.patch b/0211-Remove-outdated-URL-for-BLS-document.patch similarity index 96% rename from 0213-Remove-outdated-URL-for-BLS-document.patch rename to 0211-Remove-outdated-URL-for-BLS-document.patch index d380fe8..21af1fa 100644 --- a/0213-Remove-outdated-URL-for-BLS-document.patch +++ b/0211-Remove-outdated-URL-for-BLS-document.patch @@ -14,7 +14,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in -index c9296154f51..6ee0a2cf3d0 100644 +index c9296154f5..6ee0a2cf3d 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -96,7 +96,7 @@ cat < 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/util/grub.d/30_uefi-firmware.in b/util/grub.d/30_uefi-firmware.in -index d344d3883d7..b6041b55e2a 100644 +index d344d3883d..b6041b55e2 100644 --- a/util/grub.d/30_uefi-firmware.in +++ b/util/grub.d/30_uefi-firmware.in @@ -26,19 +26,14 @@ export TEXTDOMAINDIR="@localedir@" diff --git a/0215-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch b/0213-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch similarity index 98% rename from 0215-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch rename to 0213-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch index 65b4aec..3b1a219 100644 --- a/0215-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch +++ b/0213-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch @@ -21,7 +21,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/grub-core/commands/efi/efifwsetup.c b/grub-core/commands/efi/efifwsetup.c -index eaca0328388..328c45e82e0 100644 +index eaca032838..328c45e82e 100644 --- a/grub-core/commands/efi/efifwsetup.c +++ b/grub-core/commands/efi/efifwsetup.c @@ -27,6 +27,25 @@ diff --git a/0216-arm64-Fix-EFI-loader-kernel-image-allocation.patch b/0214-arm64-Fix-EFI-loader-kernel-image-allocation.patch similarity index 99% rename from 0216-arm64-Fix-EFI-loader-kernel-image-allocation.patch rename to 0214-arm64-Fix-EFI-loader-kernel-image-allocation.patch index 600b461..ce77c63 100644 --- a/0216-arm64-Fix-EFI-loader-kernel-image-allocation.patch +++ b/0214-arm64-Fix-EFI-loader-kernel-image-allocation.patch @@ -19,7 +19,7 @@ Signed-off-by: Benjamin Herrenschmidt 1 file changed, 66 insertions(+), 34 deletions(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 47f8cf0d84b..4a252d5e7e9 100644 +index 47f8cf0d84..4a252d5e7e 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -41,6 +41,8 @@ GRUB_MOD_LICENSE ("GPLv3+"); diff --git a/0217-normal-main-Discover-the-device-to-read-the-config-f.patch b/0215-normal-main-Discover-the-device-to-read-the-config-f.patch similarity index 98% rename from 0217-normal-main-Discover-the-device-to-read-the-config-f.patch rename to 0215-normal-main-Discover-the-device-to-read-the-config-f.patch index cf12fd6..0f0c66c 100644 --- a/0217-normal-main-Discover-the-device-to-read-the-config-f.patch +++ b/0215-normal-main-Discover-the-device-to-read-the-config-f.patch @@ -26,7 +26,7 @@ Signed-off-by: Javier Martinez Canillas 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c -index 155bf366da2..f9ccca502ee 100644 +index 155bf366da..f9ccca502e 100644 --- a/grub-core/normal/main.c +++ b/grub-core/normal/main.c @@ -339,18 +339,13 @@ grub_enter_normal_mode (const char *config) diff --git a/0218-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch b/0216-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch similarity index 98% rename from 0218-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch rename to 0216-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch index 70b021d..fe28e32 100644 --- a/0218-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch +++ b/0216-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch @@ -23,7 +23,7 @@ Signed-off-by: Daniel Axtens 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index 0285e95a2bb..e809a5edec1 100644 +index 0285e95a2b..e809a5edec 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -216,13 +216,41 @@ grub_set_prefix_and_root (void) diff --git a/0219-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch b/0217-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch similarity index 97% rename from 0219-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch rename to 0217-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch index 1cb21ef..1bf9fa8 100644 --- a/0219-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch +++ b/0217-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch @@ -15,7 +15,7 @@ Signed-off-by: Daniel Axtens 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/grub-core/kern/main.c b/grub-core/kern/main.c -index e809a5edec1..2d0d2bbd4cf 100644 +index e809a5edec..2d0d2bbd4c 100644 --- a/grub-core/kern/main.c +++ b/grub-core/kern/main.c @@ -236,9 +236,20 @@ grub_set_prefix_and_root (void) diff --git a/0220-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch b/0218-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch similarity index 95% rename from 0220-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch rename to 0218-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch index 8b5170b..a1a8254 100644 --- a/0220-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch +++ b/0218-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch @@ -25,7 +25,7 @@ Signed-off-by: Peter Jones 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c -index 4a252d5e7e9..f18d90bd749 100644 +index 4a252d5e7e..f18d90bd74 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -322,7 +322,7 @@ parse_pe_header (void *kernel, grub_uint64_t *total_size, @@ -38,7 +38,7 @@ index 4a252d5e7e9..f18d90bd749 100644 *total_size = pe->opt.image_size; diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h -index b582f67f661..966a5074f53 100644 +index b582f67f66..966a5074f5 100644 --- a/include/grub/arm/linux.h +++ b/include/grub/arm/linux.h @@ -44,6 +44,7 @@ struct grub_arm_linux_pe_header @@ -50,7 +50,7 @@ index b582f67f661..966a5074f53 100644 # define grub_armxx_linux_pe_header grub_arm_linux_pe_header #endif diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h -index ea030312df3..422bf2bf24b 100644 +index ea030312df..422bf2bf24 100644 --- a/include/grub/arm64/linux.h +++ b/include/grub/arm64/linux.h @@ -48,6 +48,7 @@ struct grub_arm64_linux_pe_header diff --git a/0221-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch b/0219-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch similarity index 99% rename from 0221-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch rename to 0219-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch index 893d8b4..7fc40f1 100644 --- a/0221-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch +++ b/0219-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch @@ -81,7 +81,7 @@ Reviewed-by: Daniel Kiper 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c -index 0f524c3a8a6..e3816d1ec4a 100644 +index 0f524c3a8a..e3816d1ec4 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -192,6 +192,11 @@ struct grub_xfs_time_legacy diff --git a/0222-Print-module-name-on-license-check-failure.patch b/0220-Print-module-name-on-license-check-failure.patch similarity index 98% rename from 0222-Print-module-name-on-license-check-failure.patch rename to 0220-Print-module-name-on-license-check-failure.patch index c4b9a13..5c30859 100644 --- a/0222-Print-module-name-on-license-check-failure.patch +++ b/0220-Print-module-name-on-license-check-failure.patch @@ -13,7 +13,7 @@ Signed-off-by: Robbie Harwood 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c -index 9557254035e..f3044945742 100644 +index 9557254035..f304494574 100644 --- a/grub-core/kern/dl.c +++ b/grub-core/kern/dl.c @@ -528,14 +528,16 @@ grub_dl_find_section_index (Elf_Ehdr *e, const char *name) diff --git a/0223-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch b/0221-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch similarity index 98% rename from 0223-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch rename to 0221-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch index a80727e..05417ed 100644 --- a/0223-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch +++ b/0221-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch @@ -79,7 +79,7 @@ Signed-off-by: Robbie Harwood 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 3f3459b2c70..6b00eb55575 100644 +index 3f3459b2c7..6b00eb5557 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -89,7 +89,7 @@ kernel = { @@ -92,7 +92,7 @@ index 3f3459b2c70..6b00eb55575 100644 mips_arc_ldflags = '-Wl,-Ttext,$(TARGET_LINK_ADDR)'; mips_qemu_mips_ldflags = '-Wl,-Ttext,0x80200000'; diff --git a/include/grub/offsets.h b/include/grub/offsets.h -index 871e1cd4c38..69211aa798b 100644 +index 871e1cd4c3..69211aa798 100644 --- a/include/grub/offsets.h +++ b/include/grub/offsets.h @@ -63,7 +63,7 @@ diff --git a/0224-grub-mkconfig-restore-umask-for-grub.cfg.patch b/0222-grub-mkconfig-restore-umask-for-grub.cfg.patch similarity index 97% rename from 0224-grub-mkconfig-restore-umask-for-grub.cfg.patch rename to 0222-grub-mkconfig-restore-umask-for-grub.cfg.patch index bd1bd0c..f275ed4 100644 --- a/0224-grub-mkconfig-restore-umask-for-grub.cfg.patch +++ b/0222-grub-mkconfig-restore-umask-for-grub.cfg.patch @@ -26,7 +26,7 @@ Signed-off-by: Michael Chang 1 file changed, 2 insertions(+) diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in -index f55339a3f64..520a672cd2c 100644 +index f55339a3f6..520a672cd2 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -311,7 +311,9 @@ and /etc/grub.d/* files or please file a bug report with diff --git a/0225-commands-search-Fix-bug-stopping-iteration-when-no-f.patch b/0223-commands-search-Fix-bug-stopping-iteration-when-no-f.patch similarity index 97% rename from 0225-commands-search-Fix-bug-stopping-iteration-when-no-f.patch rename to 0223-commands-search-Fix-bug-stopping-iteration-when-no-f.patch index c5971ac..8bdf8ae 100644 --- a/0225-commands-search-Fix-bug-stopping-iteration-when-no-f.patch +++ b/0223-commands-search-Fix-bug-stopping-iteration-when-no-f.patch @@ -20,7 +20,7 @@ Signed-off-by: Robbie Harwood 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/commands/search.c b/grub-core/commands/search.c -index ed090b3af8b..51656e361cc 100644 +index ed090b3af8..51656e361c 100644 --- a/grub-core/commands/search.c +++ b/grub-core/commands/search.c @@ -64,7 +64,7 @@ iterate_device (const char *name, void *data) diff --git a/0226-search-new-efidisk-only-option-on-EFI-systems.patch b/0224-search-new-efidisk-only-option-on-EFI-systems.patch similarity index 98% rename from 0226-search-new-efidisk-only-option-on-EFI-systems.patch rename to 0224-search-new-efidisk-only-option-on-EFI-systems.patch index 8e24dac..0364677 100644 --- a/0226-search-new-efidisk-only-option-on-EFI-systems.patch +++ b/0224-search-new-efidisk-only-option-on-EFI-systems.patch @@ -27,7 +27,7 @@ Signed-off-by: Robbie Harwood 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/grub-core/commands/search.c b/grub-core/commands/search.c -index 51656e361cc..57d26ced8a8 100644 +index 51656e361c..57d26ced8a 100644 --- a/grub-core/commands/search.c +++ b/grub-core/commands/search.c @@ -47,7 +47,7 @@ struct search_ctx @@ -87,7 +87,7 @@ index 51656e361cc..57d26ced8a8 100644 .nhints = nhints, .count = 0, diff --git a/grub-core/commands/search_wrap.c b/grub-core/commands/search_wrap.c -index 47fc8eb9966..0b62acf8535 100644 +index 47fc8eb996..0b62acf853 100644 --- a/grub-core/commands/search_wrap.c +++ b/grub-core/commands/search_wrap.c @@ -40,6 +40,7 @@ static const struct grub_arg_option options[] = @@ -140,7 +140,7 @@ index 47fc8eb9966..0b62acf8535 100644 grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type"); diff --git a/include/grub/search.h b/include/grub/search.h -index d80347df34b..4190aeb2cbf 100644 +index d80347df34..4190aeb2cb 100644 --- a/include/grub/search.h +++ b/include/grub/search.h @@ -19,11 +19,20 @@ diff --git a/0227-efi-new-connectefi-command.patch b/0225-efi-new-connectefi-command.patch similarity index 97% rename from 0227-efi-new-connectefi-command.patch rename to 0225-efi-new-connectefi-command.patch index abb6f6f..0d25478 100644 --- a/0227-efi-new-connectefi-command.patch +++ b/0225-efi-new-connectefi-command.patch @@ -65,7 +65,7 @@ Signed-off-by: Robbie Harwood create mode 100644 grub-core/commands/efi/connectefi.c diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def -index 6b00eb55575..97abc01f064 100644 +index 6b00eb5557..97abc01f06 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -833,6 +833,12 @@ module = { @@ -83,7 +83,7 @@ index 6b00eb55575..97abc01f064 100644 common = commands/blocklist.c; diff --git a/grub-core/commands/efi/connectefi.c b/grub-core/commands/efi/connectefi.c new file mode 100644 -index 00000000000..8ab75bd51be +index 0000000000..8ab75bd51b --- /dev/null +++ b/grub-core/commands/efi/connectefi.c @@ -0,0 +1,205 @@ @@ -293,7 +293,7 @@ index 00000000000..8ab75bd51be + grub_unregister_command (cmd); +} diff --git a/grub-core/commands/efi/lsefi.c b/grub-core/commands/efi/lsefi.c -index d1ce99af438..f2d2430e666 100644 +index d1ce99af43..f2d2430e66 100644 --- a/grub-core/commands/efi/lsefi.c +++ b/grub-core/commands/efi/lsefi.c @@ -19,6 +19,7 @@ @@ -305,7 +305,7 @@ index d1ce99af438..f2d2430e666 100644 #include #include diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c -index fe8ba6e6c93..062143dfffd 100644 +index fe8ba6e6c9..062143dfff 100644 --- a/grub-core/disk/efi/efidisk.c +++ b/grub-core/disk/efi/efidisk.c @@ -396,6 +396,19 @@ enumerate_disks (void) @@ -329,7 +329,7 @@ index fe8ba6e6c93..062143dfffd 100644 grub_efidisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data, grub_disk_pull_t pull) diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c -index 14bc10eb564..7fcca69c17b 100644 +index 14bc10eb56..7fcca69c17 100644 --- a/grub-core/kern/efi/efi.c +++ b/grub-core/kern/efi/efi.c @@ -95,6 +95,19 @@ grub_efi_locate_handle (grub_efi_locate_search_type_t search_type, @@ -353,7 +353,7 @@ index 14bc10eb564..7fcca69c17b 100644 grub_efi_open_protocol (grub_efi_handle_t handle, grub_efi_guid_t *protocol, diff --git a/include/grub/efi/disk.h b/include/grub/efi/disk.h -index 254475c8428..6845c2f1fd8 100644 +index 254475c842..6845c2f1fd 100644 --- a/include/grub/efi/disk.h +++ b/include/grub/efi/disk.h @@ -27,6 +27,8 @@ grub_efi_handle_t @@ -366,7 +366,7 @@ index 254475c8428..6845c2f1fd8 100644 void grub_efidisk_fini (void); diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h -index 8dfc89a33b9..ec52083c49f 100644 +index 8dfc89a33b..ec52083c49 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -41,6 +41,11 @@ EXPORT_FUNC(grub_efi_locate_handle) (grub_efi_locate_search_type_t search_type, @@ -382,7 +382,7 @@ index 8dfc89a33b9..ec52083c49f 100644 grub_efi_guid_t *protocol, grub_efi_uint32_t attributes); diff --git a/NEWS b/NEWS -index 73b8492bc42..d7c1d23aed7 100644 +index 73b8492bc4..d7c1d23aed 100644 --- a/NEWS +++ b/NEWS @@ -98,7 +98,7 @@ New in 2.02: diff --git a/0229-powerpc-prefix-detection-support-device-names-with-c.patch b/0226-powerpc-prefix-detection-support-device-names-with-c.patch similarity index 100% rename from 0229-powerpc-prefix-detection-support-device-names-with-c.patch rename to 0226-powerpc-prefix-detection-support-device-names-with-c.patch diff --git a/0231-make-ofdisk_retries-optional.patch b/0227-make-ofdisk_retries-optional.patch similarity index 100% rename from 0231-make-ofdisk_retries-optional.patch rename to 0227-make-ofdisk_retries-optional.patch diff --git a/0232-loader-efi-chainloader-grub_load_and_start_image-doe.patch b/0228-loader-efi-chainloader-grub_load_and_start_image-doe.patch similarity index 100% rename from 0232-loader-efi-chainloader-grub_load_and_start_image-doe.patch rename to 0228-loader-efi-chainloader-grub_load_and_start_image-doe.patch diff --git a/0228-powerpc-do-CAS-in-a-more-compatible-way.patch b/0228-powerpc-do-CAS-in-a-more-compatible-way.patch deleted file mode 100644 index 32c06b0..0000000 --- a/0228-powerpc-do-CAS-in-a-more-compatible-way.patch +++ /dev/null @@ -1,111 +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 -(cherry picked from commit e6f02ad4e75cd995a8ee2954d28949c415b6cbfe) ---- - 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/0233-loader-efi-chainloader-simplify-the-loader-state.patch b/0229-loader-efi-chainloader-simplify-the-loader-state.patch similarity index 100% rename from 0233-loader-efi-chainloader-simplify-the-loader-state.patch rename to 0229-loader-efi-chainloader-simplify-the-loader-state.patch diff --git a/0234-commands-boot-Add-API-to-pass-context-to-loader.patch b/0230-commands-boot-Add-API-to-pass-context-to-loader.patch similarity index 100% rename from 0234-commands-boot-Add-API-to-pass-context-to-loader.patch rename to 0230-commands-boot-Add-API-to-pass-context-to-loader.patch diff --git a/0235-loader-efi-chainloader-Use-grub_loader_set_ex.patch b/0231-loader-efi-chainloader-Use-grub_loader_set_ex.patch similarity index 100% rename from 0235-loader-efi-chainloader-Use-grub_loader_set_ex.patch rename to 0231-loader-efi-chainloader-Use-grub_loader_set_ex.patch diff --git a/0236-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch b/0232-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch similarity index 100% rename from 0236-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch rename to 0232-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch diff --git a/0237-loader-i386-efi-linux-Use-grub_loader_set_ex.patch b/0233-loader-i386-efi-linux-Use-grub_loader_set_ex.patch similarity index 100% rename from 0237-loader-i386-efi-linux-Use-grub_loader_set_ex.patch rename to 0233-loader-i386-efi-linux-Use-grub_loader_set_ex.patch diff --git a/0238-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch b/0234-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch similarity index 100% rename from 0238-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch rename to 0234-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch diff --git a/0239-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch b/0235-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch similarity index 100% rename from 0239-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch rename to 0235-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch diff --git a/0240-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch b/0236-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch similarity index 100% rename from 0240-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch rename to 0236-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch diff --git a/0241-video-readers-png-Abort-sooner-if-a-read-operation-f.patch b/0237-video-readers-png-Abort-sooner-if-a-read-operation-f.patch similarity index 100% rename from 0241-video-readers-png-Abort-sooner-if-a-read-operation-f.patch rename to 0237-video-readers-png-Abort-sooner-if-a-read-operation-f.patch diff --git a/0242-video-readers-png-Refuse-to-handle-multiple-image-he.patch b/0238-video-readers-png-Refuse-to-handle-multiple-image-he.patch similarity index 100% rename from 0242-video-readers-png-Refuse-to-handle-multiple-image-he.patch rename to 0238-video-readers-png-Refuse-to-handle-multiple-image-he.patch diff --git a/0243-video-readers-png-Drop-greyscale-support-to-fix-heap.patch b/0239-video-readers-png-Drop-greyscale-support-to-fix-heap.patch similarity index 100% rename from 0243-video-readers-png-Drop-greyscale-support-to-fix-heap.patch rename to 0239-video-readers-png-Drop-greyscale-support-to-fix-heap.patch diff --git a/0244-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch b/0240-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch similarity index 100% rename from 0244-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch rename to 0240-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch diff --git a/0245-video-readers-png-Sanity-check-some-huffman-codes.patch b/0241-video-readers-png-Sanity-check-some-huffman-codes.patch similarity index 100% rename from 0245-video-readers-png-Sanity-check-some-huffman-codes.patch rename to 0241-video-readers-png-Sanity-check-some-huffman-codes.patch diff --git a/0246-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch b/0242-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch similarity index 100% rename from 0246-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch rename to 0242-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch diff --git a/0247-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch b/0243-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch similarity index 100% rename from 0247-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch rename to 0243-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch diff --git a/0248-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch b/0244-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch similarity index 100% rename from 0248-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch rename to 0244-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch diff --git a/0249-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch b/0245-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch similarity index 100% rename from 0249-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch rename to 0245-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch diff --git a/0250-normal-charset-Fix-array-out-of-bounds-formatting-un.patch b/0246-normal-charset-Fix-array-out-of-bounds-formatting-un.patch similarity index 100% rename from 0250-normal-charset-Fix-array-out-of-bounds-formatting-un.patch rename to 0246-normal-charset-Fix-array-out-of-bounds-formatting-un.patch diff --git a/0251-net-netbuff-Block-overly-large-netbuff-allocs.patch b/0247-net-netbuff-Block-overly-large-netbuff-allocs.patch similarity index 100% rename from 0251-net-netbuff-Block-overly-large-netbuff-allocs.patch rename to 0247-net-netbuff-Block-overly-large-netbuff-allocs.patch diff --git a/0252-net-ip-Do-IP-fragment-maths-safely.patch b/0248-net-ip-Do-IP-fragment-maths-safely.patch similarity index 100% rename from 0252-net-ip-Do-IP-fragment-maths-safely.patch rename to 0248-net-ip-Do-IP-fragment-maths-safely.patch diff --git a/0253-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch b/0249-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch similarity index 100% rename from 0253-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch rename to 0249-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch diff --git a/0254-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch b/0250-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch similarity index 100% rename from 0254-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch rename to 0250-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch diff --git a/0255-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch b/0251-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch similarity index 100% rename from 0255-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch rename to 0251-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch diff --git a/0256-net-tftp-Avoid-a-trivial-UAF.patch b/0252-net-tftp-Avoid-a-trivial-UAF.patch similarity index 100% rename from 0256-net-tftp-Avoid-a-trivial-UAF.patch rename to 0252-net-tftp-Avoid-a-trivial-UAF.patch diff --git a/0257-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch b/0253-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch similarity index 100% rename from 0257-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch rename to 0253-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch diff --git a/0258-net-http-Fix-OOB-write-for-split-http-headers.patch b/0254-net-http-Fix-OOB-write-for-split-http-headers.patch similarity index 100% rename from 0258-net-http-Fix-OOB-write-for-split-http-headers.patch rename to 0254-net-http-Fix-OOB-write-for-split-http-headers.patch diff --git a/0259-net-http-Error-out-on-headers-with-LF-without-CR.patch b/0255-net-http-Error-out-on-headers-with-LF-without-CR.patch similarity index 100% rename from 0259-net-http-Error-out-on-headers-with-LF-without-CR.patch rename to 0255-net-http-Error-out-on-headers-with-LF-without-CR.patch diff --git a/0260-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch b/0256-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch similarity index 100% rename from 0260-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch rename to 0256-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch diff --git a/0261-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch b/0257-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch similarity index 100% rename from 0261-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch rename to 0257-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch diff --git a/0262-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch b/0258-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch similarity index 100% rename from 0262-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch rename to 0258-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch diff --git a/0263-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch b/0259-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch similarity index 100% rename from 0263-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch rename to 0259-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch diff --git a/0264-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch b/0260-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch similarity index 100% rename from 0264-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch rename to 0260-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch diff --git a/0265-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch b/0261-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch similarity index 100% rename from 0265-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch rename to 0261-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch diff --git a/0266-misc-Make-grub_min-and-grub_max-more-resilient.patch b/0262-misc-Make-grub_min-and-grub_max-more-resilient.patch similarity index 100% rename from 0266-misc-Make-grub_min-and-grub_max-more-resilient.patch rename to 0262-misc-Make-grub_min-and-grub_max-more-resilient.patch diff --git a/0267-ReiserFS-switch-to-using-grub_min-grub_max.patch b/0263-ReiserFS-switch-to-using-grub_min-grub_max.patch similarity index 100% rename from 0267-ReiserFS-switch-to-using-grub_min-grub_max.patch rename to 0263-ReiserFS-switch-to-using-grub_min-grub_max.patch diff --git a/0268-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch b/0264-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch similarity index 100% rename from 0268-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch rename to 0264-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch diff --git a/0269-modules-make-.module_license-read-only.patch b/0265-modules-make-.module_license-read-only.patch similarity index 100% rename from 0269-modules-make-.module_license-read-only.patch rename to 0265-modules-make-.module_license-read-only.patch diff --git a/0270-modules-strip-.llvm_addrsig-sections-and-similar.patch b/0266-modules-strip-.llvm_addrsig-sections-and-similar.patch similarity index 100% rename from 0270-modules-strip-.llvm_addrsig-sections-and-similar.patch rename to 0266-modules-strip-.llvm_addrsig-sections-and-similar.patch diff --git a/0271-modules-Don-t-allocate-space-for-non-allocable-secti.patch b/0267-modules-Don-t-allocate-space-for-non-allocable-secti.patch similarity index 100% rename from 0271-modules-Don-t-allocate-space-for-non-allocable-secti.patch rename to 0267-modules-Don-t-allocate-space-for-non-allocable-secti.patch diff --git a/0272-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch b/0268-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch similarity index 100% rename from 0272-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch rename to 0268-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch diff --git a/0273-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch b/0269-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch similarity index 100% rename from 0273-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch rename to 0269-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch diff --git a/0274-modules-load-module-sections-at-page-aligned-address.patch b/0270-modules-load-module-sections-at-page-aligned-address.patch similarity index 99% rename from 0274-modules-load-module-sections-at-page-aligned-address.patch rename to 0270-modules-load-module-sections-at-page-aligned-address.patch index 1c703d8..0e76430 100644 --- a/0274-modules-load-module-sections-at-page-aligned-address.patch +++ b/0270-modules-load-module-sections-at-page-aligned-address.patch @@ -361,7 +361,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/0275-nx-add-memory-attribute-get-set-API.patch b/0271-nx-add-memory-attribute-get-set-API.patch similarity index 100% rename from 0275-nx-add-memory-attribute-get-set-API.patch rename to 0271-nx-add-memory-attribute-get-set-API.patch diff --git a/0276-nx-set-page-permissions-for-loaded-modules.patch b/0272-nx-set-page-permissions-for-loaded-modules.patch similarity index 100% rename from 0276-nx-set-page-permissions-for-loaded-modules.patch rename to 0272-nx-set-page-permissions-for-loaded-modules.patch diff --git a/0277-nx-set-attrs-in-our-kernel-loaders.patch b/0273-nx-set-attrs-in-our-kernel-loaders.patch similarity index 100% rename from 0277-nx-set-attrs-in-our-kernel-loaders.patch rename to 0273-nx-set-attrs-in-our-kernel-loaders.patch diff --git a/0278-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch b/0274-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch similarity index 100% rename from 0278-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch rename to 0274-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch diff --git a/0279-Make-debug-file-show-which-file-filters-get-run.patch b/0275-Make-debug-file-show-which-file-filters-get-run.patch similarity index 100% rename from 0279-Make-debug-file-show-which-file-filters-get-run.patch rename to 0275-Make-debug-file-show-which-file-filters-get-run.patch diff --git a/0280-efi-use-enumerated-array-positions-for-our-allocatio.patch b/0276-efi-use-enumerated-array-positions-for-our-allocatio.patch similarity index 100% rename from 0280-efi-use-enumerated-array-positions-for-our-allocatio.patch rename to 0276-efi-use-enumerated-array-positions-for-our-allocatio.patch diff --git a/0281-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch b/0277-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch similarity index 100% rename from 0281-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch rename to 0277-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch diff --git a/0282-efi-allocate-the-initrd-within-the-bounds-expressed-.patch b/0278-efi-allocate-the-initrd-within-the-bounds-expressed-.patch similarity index 100% rename from 0282-efi-allocate-the-initrd-within-the-bounds-expressed-.patch rename to 0278-efi-allocate-the-initrd-within-the-bounds-expressed-.patch diff --git a/0283-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch b/0279-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch similarity index 100% rename from 0283-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch rename to 0279-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch diff --git a/0284-BLS-create-etc-kernel-cmdline-during-mkconfig.patch b/0280-BLS-create-etc-kernel-cmdline-during-mkconfig.patch similarity index 100% rename from 0284-BLS-create-etc-kernel-cmdline-during-mkconfig.patch rename to 0280-BLS-create-etc-kernel-cmdline-during-mkconfig.patch diff --git a/0286-squish-don-t-dup-rhgb-quiet-check-mtimes.patch b/0281-squish-don-t-dup-rhgb-quiet-check-mtimes.patch similarity index 100% rename from 0286-squish-don-t-dup-rhgb-quiet-check-mtimes.patch rename to 0281-squish-don-t-dup-rhgb-quiet-check-mtimes.patch diff --git a/0287-squish-give-up-on-rhgb-quiet.patch b/0282-squish-give-up-on-rhgb-quiet.patch similarity index 100% rename from 0287-squish-give-up-on-rhgb-quiet.patch rename to 0282-squish-give-up-on-rhgb-quiet.patch diff --git a/0288-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch b/0283-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch similarity index 100% rename from 0288-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch rename to 0283-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch diff --git a/0289-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch b/0284-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch similarity index 100% rename from 0289-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch rename to 0284-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch diff --git a/0290-commands-efi-tpm-Refine-the-status-of-log-event.patch b/0285-commands-efi-tpm-Refine-the-status-of-log-event.patch similarity index 100% rename from 0290-commands-efi-tpm-Refine-the-status-of-log-event.patch rename to 0285-commands-efi-tpm-Refine-the-status-of-log-event.patch diff --git a/0285-ieee1275-implement-vec5-for-cas-negotiation.patch b/0285-ieee1275-implement-vec5-for-cas-negotiation.patch deleted file mode 100644 index f9f2170..0000000 --- a/0285-ieee1275-implement-vec5-for-cas-negotiation.patch +++ /dev/null @@ -1,71 +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 -(cherry picked from commit f735c65b6da8a9d4251242b37774e1a517511253) ---- - 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/0291-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch b/0286-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch similarity index 100% rename from 0291-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch rename to 0286-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch diff --git a/0292-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch b/0287-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch similarity index 100% rename from 0292-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch rename to 0287-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch diff --git a/0293-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch b/0288-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch similarity index 100% rename from 0293-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch rename to 0288-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch diff --git a/0294-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch b/0289-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch similarity index 100% rename from 0294-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch rename to 0289-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch diff --git a/0295-font-Fix-several-integer-overflows-in-grub_font_cons.patch b/0290-font-Fix-several-integer-overflows-in-grub_font_cons.patch similarity index 100% rename from 0295-font-Fix-several-integer-overflows-in-grub_font_cons.patch rename to 0290-font-Fix-several-integer-overflows-in-grub_font_cons.patch diff --git a/0296-font-Remove-grub_font_dup_glyph.patch b/0291-font-Remove-grub_font_dup_glyph.patch similarity index 100% rename from 0296-font-Remove-grub_font_dup_glyph.patch rename to 0291-font-Remove-grub_font_dup_glyph.patch diff --git a/0297-font-Fix-integer-overflow-in-ensure_comb_space.patch b/0292-font-Fix-integer-overflow-in-ensure_comb_space.patch similarity index 100% rename from 0297-font-Fix-integer-overflow-in-ensure_comb_space.patch rename to 0292-font-Fix-integer-overflow-in-ensure_comb_space.patch diff --git a/0298-font-Fix-integer-overflow-in-BMP-index.patch b/0293-font-Fix-integer-overflow-in-BMP-index.patch similarity index 100% rename from 0298-font-Fix-integer-overflow-in-BMP-index.patch rename to 0293-font-Fix-integer-overflow-in-BMP-index.patch diff --git a/0299-font-Fix-integer-underflow-in-binary-search-of-char-.patch b/0294-font-Fix-integer-underflow-in-binary-search-of-char-.patch similarity index 100% rename from 0299-font-Fix-integer-underflow-in-binary-search-of-char-.patch rename to 0294-font-Fix-integer-underflow-in-binary-search-of-char-.patch diff --git a/0300-kern-efi-sb-Enforce-verification-of-font-files.patch b/0295-kern-efi-sb-Enforce-verification-of-font-files.patch similarity index 100% rename from 0300-kern-efi-sb-Enforce-verification-of-font-files.patch rename to 0295-kern-efi-sb-Enforce-verification-of-font-files.patch diff --git a/0301-fbutil-Fix-integer-overflow.patch b/0296-fbutil-Fix-integer-overflow.patch similarity index 100% rename from 0301-fbutil-Fix-integer-overflow.patch rename to 0296-fbutil-Fix-integer-overflow.patch diff --git a/0302-font-Fix-an-integer-underflow-in-blit_comb.patch b/0297-font-Fix-an-integer-underflow-in-blit_comb.patch similarity index 100% rename from 0302-font-Fix-an-integer-underflow-in-blit_comb.patch rename to 0297-font-Fix-an-integer-underflow-in-blit_comb.patch diff --git a/0303-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch b/0298-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch similarity index 100% rename from 0303-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch rename to 0298-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch diff --git a/0304-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch b/0299-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch similarity index 100% rename from 0304-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch rename to 0299-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch diff --git a/0305-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch b/0300-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch similarity index 100% rename from 0305-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch rename to 0300-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch diff --git a/0306-ppc64le-signed-boot-media-changes.patch b/0301-ppc64le-signed-boot-media-changes.patch similarity index 100% rename from 0306-ppc64le-signed-boot-media-changes.patch rename to 0301-ppc64le-signed-boot-media-changes.patch diff --git a/0307-mm-Clarify-grub_real_malloc.patch b/0302-mm-Clarify-grub_real_malloc.patch similarity index 100% rename from 0307-mm-Clarify-grub_real_malloc.patch rename to 0302-mm-Clarify-grub_real_malloc.patch diff --git a/0308-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch b/0303-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch similarity index 100% rename from 0308-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch rename to 0303-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch diff --git a/0309-mm-Document-grub_free.patch b/0304-mm-Document-grub_free.patch similarity index 100% rename from 0309-mm-Document-grub_free.patch rename to 0304-mm-Document-grub_free.patch diff --git a/0310-mm-Document-grub_mm_init_region.patch b/0305-mm-Document-grub_mm_init_region.patch similarity index 100% rename from 0310-mm-Document-grub_mm_init_region.patch rename to 0305-mm-Document-grub_mm_init_region.patch diff --git a/0311-mm-Document-GRUB-internal-memory-management-structur.patch b/0306-mm-Document-GRUB-internal-memory-management-structur.patch similarity index 100% rename from 0311-mm-Document-GRUB-internal-memory-management-structur.patch rename to 0306-mm-Document-GRUB-internal-memory-management-structur.patch diff --git a/0312-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch b/0307-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch similarity index 100% rename from 0312-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch rename to 0307-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch diff --git a/0313-mm-When-adding-a-region-merge-with-region-after-as-w.patch b/0308-mm-When-adding-a-region-merge-with-region-after-as-w.patch similarity index 100% rename from 0313-mm-When-adding-a-region-merge-with-region-after-as-w.patch rename to 0308-mm-When-adding-a-region-merge-with-region-after-as-w.patch diff --git a/0314-mm-Debug-support-for-region-operations.patch b/0309-mm-Debug-support-for-region-operations.patch similarity index 100% rename from 0314-mm-Debug-support-for-region-operations.patch rename to 0309-mm-Debug-support-for-region-operations.patch diff --git a/0315-mm-Drop-unused-unloading-of-modules-on-OOM.patch b/0310-mm-Drop-unused-unloading-of-modules-on-OOM.patch similarity index 100% rename from 0315-mm-Drop-unused-unloading-of-modules-on-OOM.patch rename to 0310-mm-Drop-unused-unloading-of-modules-on-OOM.patch diff --git a/0316-mm-Allow-dynamically-requesting-additional-memory-re.patch b/0311-mm-Allow-dynamically-requesting-additional-memory-re.patch similarity index 100% rename from 0316-mm-Allow-dynamically-requesting-additional-memory-re.patch rename to 0311-mm-Allow-dynamically-requesting-additional-memory-re.patch diff --git a/0317-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch b/0312-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch similarity index 100% rename from 0317-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch rename to 0312-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch diff --git a/0318-kern-efi-mm-Extract-function-to-add-memory-regions.patch b/0313-kern-efi-mm-Extract-function-to-add-memory-regions.patch similarity index 100% rename from 0318-kern-efi-mm-Extract-function-to-add-memory-regions.patch rename to 0313-kern-efi-mm-Extract-function-to-add-memory-regions.patch diff --git a/0319-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch b/0314-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch similarity index 100% rename from 0319-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch rename to 0314-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch diff --git a/0320-kern-efi-mm-Implement-runtime-addition-of-pages.patch b/0315-kern-efi-mm-Implement-runtime-addition-of-pages.patch similarity index 100% rename from 0320-kern-efi-mm-Implement-runtime-addition-of-pages.patch rename to 0315-kern-efi-mm-Implement-runtime-addition-of-pages.patch diff --git a/0321-efi-Increase-default-memory-allocation-to-32-MiB.patch b/0316-efi-Increase-default-memory-allocation-to-32-MiB.patch similarity index 100% rename from 0321-efi-Increase-default-memory-allocation-to-32-MiB.patch rename to 0316-efi-Increase-default-memory-allocation-to-32-MiB.patch diff --git a/0322-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch b/0317-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch similarity index 100% rename from 0322-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch rename to 0317-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch diff --git a/0318-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch b/0318-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch new file mode 100644 index 0000000..c337cf0 --- /dev/null +++ b/0318-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 49dbd2ebfb..a957a3074e 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/0319-ieee1275-request-memory-with-ibm-client-architecture.patch b/0319-ieee1275-request-memory-with-ibm-client-architecture.patch new file mode 100644 index 0000000..f0fb08d --- /dev/null +++ b/0319-ieee1275-request-memory-with-ibm-client-architecture.patch @@ -0,0 +1,307 @@ +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) +[rharwood: whitespace, disable_video_support] +--- + grub-core/kern/ieee1275/cmain.c | 5 ++ + grub-core/kern/ieee1275/init.c | 167 ++++++++++++++++++++++++++++++++++++++- + include/grub/ieee1275/ieee1275.h | 10 +++ + 3 files changed, 181 insertions(+), 1 deletion(-) + +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 a957a3074e..560c968460 100644 +--- a/include/grub/ieee1275/ieee1275.h ++++ b/include/grub/ieee1275/ieee1275.h +@@ -139,6 +139,16 @@ enum grub_ieee1275_flag + GRUB_IEEE1275_FLAG_RAW_DEVNAMES, + + 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/0320-ieee1275-drop-len-1-quirk-in-heap_init.patch b/0320-ieee1275-drop-len-1-quirk-in-heap_init.patch new file mode 100644 index 0000000..4ce064b --- /dev/null +++ b/0320-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/0321-ieee1275-support-runtime-memory-claiming.patch b/0321-ieee1275-support-runtime-memory-claiming.patch new file mode 100644 index 0000000..17ad61d --- /dev/null +++ b/0321-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/0322-ieee1275-implement-vec5-for-cas-negotiation.patch b/0322-ieee1275-implement-vec5-for-cas-negotiation.patch new file mode 100644 index 0000000..fad39db --- /dev/null +++ b/0322-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/0323-Enable-shared-processor-mode-in-vector-5.patch b/0323-Enable-shared-processor-mode-in-vector-5.patch deleted file mode 100644 index e92340a..0000000 --- a/0323-Enable-shared-processor-mode-in-vector-5.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Avnish Chouhan -Date: Tue, 24 Jan 2023 08:01:47 -0500 -Subject: [PATCH] Enable shared processor mode in vector 5 - -This patch is to update the vector 5 which is troubling some -machines to bootup properly in shared processor mode. - -Signed-off-by: Avnish Chouhan -(cherry picked from commit 30d2ee836649386a336f9437c8a149c8e642a46b) ---- - 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..7c8b6facec 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 -+ 0, 192, 0, 128, 0, 0, 0, 0, 256 - } - }; - diff --git a/0230-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch b/0323-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch similarity index 82% rename from 0230-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch rename to 0323-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch index 00cf0f7..f1947ed 100644 --- a/0230-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch +++ b/0323-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,13 +26,15 @@ above. Cc: Eric Snowberg Signed-off-by: Stefan Berger -(cherry picked from commit d3e5a8e6ecb8b87701135d97f45d27bbfbf731a2) +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 @@ -51,14 +57,14 @@ index 97abc01f06..407d68f917 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 @@ -86,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) @@ -108,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; + @@ -141,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"; @@ -168,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; @@ -193,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) @@ -208,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 @@ diff --git a/0324-powerpc-Drop-Open-Hack-Ware.patch b/0324-powerpc-Drop-Open-Hack-Ware.patch new file mode 100644 index 0000000..1d201d3 --- /dev/null +++ b/0324-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 f7d861d..f10cfea 100644 --- a/grub.patches +++ b/grub.patches @@ -196,128 +196,129 @@ Patch0195: 0195-appended-signatures-verification-tests.patch Patch0196: 0196-appended-signatures-documentation.patch Patch0197: 0197-ieee1275-enter-lockdown-based-on-ibm-secure-boot.patch Patch0198: 0198-ieee1275-drop-HEAP_MAX_ADDR-HEAP_MIN_SIZE.patch -Patch0199: 0199-ieee1275-claim-more-memory.patch -Patch0200: 0200-ieee1275-request-memory-with-ibm-client-architecture.patch -Patch0201: 0201-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch -Patch0202: 0202-ieee1275-ofdisk-retry-on-open-failure.patch -Patch0203: 0203-01_menu_auto_hide.in-fix-a-then-than-typo.patch -Patch0204: 0204-Fix-disabling-grub-rpm-sort.patch -Patch0205: 0205-Don-t-check-for-rpmvercmp-in-librpm.patch -Patch0206: 0206-Allow-chainloading-EFI-apps-from-loop-mounts.patch -Patch0207: 0207-efinet-Add-DHCP-proxy-support.patch -Patch0208: 0208-fs-ext2-Ignore-checksum-seed-incompat-feature.patch -Patch0209: 0209-Don-t-update-the-cmdline-when-generating-legacy-menu.patch -Patch0210: 0210-Suppress-gettext-error-message.patch -Patch0211: 0211-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch -Patch0212: 0212-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch -Patch0213: 0213-Remove-outdated-URL-for-BLS-document.patch -Patch0214: 0214-templates-Check-for-EFI-at-runtime-instead-of-config.patch -Patch0215: 0215-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch -Patch0216: 0216-arm64-Fix-EFI-loader-kernel-image-allocation.patch -Patch0217: 0217-normal-main-Discover-the-device-to-read-the-config-f.patch -Patch0218: 0218-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch -Patch0219: 0219-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch -Patch0220: 0220-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch -Patch0221: 0221-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch -Patch0222: 0222-Print-module-name-on-license-check-failure.patch -Patch0223: 0223-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch -Patch0224: 0224-grub-mkconfig-restore-umask-for-grub.cfg.patch -Patch0225: 0225-commands-search-Fix-bug-stopping-iteration-when-no-f.patch -Patch0226: 0226-search-new-efidisk-only-option-on-EFI-systems.patch -Patch0227: 0227-efi-new-connectefi-command.patch -Patch0228: 0228-powerpc-do-CAS-in-a-more-compatible-way.patch -Patch0229: 0229-powerpc-prefix-detection-support-device-names-with-c.patch -Patch0230: 0230-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch -Patch0231: 0231-make-ofdisk_retries-optional.patch -Patch0232: 0232-loader-efi-chainloader-grub_load_and_start_image-doe.patch -Patch0233: 0233-loader-efi-chainloader-simplify-the-loader-state.patch -Patch0234: 0234-commands-boot-Add-API-to-pass-context-to-loader.patch -Patch0235: 0235-loader-efi-chainloader-Use-grub_loader_set_ex.patch -Patch0236: 0236-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch -Patch0237: 0237-loader-i386-efi-linux-Use-grub_loader_set_ex.patch -Patch0238: 0238-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch -Patch0239: 0239-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch -Patch0240: 0240-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch -Patch0241: 0241-video-readers-png-Abort-sooner-if-a-read-operation-f.patch -Patch0242: 0242-video-readers-png-Refuse-to-handle-multiple-image-he.patch -Patch0243: 0243-video-readers-png-Drop-greyscale-support-to-fix-heap.patch -Patch0244: 0244-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch -Patch0245: 0245-video-readers-png-Sanity-check-some-huffman-codes.patch -Patch0246: 0246-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch -Patch0247: 0247-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch -Patch0248: 0248-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch -Patch0249: 0249-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch -Patch0250: 0250-normal-charset-Fix-array-out-of-bounds-formatting-un.patch -Patch0251: 0251-net-netbuff-Block-overly-large-netbuff-allocs.patch -Patch0252: 0252-net-ip-Do-IP-fragment-maths-safely.patch -Patch0253: 0253-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch -Patch0254: 0254-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch -Patch0255: 0255-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch -Patch0256: 0256-net-tftp-Avoid-a-trivial-UAF.patch -Patch0257: 0257-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch -Patch0258: 0258-net-http-Fix-OOB-write-for-split-http-headers.patch -Patch0259: 0259-net-http-Error-out-on-headers-with-LF-without-CR.patch -Patch0260: 0260-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch -Patch0261: 0261-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch -Patch0262: 0262-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch -Patch0263: 0263-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch -Patch0264: 0264-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch -Patch0265: 0265-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch -Patch0266: 0266-misc-Make-grub_min-and-grub_max-more-resilient.patch -Patch0267: 0267-ReiserFS-switch-to-using-grub_min-grub_max.patch -Patch0268: 0268-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch -Patch0269: 0269-modules-make-.module_license-read-only.patch -Patch0270: 0270-modules-strip-.llvm_addrsig-sections-and-similar.patch -Patch0271: 0271-modules-Don-t-allocate-space-for-non-allocable-secti.patch -Patch0272: 0272-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch -Patch0273: 0273-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch -Patch0274: 0274-modules-load-module-sections-at-page-aligned-address.patch -Patch0275: 0275-nx-add-memory-attribute-get-set-API.patch -Patch0276: 0276-nx-set-page-permissions-for-loaded-modules.patch -Patch0277: 0277-nx-set-attrs-in-our-kernel-loaders.patch -Patch0278: 0278-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch -Patch0279: 0279-Make-debug-file-show-which-file-filters-get-run.patch -Patch0280: 0280-efi-use-enumerated-array-positions-for-our-allocatio.patch -Patch0281: 0281-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch -Patch0282: 0282-efi-allocate-the-initrd-within-the-bounds-expressed-.patch -Patch0283: 0283-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch -Patch0284: 0284-BLS-create-etc-kernel-cmdline-during-mkconfig.patch -Patch0285: 0285-ieee1275-implement-vec5-for-cas-negotiation.patch -Patch0286: 0286-squish-don-t-dup-rhgb-quiet-check-mtimes.patch -Patch0287: 0287-squish-give-up-on-rhgb-quiet.patch -Patch0288: 0288-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch -Patch0289: 0289-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch -Patch0290: 0290-commands-efi-tpm-Refine-the-status-of-log-event.patch -Patch0291: 0291-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch -Patch0292: 0292-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch -Patch0293: 0293-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch -Patch0294: 0294-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch -Patch0295: 0295-font-Fix-several-integer-overflows-in-grub_font_cons.patch -Patch0296: 0296-font-Remove-grub_font_dup_glyph.patch -Patch0297: 0297-font-Fix-integer-overflow-in-ensure_comb_space.patch -Patch0298: 0298-font-Fix-integer-overflow-in-BMP-index.patch -Patch0299: 0299-font-Fix-integer-underflow-in-binary-search-of-char-.patch -Patch0300: 0300-kern-efi-sb-Enforce-verification-of-font-files.patch -Patch0301: 0301-fbutil-Fix-integer-overflow.patch -Patch0302: 0302-font-Fix-an-integer-underflow-in-blit_comb.patch -Patch0303: 0303-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch -Patch0304: 0304-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch -Patch0305: 0305-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch -Patch0306: 0306-ppc64le-signed-boot-media-changes.patch -Patch0307: 0307-mm-Clarify-grub_real_malloc.patch -Patch0308: 0308-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch -Patch0309: 0309-mm-Document-grub_free.patch -Patch0310: 0310-mm-Document-grub_mm_init_region.patch -Patch0311: 0311-mm-Document-GRUB-internal-memory-management-structur.patch -Patch0312: 0312-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch -Patch0313: 0313-mm-When-adding-a-region-merge-with-region-after-as-w.patch -Patch0314: 0314-mm-Debug-support-for-region-operations.patch -Patch0315: 0315-mm-Drop-unused-unloading-of-modules-on-OOM.patch -Patch0316: 0316-mm-Allow-dynamically-requesting-additional-memory-re.patch -Patch0317: 0317-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch -Patch0318: 0318-kern-efi-mm-Extract-function-to-add-memory-regions.patch -Patch0319: 0319-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch -Patch0320: 0320-kern-efi-mm-Implement-runtime-addition-of-pages.patch -Patch0321: 0321-efi-Increase-default-memory-allocation-to-32-MiB.patch -Patch0322: 0322-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch -Patch0323: 0323-Enable-shared-processor-mode-in-vector-5.patch +Patch0199: 0199-appendedsig-x509-Also-handle-the-Extended-Key-Usage-.patch +Patch0200: 0200-ieee1275-ofdisk-retry-on-open-failure.patch +Patch0201: 0201-01_menu_auto_hide.in-fix-a-then-than-typo.patch +Patch0202: 0202-Fix-disabling-grub-rpm-sort.patch +Patch0203: 0203-Don-t-check-for-rpmvercmp-in-librpm.patch +Patch0204: 0204-Allow-chainloading-EFI-apps-from-loop-mounts.patch +Patch0205: 0205-efinet-Add-DHCP-proxy-support.patch +Patch0206: 0206-fs-ext2-Ignore-checksum-seed-incompat-feature.patch +Patch0207: 0207-Don-t-update-the-cmdline-when-generating-legacy-menu.patch +Patch0208: 0208-Suppress-gettext-error-message.patch +Patch0209: 0209-grub-boot-success.timer-Only-run-if-not-in-a-contain.patch +Patch0210: 0210-grub-set-password-Always-use-boot-grub2-user.cfg-as-.patch +Patch0211: 0211-Remove-outdated-URL-for-BLS-document.patch +Patch0212: 0212-templates-Check-for-EFI-at-runtime-instead-of-config.patch +Patch0213: 0213-efi-Print-an-error-if-boot-to-firmware-setup-is-not-.patch +Patch0214: 0214-arm64-Fix-EFI-loader-kernel-image-allocation.patch +Patch0215: 0215-normal-main-Discover-the-device-to-read-the-config-f.patch +Patch0216: 0216-powerpc-adjust-setting-of-prefix-for-signed-binary-c.patch +Patch0217: 0217-powerpc-fix-prefix-signed-grub-special-case-for-Powe.patch +Patch0218: 0218-Arm-check-for-the-PE-magic-for-the-compiled-arch.patch +Patch0219: 0219-fs-xfs-Fix-unreadable-filesystem-with-v4-superblock.patch +Patch0220: 0220-Print-module-name-on-license-check-failure.patch +Patch0221: 0221-powerpc-ieee1275-load-grub-at-4MB-not-2MB.patch +Patch0222: 0222-grub-mkconfig-restore-umask-for-grub.cfg.patch +Patch0223: 0223-commands-search-Fix-bug-stopping-iteration-when-no-f.patch +Patch0224: 0224-search-new-efidisk-only-option-on-EFI-systems.patch +Patch0225: 0225-efi-new-connectefi-command.patch +Patch0226: 0226-powerpc-prefix-detection-support-device-names-with-c.patch +Patch0227: 0227-make-ofdisk_retries-optional.patch +Patch0228: 0228-loader-efi-chainloader-grub_load_and_start_image-doe.patch +Patch0229: 0229-loader-efi-chainloader-simplify-the-loader-state.patch +Patch0230: 0230-commands-boot-Add-API-to-pass-context-to-loader.patch +Patch0231: 0231-loader-efi-chainloader-Use-grub_loader_set_ex.patch +Patch0232: 0232-loader-i386-efi-linux-Avoid-a-use-after-free-in-the-.patch +Patch0233: 0233-loader-i386-efi-linux-Use-grub_loader_set_ex.patch +Patch0234: 0234-loader-i386-efi-linux-Fix-a-memory-leak-in-the-initr.patch +Patch0235: 0235-kern-efi-sb-Reject-non-kernel-files-in-the-shim_lock.patch +Patch0236: 0236-kern-file-Do-not-leak-device_name-on-error-in-grub_f.patch +Patch0237: 0237-video-readers-png-Abort-sooner-if-a-read-operation-f.patch +Patch0238: 0238-video-readers-png-Refuse-to-handle-multiple-image-he.patch +Patch0239: 0239-video-readers-png-Drop-greyscale-support-to-fix-heap.patch +Patch0240: 0240-video-readers-png-Avoid-heap-OOB-R-W-inserting-huff-.patch +Patch0241: 0241-video-readers-png-Sanity-check-some-huffman-codes.patch +Patch0242: 0242-video-readers-jpeg-Abort-sooner-if-a-read-operation-.patch +Patch0243: 0243-video-readers-jpeg-Do-not-reallocate-a-given-huff-ta.patch +Patch0244: 0244-video-readers-jpeg-Refuse-to-handle-multiple-start-o.patch +Patch0245: 0245-video-readers-jpeg-Block-int-underflow-wild-pointer-.patch +Patch0246: 0246-normal-charset-Fix-array-out-of-bounds-formatting-un.patch +Patch0247: 0247-net-netbuff-Block-overly-large-netbuff-allocs.patch +Patch0248: 0248-net-ip-Do-IP-fragment-maths-safely.patch +Patch0249: 0249-net-dns-Fix-double-free-addresses-on-corrupt-DNS-res.patch +Patch0250: 0250-net-dns-Don-t-read-past-the-end-of-the-string-we-re-.patch +Patch0251: 0251-net-tftp-Prevent-a-UAF-and-double-free-from-a-failed.patch +Patch0252: 0252-net-tftp-Avoid-a-trivial-UAF.patch +Patch0253: 0253-net-http-Do-not-tear-down-socket-if-it-s-already-bee.patch +Patch0254: 0254-net-http-Fix-OOB-write-for-split-http-headers.patch +Patch0255: 0255-net-http-Error-out-on-headers-with-LF-without-CR.patch +Patch0256: 0256-fs-f2fs-Do-not-read-past-the-end-of-nat-journal-entr.patch +Patch0257: 0257-fs-f2fs-Do-not-read-past-the-end-of-nat-bitmap.patch +Patch0258: 0258-fs-f2fs-Do-not-copy-file-names-that-are-too-long.patch +Patch0259: 0259-fs-btrfs-Fix-several-fuzz-issues-with-invalid-dir-it.patch +Patch0260: 0260-fs-btrfs-Fix-more-ASAN-and-SEGV-issues-found-with-fu.patch +Patch0261: 0261-fs-btrfs-Fix-more-fuzz-issues-related-to-chunks.patch +Patch0262: 0262-misc-Make-grub_min-and-grub_max-more-resilient.patch +Patch0263: 0263-ReiserFS-switch-to-using-grub_min-grub_max.patch +Patch0264: 0264-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch +Patch0265: 0265-modules-make-.module_license-read-only.patch +Patch0266: 0266-modules-strip-.llvm_addrsig-sections-and-similar.patch +Patch0267: 0267-modules-Don-t-allocate-space-for-non-allocable-secti.patch +Patch0268: 0268-pe-add-the-DOS-header-struct-and-fix-some-bad-naming.patch +Patch0269: 0269-EFI-allocate-kernel-in-EFI_RUNTIME_SERVICES_CODE-ins.patch +Patch0270: 0270-modules-load-module-sections-at-page-aligned-address.patch +Patch0271: 0271-nx-add-memory-attribute-get-set-API.patch +Patch0272: 0272-nx-set-page-permissions-for-loaded-modules.patch +Patch0273: 0273-nx-set-attrs-in-our-kernel-loaders.patch +Patch0274: 0274-nx-set-the-nx-compatible-flag-in-EFI-grub-images.patch +Patch0275: 0275-Make-debug-file-show-which-file-filters-get-run.patch +Patch0276: 0276-efi-use-enumerated-array-positions-for-our-allocatio.patch +Patch0277: 0277-efi-split-allocation-policy-for-kernel-vs-initrd-mem.patch +Patch0278: 0278-efi-allocate-the-initrd-within-the-bounds-expressed-.patch +Patch0279: 0279-efi-use-EFI_LOADER_-CODE-DATA-for-kernel-and-initrd-.patch +Patch0280: 0280-BLS-create-etc-kernel-cmdline-during-mkconfig.patch +Patch0281: 0281-squish-don-t-dup-rhgb-quiet-check-mtimes.patch +Patch0282: 0282-squish-give-up-on-rhgb-quiet.patch +Patch0283: 0283-squish-BLS-only-write-etc-kernel-cmdline-if-writable.patch +Patch0284: 0284-x86-efi-Fix-an-incorrect-array-size-in-kernel-alloca.patch +Patch0285: 0285-commands-efi-tpm-Refine-the-status-of-log-event.patch +Patch0286: 0286-commands-efi-tpm-Use-grub_strcpy-instead-of-grub_mem.patch +Patch0287: 0287-efi-tpm-Add-EFI_CC_MEASUREMENT_PROTOCOL-support.patch +Patch0288: 0288-font-Reject-glyphs-exceeds-font-max_glyph_width-or-f.patch +Patch0289: 0289-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch +Patch0290: 0290-font-Fix-several-integer-overflows-in-grub_font_cons.patch +Patch0291: 0291-font-Remove-grub_font_dup_glyph.patch +Patch0292: 0292-font-Fix-integer-overflow-in-ensure_comb_space.patch +Patch0293: 0293-font-Fix-integer-overflow-in-BMP-index.patch +Patch0294: 0294-font-Fix-integer-underflow-in-binary-search-of-char-.patch +Patch0295: 0295-kern-efi-sb-Enforce-verification-of-font-files.patch +Patch0296: 0296-fbutil-Fix-integer-overflow.patch +Patch0297: 0297-font-Fix-an-integer-underflow-in-blit_comb.patch +Patch0298: 0298-font-Harden-grub_font_blit_glyph-and-grub_font_blit_.patch +Patch0299: 0299-font-Assign-null_font-to-glyphs-in-ascii_font_glyph.patch +Patch0300: 0300-normal-charset-Fix-an-integer-overflow-in-grub_unico.patch +Patch0301: 0301-ppc64le-signed-boot-media-changes.patch +Patch0302: 0302-mm-Clarify-grub_real_malloc.patch +Patch0303: 0303-mm-grub_real_malloc-Make-small-allocs-comment-match-.patch +Patch0304: 0304-mm-Document-grub_free.patch +Patch0305: 0305-mm-Document-grub_mm_init_region.patch +Patch0306: 0306-mm-Document-GRUB-internal-memory-management-structur.patch +Patch0307: 0307-mm-Assert-that-we-preserve-header-vs-region-alignmen.patch +Patch0308: 0308-mm-When-adding-a-region-merge-with-region-after-as-w.patch +Patch0309: 0309-mm-Debug-support-for-region-operations.patch +Patch0310: 0310-mm-Drop-unused-unloading-of-modules-on-OOM.patch +Patch0311: 0311-mm-Allow-dynamically-requesting-additional-memory-re.patch +Patch0312: 0312-kern-efi-mm-Always-request-a-fixed-number-of-pages-o.patch +Patch0313: 0313-kern-efi-mm-Extract-function-to-add-memory-regions.patch +Patch0314: 0314-kern-efi-mm-Pass-up-errors-from-add_memory_regions.patch +Patch0315: 0315-kern-efi-mm-Implement-runtime-addition-of-pages.patch +Patch0316: 0316-efi-Increase-default-memory-allocation-to-32-MiB.patch +Patch0317: 0317-mm-Try-invalidate-disk-caches-last-when-out-of-memor.patch +Patch0318: 0318-powerpc-Drop-Open-Hack-Ware-remove-GRUB_IEEE1275_FLA.patch +Patch0319: 0319-ieee1275-request-memory-with-ibm-client-architecture.patch +Patch0320: 0320-ieee1275-drop-len-1-quirk-in-heap_init.patch +Patch0321: 0321-ieee1275-support-runtime-memory-claiming.patch +Patch0322: 0322-ieee1275-implement-vec5-for-cas-negotiation.patch +Patch0323: 0323-ibmvtpm-Add-support-for-trusted-boot-using-a-vTPM-2..patch +Patch0324: 0324-powerpc-Drop-Open-Hack-Ware.patch diff --git a/grub2.spec b/grub2.spec index eaa1578..6ce0a6d 100644 --- a/grub2.spec +++ b/grub2.spec @@ -14,7 +14,7 @@ Name: grub2 Epoch: 1 Version: 2.06 -Release: 58%{?dist} +Release: 59%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -532,6 +532,10 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog +* Wed Feb 08 2023 Robbie Harwood - 2.06-59 +- ppc64le: sync cas/tpm patchset with upstream +- Resolves: #2143420 + * Mon Feb 06 2023 Robbie Harwood - 2.06-58 - ppc64le: cas5, take 3 - Resolves: #2153071