]> Git Repo - linux.git/commitdiff
Merge patch series "riscv: 64-bit NOMMU fixes and enhancements"
authorPalmer Dabbelt <[email protected]>
Tue, 9 Apr 2024 18:39:46 +0000 (11:39 -0700)
committerPalmer Dabbelt <[email protected]>
Sun, 28 Apr 2024 21:50:35 +0000 (14:50 -0700)
Samuel Holland <[email protected]> says:

This series aims to improve support for NOMMU, specifically by making it
easier to test NOMMU kernels in QEMU and on various widely-available
hardware (errata permitting). After all, everything supports Svbare...

After applying this series, a NOMMU kernel based on defconfig (changing
only the three options below*) boots to userspace on QEMU when passed as
-kernel.

  # CONFIG_RISCV_M_MODE is not set
  # CONFIG_MMU is not set
  CONFIG_NONPORTABLE=y

*if you are using LLD, you must also disable BPF_SYSCALL and KALLSYMS,
because LLD bails on out-of-range references to undefined weak symbols.

* b4-shazam-merge:
  riscv: Allow NOMMU kernels to run in S-mode
  riscv: Remove MMU dependency from Zbb and Zicboz
  riscv: Fix loading 64-bit NOMMU kernels past the start of RAM
  riscv: Fix TASK_SIZE on 64-bit NOMMU

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>
1  2 
arch/riscv/Kconfig
arch/riscv/include/asm/page.h
arch/riscv/include/asm/pgtable.h
arch/riscv/mm/init.c

diff --combined arch/riscv/Kconfig
index cad31864fd0f81fcd1dcddd800fb323c5887274d,0dc09b2ac2f6ecfff6a75d90ae1fa6821a87e626..d77d416dcd8f47046f104f36f89399fe7a174066
@@@ -27,21 -27,17 +27,21 @@@ config RISC
        select ARCH_HAS_GCOV_PROFILE_ALL
        select ARCH_HAS_GIGANTIC_PAGE
        select ARCH_HAS_KCOV
 +      select ARCH_HAS_MEMBARRIER_CALLBACKS
 +      select ARCH_HAS_MEMBARRIER_SYNC_CORE
        select ARCH_HAS_MMIOWB
        select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
        select ARCH_HAS_PMEM_API
 +      select ARCH_HAS_PREPARE_SYNC_CORE_CMD
        select ARCH_HAS_PTE_SPECIAL
        select ARCH_HAS_SET_DIRECT_MAP if MMU
        select ARCH_HAS_SET_MEMORY if MMU
        select ARCH_HAS_STRICT_KERNEL_RWX if MMU && !XIP_KERNEL
        select ARCH_HAS_STRICT_MODULE_RWX if MMU && !XIP_KERNEL
 +      select ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
        select ARCH_HAS_SYSCALL_WRAPPER
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
 -      select ARCH_HAS_UBSAN_SANITIZE_ALL
 +      select ARCH_HAS_UBSAN
        select ARCH_HAS_VDSO_DATA
        select ARCH_KEEP_MEMBLOCK if ACPI
        select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
@@@ -51,9 -47,6 +51,9 @@@
        select ARCH_SUPPORTS_CFI_CLANG
        select ARCH_SUPPORTS_DEBUG_PAGEALLOC if MMU
        select ARCH_SUPPORTS_HUGETLBFS if MMU
 +      # LLD >= 14: https://github.com/llvm/llvm-project/issues/50505
 +      select ARCH_SUPPORTS_LTO_CLANG if LLD_VERSION >= 140000
 +      select ARCH_SUPPORTS_LTO_CLANG_THIN if LLD_VERSION >= 140000
        select ARCH_SUPPORTS_PAGE_TABLE_CHECK if MMU
        select ARCH_SUPPORTS_PER_VMA_LOCK if MMU
        select ARCH_SUPPORTS_SHADOW_CALL_STACK if HAVE_SHADOW_CALL_STACK
@@@ -71,7 -64,7 +71,7 @@@
        select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
        select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
        select BUILDTIME_TABLE_SORT if MMU
