Merge branch 'stable/for-linus-5.15' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 31 Aug 2021 22:28:21 +0000 (15:28 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 31 Aug 2021 22:28:21 +0000 (15:28 -0700)
Pull ibft updates from Konrad Rzeszutek Wilk:
 "A fix for iBFT parsing code badly interfacing when KASLR is enabled"

* 'stable/for-linus-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/ibft:
  iscsi_ibft: fix warning in reserve_ibft_region()
  iscsi_ibft: fix crash due to KASLR physical memory remapping

1  2 
arch/x86/kernel/setup.c

diff --combined arch/x86/kernel/setup.c
@@@ -14,7 -14,6 +14,7 @@@
  #include <linux/initrd.h>
  #include <linux/iscsi_ibft.h>
  #include <linux/memblock.h>
 +#include <linux/panic_notifier.h>
  #include <linux/pci.h>
  #include <linux/root_dev.h>
  #include <linux/hugetlb.h>
@@@ -572,16 -571,6 +572,6 @@@ void __init reserve_standard_io_resourc
  
  }
  
- static __init void reserve_ibft_region(void)
- {
-       unsigned long addr, size = 0;
-       addr = find_ibft_region(&size);
-       if (size)
-               memblock_reserve(addr, size);
- }
  static bool __init snb_gfx_workaround_needed(void)
  {
  #ifdef CONFIG_PCI
@@@ -696,6 -685,30 +686,6 @@@ static void __init e820_add_kernel_rang
        e820__range_add(start, size, E820_TYPE_RAM);
  }
  
 -static unsigned reserve_low = CONFIG_X86_RESERVE_LOW << 10;
 -
 -static int __init parse_reservelow(char *p)
 -{
 -      unsigned long long size;
 -
 -      if (!p)
 -              return -EINVAL;
 -
 -      size = memparse(p, &p);
 -
 -      if (size < 4096)
 -              size = 4096;
 -
 -      if (size > 640*1024)
 -              size = 640*1024;
 -
 -      reserve_low = size;
 -
 -      return 0;
 -}
 -
 -early_param("reservelow", parse_reservelow);
 -
  static void __init early_reserve_memory(void)
  {
        /*
@@@ -847,7 -860,10 +837,7 @@@ void __init setup_arch(char **cmdline_p
  
        if (!boot_params.hdr.root_flags)
                root_mountflags &= ~MS_RDONLY;
 -      init_mm.start_code = (unsigned long) _text;
 -      init_mm.end_code = (unsigned long) _etext;
 -      init_mm.end_data = (unsigned long) _edata;
 -      init_mm.brk = _brk_end;
 +      setup_initial_init_mm(_text, _etext, _edata, (void *)_brk_end);
  
        code_resource.start = __pa_symbol(_text);
        code_resource.end = __pa_symbol(_etext)-1;
  #endif
  
        /*
 -       * Find free memory for the real mode trampoline and place it
 -       * there.
 -       * If there is not enough free memory under 1M, on EFI-enabled
 -       * systems there will be additional attempt to reclaim the memory
 -       * for the real mode trampoline at efi_free_boot_services().
 +       * Find free memory for the real mode trampoline and place it there. If
 +       * there is not enough free memory under 1M, on EFI-enabled systems
 +       * there will be additional attempt to reclaim the memory for the real
 +       * mode trampoline at efi_free_boot_services().
 +       *
 +       * Unconditionally reserve the entire first 1M of RAM because BIOSes
 +       * are known to corrupt low memory and several hundred kilobytes are not
 +       * worth complex detection what memory gets clobbered. Windows does the
 +       * same thing for very similar reasons.
         *
 -       * Unconditionally reserve the entire first 1M of RAM because
 -       * BIOSes are know to corrupt low memory and several
 -       * hundred kilobytes are not worth complex detection what memory gets
 -       * clobbered. Moreover, on machines with SandyBridge graphics or in
 -       * setups that use crashkernel the entire 1M is reserved anyway.
 +       * Moreover, on machines with SandyBridge graphics or in setups that use
 +       * crashkernel the entire 1M is reserved anyway.
         */
        reserve_real_mode();