Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'efi-fixes-for-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI fix from Ard Biesheuvel:
"Follow-up fix for the unaccepted memory fix merged last week as part
of the first EFI fixes batch.

The unaccepted memory table needs to be accessible very early, even in
cases (such as crashkernels) where the direct map does not cover all
of DRAM, and so it is added to memblock explicitly, and subsequently
memblock_reserve()'d as before"

* tag 'efi-fixes-for-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
efi/unaccepted: Make sure unaccepted table is mapped

+29 -3
+29 -3
drivers/firmware/efi/efi.c
··· 623 623 return 0; 624 624 } 625 625 626 + /** 627 + * reserve_unaccepted - Map and reserve unaccepted configuration table 628 + * @unaccepted: Pointer to unaccepted memory table 629 + * 630 + * memblock_add() makes sure that the table is mapped in direct mapping. During 631 + * normal boot it happens automatically because the table is allocated from 632 + * usable memory. But during crashkernel boot only memory specifically reserved 633 + * for crash scenario is mapped. memblock_add() forces the table to be mapped 634 + * in crashkernel case. 635 + * 636 + * Align the range to the nearest page borders. Ranges smaller than page size 637 + * are not going to be mapped. 638 + * 639 + * memblock_reserve() makes sure that future allocations will not touch the 640 + * table. 641 + */ 642 + 643 + static __init void reserve_unaccepted(struct efi_unaccepted_memory *unaccepted) 644 + { 645 + phys_addr_t start, size; 646 + 647 + start = PAGE_ALIGN_DOWN(efi.unaccepted); 648 + size = PAGE_ALIGN(sizeof(*unaccepted) + unaccepted->size); 649 + 650 + memblock_add(start, size); 651 + memblock_reserve(start, size); 652 + } 653 + 626 654 int __init efi_config_parse_tables(const efi_config_table_t *config_tables, 627 655 int count, 628 656 const efi_config_table_type_t *arch_tables) ··· 779 751 780 752 unaccepted = early_memremap(efi.unaccepted, sizeof(*unaccepted)); 781 753 if (unaccepted) { 782 - unsigned long size; 783 754 784 755 if (unaccepted->version == 1) { 785 - size = sizeof(*unaccepted) + unaccepted->size; 786 - memblock_reserve(efi.unaccepted, size); 756 + reserve_unaccepted(unaccepted); 787 757 } else { 788 758 efi.unaccepted = EFI_INVALID_TABLE_ADDR; 789 759 }