-       select CLINT_TIMER if !MMU
+       select CLINT_TIMER if RISCV_M_MODE
        select CLONE_BACKWARDS
        select COMMON_CLK
        select CPU_PM if CPU_IDLE || HIBERNATION || SUSPEND
        select HAVE_ARCH_KGDB_QXFER_PKT
        select HAVE_ARCH_MMAP_RND_BITS if MMU
        select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
 +      select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_THREAD_STRUCT_WHITELIST
        select HAVE_ARCH_TRACEHOOK
        select HAVE_FUNCTION_GRAPH_RETVAL if HAVE_FUNCTION_GRAPH_TRACER
        select HAVE_FUNCTION_TRACER if !XIP_KERNEL && !PREEMPTION
        select HAVE_EBPF_JIT if MMU
 +      select HAVE_FAST_GUP if MMU
        select HAVE_FUNCTION_ARG_ACCESS_API
        select HAVE_FUNCTION_ERROR_INJECTION
        select HAVE_GCC_PLUGINS
        select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if !LD_IS_LLD
        select HAVE_MOVE_PMD
        select HAVE_MOVE_PUD
 +      select HAVE_PAGE_SIZE_4KB
        select HAVE_PCI
        select HAVE_PERF_EVENTS
        select HAVE_PERF_REGS
        select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_RETHOOK if !XIP_KERNEL
        select HAVE_RSEQ
 +      select HAVE_RUST if 64BIT
        select HAVE_SAMPLE_FTRACE_DIRECT
        select HAVE_SAMPLE_FTRACE_DIRECT_MULTI
        select HAVE_STACKPROTECTOR
        select IRQ_FORCED_THREADING
        select KASAN_VMALLOC if KASAN
        select LOCK_MM_AND_FIND_VMA
 +      select MMU_GATHER_RCU_TABLE_FREE if SMP && MMU
        select MODULES_USE_ELF_RELA if MODULES
        select MODULE_SECTIONS if MODULES
        select OF
  
  config CLANG_SUPPORTS_DYNAMIC_FTRACE
        def_bool CC_IS_CLANG
 -      # https://github.com/llvm/llvm-project/commit/6ab8927931851bb42b2c93a00801dc499d7d9b1e
 -      depends on CLANG_VERSION >= 130000
        # https://github.com/ClangBuiltLinux/linux/issues/1817
        depends on AS_IS_GNU || (AS_IS_LLVM && (LD_IS_LLD || LD_VERSION >= 23600))
  
@@@ -230,8 -220,12 +230,12 @@@ config ARCH_MMAP_RND_COMPAT_BITS_MA
  
  # set if we run in machine mode, cleared if we run in supervisor mode
  config RISCV_M_MODE
-       bool
-       default !MMU
+       bool "Build a kernel that runs in machine mode"
+       depends on !MMU
+       default y
+       help
+         Select this option if you want to run the kernel in M-mode,
+         without the assistance of any other firmware.
  
  # set if we are running in S-mode and can use SBI calls
  config RISCV_SBI
@@@ -248,8 -242,9 +252,9 @@@ config MM
  
  config PAGE_OFFSET
        hex
-       default 0xC0000000 if 32BIT && MMU
-       default 0x80000000 if !MMU
+       default 0x80000000 if !MMU && RISCV_M_MODE
+       default 0x80200000 if !MMU
+       default 0xc0000000 if 32BIT
        default 0xff60000000000000 if 64BIT
  
  config KASAN_SHADOW_OFFSET
@@@ -322,9 -317,10 +327,9 @@@ config AS_HAS_INS
        def_bool $(as-instr,.insn r 51$(comma) 0$(comma) 0$(comma) t0$(comma) t0$(comma) zero)
  
  config AS_HAS_OPTION_ARCH
 -      # https://reviews.llvm.org/D123515
 +      # https://github.com/llvm/llvm-project/commit/9e8ed3403c191ab9c4903e8eeb8f732ff8a43cb4
        def_bool y
        depends on $(as-instr, .option arch$(comma) +m)
 -      depends on !$(as-instr, .option arch$(comma) -i)
  
  source "arch/riscv/Kconfig.socs"
  source "arch/riscv/Kconfig.errata"
@@@ -587,17 -583,9 +592,16 @@@ config TOOLCHAIN_HAS_ZB
        depends on LLD_VERSION >= 150000 || LD_VERSION >= 23900
        depends on AS_HAS_OPTION_ARCH
  
 +# This symbol indicates that the toolchain supports all v1.0 vector crypto
 +# extensions, including Zvk*, Zvbb, and Zvbc.  LLVM added all of these at once.
 +# binutils added all except Zvkb, then added Zvkb.  So we just check for Zvkb.
 +config TOOLCHAIN_HAS_VECTOR_CRYPTO
 +      def_bool $(as-instr, .option arch$(comma) +v$(comma) +zvkb)
 +      depends on AS_HAS_OPTION_ARCH
 +
  config RISCV_ISA_ZBB
        bool "Zbb extension support for bit manipulation instructions"
        depends on TOOLCHAIN_HAS_ZBB
-       depends on MMU
        depends on RISCV_ALTERNATIVE
        default y
        help
@@@ -629,7 -617,6 +633,6 @@@ config RISCV_ISA_ZICBO
  
  config RISCV_ISA_ZICBOZ
        bool "Zicboz extension support for faster zeroing of memory"
-       depends on MMU
        depends on RISCV_ALTERNATIVE
        default y
        help
@@@ -704,61 -691,27 +707,61 @@@ config THREAD_SIZE_ORDE
          affects irq stack size, which is equal to thread stack size.
  
  config RISCV_MISALIGNED
 -      bool "Support misaligned load/store traps for kernel and userspace"
 +      bool
        select SYSCTL_ARCH_UNALIGN_ALLOW
 -      default y
        help
 -        Say Y here if you want the kernel to embed support for misaligned
 -        load/store for both kernel and userspace. When disable, misaligned
 -        accesses will generate SIGBUS in userspace and panic in kernel.
 +        Embed support for emulating misaligned loads and stores.
 +
 +choice
 +      prompt "Unaligned Accesses Support"
 +      default RISCV_PROBE_UNALIGNED_ACCESS
 +      help
 +        This determines the level of support for unaligned accesses. This
 +        information is used by the kernel to perform optimizations. It is also
 +        exposed to user space via the hwprobe syscall. The hardware will be
 +        probed at boot by default.
 +
 +config RISCV_PROBE_UNALIGNED_ACCESS
 +      bool "Probe for hardware unaligned access support"
 +      select RISCV_MISALIGNED
 +      help
 +        During boot, the kernel will run a series of tests to determine the
 +        speed of unaligned accesses. This probing will dynamically determine
 +        the speed of unaligned accesses on the underlying system. If unaligned
 +        memory accesses trap into the kernel as they are not supported by the
 +        system, the kernel will emulate the unaligned accesses to preserve the
 +        UABI.
 +
 +config RISCV_EMULATED_UNALIGNED_ACCESS
 +      bool "Emulate unaligned access where system support is missing"
 +      select RISCV_MISALIGNED
 +      help
 +        If unaligned memory accesses trap into the kernel as they are not
 +        supported by the system, the kernel will emulate the unaligned
 +        accesses to preserve the UABI. When the underlying system does support
 +        unaligned accesses, the unaligned accesses are assumed to be slow.
 +
 +config RISCV_SLOW_UNALIGNED_ACCESS
 +      bool "Assume the system supports slow unaligned memory accesses"
 +      depends on NONPORTABLE
 +      help
 +        Assume that the system supports slow unaligned memory accesses. The
 +        kernel and userspace programs may not be able to run at all on systems
 +        that do not support unaligned memory accesses.
  
  config RISCV_EFFICIENT_UNALIGNED_ACCESS
 -      bool "Assume the CPU supports fast unaligned memory accesses"
 +      bool "Assume the system supports fast unaligned memory accesses"
        depends on NONPORTABLE
        select DCACHE_WORD_ACCESS if MMU
        select HAVE_EFFICIENT_UNALIGNED_ACCESS
        help
 -        Say Y here if you want the kernel to assume that the CPU supports
 -        efficient unaligned memory accesses.  When enabled, this option
 -        improves the performance of the kernel on such CPUs.  However, the
 -        kernel will run much more slowly, or will not be able to run at all,
 -        on CPUs that do not support efficient unaligned memory accesses.
 +        Assume that the system supports fast unaligned memory accesses. When
 +        enabled, this option improves the performance of the kernel on such
 +        systems. However, the kernel and userspace programs will run much more
 +        slowly, or will not be able to run at all, on systems that do not
 +        support efficient unaligned memory accesses.
  
 -        If unsure what to do here, say N.
 +endchoice
  
  endmenu # "Platform type"
  
@@@ -817,7 -770,7 +820,7 @@@ config ARCH_SUPPORTS_CRASH_DUM
        def_bool y
  
  config ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION
 -      def_bool CRASH_CORE
 +      def_bool CRASH_RESERVE
  
  config COMPAT
        bool "Kernel support for 32-bit U-mode"
@@@ -1033,19 -986,7 +1036,19 @@@ config RISCV_ISA_FALLBAC
  config BUILTIN_DTB
        bool "Built-in device tree"
        depends on OF && NONPORTABLE
 -      default y if XIP_KERNEL
 +      help
 +        Build a device tree into the Linux image.
 +        This option should be selected if no bootloader is being used.
 +        If unsure, say N.
 +
 +
 +config BUILTIN_DTB_SOURCE
 +      string "Built-in device tree source"
 +      depends on BUILTIN_DTB
 +      help
 +        DTS file path (without suffix, relative to arch/riscv/boot/dts)
 +        for the DTS file that will be used to produce the DTB linked into the
 +        kernel.
  
  endmenu # "Boot options"
  
@@@ -1063,8 -1004,11 +1066,8 @@@ menu "Power management options
  
  source "kernel/power/Kconfig"
  
 -# Hibernation is only possible on systems where the SBI implementation has
 -# marked its reserved memory as not accessible from, or does not run
 -# from the same memory as, Linux
  config ARCH_HIBERNATION_POSSIBLE
 -      def_bool NONPORTABLE
 +      def_bool y
  
  config ARCH_HIBERNATION_HEADER
        def_bool HIBERNATION
index 2947423b5082e9b7f69b25a347685af499258161,94b3d6930fc370526c105d14d666fd961762f491..115ac98b8d729da4e8f07f0f8f44e27438be107f
@@@ -12,7 -12,7 +12,7 @@@
  #include <linux/pfn.h>
  #include <linux/const.h>
  
 -#define PAGE_SHIFT    (12)
 +#define PAGE_SHIFT    CONFIG_PAGE_SHIFT
  #define PAGE_SIZE     (_AC(1, UL) << PAGE_SHIFT)
  #define PAGE_MASK     (~(PAGE_SIZE - 1))
  
@@@ -89,7 -89,7 +89,7 @@@ typedef struct page *pgtable_t
  #define PTE_FMT "%08lx"
  #endif
  
- #ifdef CONFIG_64BIT
+ #if defined(CONFIG_64BIT) && defined(CONFIG_MMU)
  /*
   * We override this value as its generic definition uses __pa too early in
   * the boot process (before kernel_map.va_pa_offset is set).
index 97fcde30e2477d55f8046d844191a1e4b0ba5e1a,a564a39e5676fb1a9c5c87a0e335c9d01ef3c5f7..58fd7b70b90309d3b429d763edbf96fd74b18e07
@@@ -84,7 -84,7 +84,7 @@@
   * Define vmemmap for pfn_to_page & page_to_pfn calls. Needed if kernel
   * is configured with CONFIG_SPARSEMEM_VMEMMAP enabled.
   */
 -#define vmemmap               ((struct page *)VMEMMAP_START)
 +#define vmemmap               ((struct page *)VMEMMAP_START - (phys_ram_base >> PAGE_SHIFT))
  
  #define PCI_IO_SIZE      SZ_16M
  #define PCI_IO_END       VMEMMAP_START
  #define VA_USER_SV48 (UL(1) << (VA_BITS_SV48 - 1))
  #define VA_USER_SV57 (UL(1) << (VA_BITS_SV57 - 1))
  
 -#ifdef CONFIG_COMPAT
  #define MMAP_VA_BITS_64 ((VA_BITS >= VA_BITS_SV48) ? VA_BITS_SV48 : VA_BITS)
  #define MMAP_MIN_VA_BITS_64 (VA_BITS_SV39)
  #define MMAP_VA_BITS (is_compat_task() ? VA_BITS_SV32 : MMAP_VA_BITS_64)
  #define MMAP_MIN_VA_BITS (is_compat_task() ? VA_BITS_SV32 : MMAP_MIN_VA_BITS_64)
 -#else
 -#define MMAP_VA_BITS ((VA_BITS >= VA_BITS_SV48) ? VA_BITS_SV48 : VA_BITS)
 -#define MMAP_MIN_VA_BITS (VA_BITS_SV39)
 -#endif /* CONFIG_COMPAT */
 -
  #else
  #include <asm/pgtable-32.h>
  #endif /* CONFIG_64BIT */
@@@ -235,7 -241,7 +235,7 @@@ static inline int pmd_bad(pmd_t pmd
  }
  
  #define pmd_leaf      pmd_leaf
 -static inline int pmd_leaf(pmd_t pmd)
 +static inline bool pmd_leaf(pmd_t pmd)
  {
        return pmd_present(pmd) && (pmd_val(pmd) & _PAGE_LEAF);
  }
@@@ -433,12 -439,6 +433,12 @@@ static inline pte_t pte_mkhuge(pte_t pt
        return pte;
  }
  
 +#ifdef CONFIG_RISCV_ISA_SVNAPOT
 +#define pte_leaf_size(pte)    (pte_napot(pte) ?                               \
 +                                      napot_cont_size(napot_cont_order(pte)) :\
 +                                      PAGE_SIZE)
 +#endif
 +
  #ifdef CONFIG_NUMA_BALANCING
  /*
   * See the comment in include/asm-generic/pgtable.h
@@@ -513,25 -513,23 +513,25 @@@ static inline void set_pte(pte_t *ptep
        WRITE_ONCE(*ptep, pteval);
  }
  
 -void flush_icache_pte(pte_t pte);
 +void flush_icache_pte(struct mm_struct *mm, pte_t pte);
  
 -static inline void __set_pte_at(pte_t *ptep, pte_t pteval)
 +static inline void __set_pte_at(struct mm_struct *mm, pte_t *ptep, pte_t pteval)
  {
        if (pte_present(pteval) && pte_exec(pteval))
 -              flush_icache_pte(pteval);
 +              flush_icache_pte(mm, pteval);
  
        set_pte(ptep, pteval);
  }
  
 +#define PFN_PTE_SHIFT         _PAGE_PFN_SHIFT
 +
  static inline void set_ptes(struct mm_struct *mm, unsigned long addr,
                pte_t *ptep, pte_t pteval, unsigned int nr)
  {
        page_table_check_ptes_set(mm, ptep, pteval, nr);
  
        for (;;) {
 -              __set_pte_at(ptep, pteval);
 +              __set_pte_at(mm, ptep, pteval);
                if (--nr == 0)
                        break;
                ptep++;
  static inline void pte_clear(struct mm_struct *mm,
        unsigned long addr, pte_t *ptep)
  {
 -      __set_pte_at(ptep, __pte(0));
 +      __set_pte_at(mm, ptep, __pte(0));
  }
  
  #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS     /* defined in mm/pgtable.c */
@@@ -658,12 -656,6 +658,12 @@@ static inline int pmd_write(pmd_t pmd
        return pte_write(pmd_pte(pmd));
  }
  
 +#define pud_write pud_write
 +static inline int pud_write(pud_t pud)
 +{
 +      return pte_write(pud_pte(pud));
 +}
 +
  #define pmd_dirty pmd_dirty
  static inline int pmd_dirty(pmd_t pmd)
  {
@@@ -715,14 -707,14 +715,14 @@@ static inline void set_pmd_at(struct mm
                                pmd_t *pmdp, pmd_t pmd)
  {
        page_table_check_pmd_set(mm, pmdp, pmd);
 -      return __set_pte_at((pte_t *)pmdp, pmd_pte(pmd));
 +      return __set_pte_at(mm, (pte_t *)pmdp, pmd_pte(pmd));
  }
  
  static inline void set_pud_at(struct mm_struct *mm, unsigned long addr,
                                pud_t *pudp, pud_t pud)
  {
        page_table_check_pud_set(mm, pudp, pud);
 -      return __set_pte_at((pte_t *)pudp, pud_pte(pud));
 +      return __set_pte_at(mm, (pte_t *)pudp, pud_pte(pud));
  }
  
  #ifdef CONFIG_PAGE_TABLE_CHECK
@@@ -873,8 -865,8 +873,8 @@@ static inline pte_t pte_swp_clear_exclu
  #define TASK_SIZE_MIN (PGDIR_SIZE_L3 * PTRS_PER_PGD / 2)
  
  #ifdef CONFIG_COMPAT
 -#define TASK_SIZE_32  (_AC(0x80000000, UL))
 -#define TASK_SIZE     (test_thread_flag(TIF_32BIT) ? \
 +#define TASK_SIZE_32  (_AC(0x80000000, UL) - PAGE_SIZE)
 +#define TASK_SIZE     (is_compat_task() ? \
                         TASK_SIZE_32 : TASK_SIZE_64)
  #else
  #define TASK_SIZE     TASK_SIZE_64
  #define PAGE_SHARED           __pgprot(0)
  #define PAGE_KERNEL           __pgprot(0)
  #define swapper_pg_dir                NULL
- #define TASK_SIZE             0xffffffffUL
+ #define TASK_SIZE             _AC(-1, UL)
  #define VMALLOC_START         _AC(0, UL)
  #define VMALLOC_END           TASK_SIZE
  
diff --combined arch/riscv/mm/init.c
index fe8e159394d8eeeeab34f83ae97ffadbec979b77,b3e63dec3ab5cdc5c12035f593f3572b7b460699..9687618432031fec77907d1c15fad0b9a3cc4c0a
@@@ -29,6 -29,7 +29,6 @@@
  #include <asm/io.h>
  #include <asm/numa.h>
  #include <asm/pgtable.h>
 -#include <asm/ptdump.h>
  #include <asm/sections.h>
  #include <asm/soc.h>
  #include <asm/tlbflush.h>
@@@ -231,7 -232,7 +231,7 @@@ static void __init setup_bootmem(void
         * In 64-bit, any use of __va/__pa before this point is wrong as we
         * did not know the start of DRAM before.
         */
-       if (IS_ENABLED(CONFIG_64BIT))
+       if (IS_ENABLED(CONFIG_64BIT) && IS_ENABLED(CONFIG_MMU))
                kernel_map.va_pa_offset = PAGE_OFFSET - phys_ram_base;
  
        /*
@@@ -722,6 -723,8 +722,6 @@@ void mark_rodata_ro(void
        if (IS_ENABLED(CONFIG_64BIT))
                set_kernel_memory(lm_alias(__start_rodata), lm_alias(_data),
                                  set_memory_ro);
 -
 -      debug_checkwx();
  }
  #else
  static __init pgprot_t pgprot_from_va(uintptr_t va)
@@@ -764,11 -767,6 +764,11 @@@ static int __init print_no5lvl(char *p
  }
  early_param("no5lvl", print_no5lvl);
  
 +static void __init set_mmap_rnd_bits_max(void)
 +{
 +      mmap_rnd_bits_max = MMAP_VA_BITS - PAGE_SHIFT - 3;
 +}
 +
  /*
   * There is a simple way to determine if 4-level is supported by the
   * underlying hardware: establish 1:1 mapping in 4-level page table mode
@@@ -1083,7 -1081,6 +1083,7 @@@ asmlinkage void __init setup_vm(uintptr
  
  #if defined(CONFIG_64BIT) && !defined(CONFIG_XIP_KERNEL)
        set_satp_mode(dtb_pa);
 +      set_mmap_rnd_bits_max();
  #endif
  
        /*
@@@ -1361,7 -1358,7 +1361,7 @@@ static void __init arch_reserve_crashke
        bool high = false;
        int ret;
  
 -      if (!IS_ENABLED(CONFIG_KEXEC_CORE))
 +      if (!IS_ENABLED(CONFIG_CRASH_RESERVE))
                return;
  
        ret = parse_crashkernel(cmdline, memblock_phys_mem_size(),
@@@ -1388,10 -1385,6 +1388,10 @@@ void __init misc_mem_init(void
        early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT);
        arch_numa_init();
        sparse_init();
 +#ifdef CONFIG_SPARSEMEM_VMEMMAP
 +      /* The entire VMEMMAP region has been populated. Flush TLB for this region */
 +      local_flush_tlb_kernel_range(VMEMMAP_START, VMEMMAP_END);
 +#endif
        zone_sizes_init();
        arch_reserve_crashkernel();
        memblock_dump_all();
This page took 0.087515 seconds and 4 git commands to generate.