Merge branches 'for-next/kvm-build-fix', 'for-next/va-refactor', 'for-next/lto',...
authorCatalin Marinas <catalin.marinas@arm.com>
Wed, 9 Dec 2020 18:04:35 +0000 (18:04 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 9 Dec 2020 18:04:35 +0000 (18:04 +0000)
* for-next/kvm-build-fix:
  : Fix KVM build issues with 64K pages
  KVM: arm64: Fix build error in user_mem_abort()

* for-next/va-refactor:
  : VA layout changes
  arm64: mm: don't assume struct page is always 64 bytes
  Documentation/arm64: fix RST layout of memory.rst
  arm64: mm: tidy up top of kernel VA space
  arm64: mm: make vmemmap region a projection of the linear region
  arm64: mm: extend linear region for 52-bit VA configurations

* for-next/lto:
  : Upgrade READ_ONCE() to RCpc acquire on arm64 with LTO
  arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y
  arm64: alternatives: Remove READ_ONCE() usage during patch operation
  arm64: cpufeatures: Add capability for LDAPR instruction
  arm64: alternatives: Split up alternative.h
  arm64: uaccess: move uao_* alternatives to asm-uaccess.h

* for-next/mem-hotplug:
  : Memory hotplug improvements
  arm64/mm/hotplug: Ensure early memory sections are all online
  arm64/mm/hotplug: Enable MEM_OFFLINE event handling
  arm64/mm/hotplug: Register boot memory hot remove notifier earlier
  arm64: mm: account for hotplug memory when randomizing the linear region

* for-next/cppc-ffh:
  : Add CPPC FFH support using arm64 AMU counters
  arm64: abort counter_read_on_cpu() when irqs_disabled()
  arm64: implement CPPC FFH support using AMUs
  arm64: split counter validation function
  arm64: wrap and generalise counter read functions

* for-next/pad-image-header:
  : Pad Image header to 64KB and unmap it
  arm64: head: tidy up the Image header definition
  arm64/head: avoid symbol names pointing into first 64 KB of kernel image
  arm64: omit [_text, _stext) from permanent kernel mapping

* for-next/zone-dma-default-32-bit:
  : Default to 32-bit wide ZONE_DMA (previously reduced to 1GB for RPi4)
  of: unittest: Fix build on architectures without CONFIG_OF_ADDRESS
  mm: Remove examples from enum zone_type comment
  arm64: mm: Set ZONE_DMA size based on early IORT scan
  arm64: mm: Set ZONE_DMA size based on devicetree's dma-ranges
  of: unittest: Add test for of_dma_get_max_cpu_address()
  of/address: Introduce of_dma_get_max_cpu_address()
  arm64: mm: Move zone_dma_bits initialization into zone_sizes_init()
  arm64: mm: Move reserve_crashkernel() into mem_init()
  arm64: Force NO_BLOCK_MAPPINGS if crashkernel reservation is required
  arm64: Ignore any DMA offsets in the max_zone_phys() calculation

* for-next/signal-tag-bits:
  : Expose the FAR_EL1 tag bits in siginfo
  arm64: expose FAR_EL1 tag bits in siginfo
  signal: define the SA_EXPOSE_TAGBITS bit in sa_flags
  signal: define the SA_UNSUPPORTED bit in sa_flags
  arch: provide better documentation for the arch-specific SA_* flags
  signal: clear non-uapi flag bits when passing/returning sa_flags
  arch: move SA_* definitions to generic headers
  parisc: start using signal-defs.h
  parisc: Drop parisc special case for __sighandler_t

* for-next/cmdline-extended:
  : Add support for CONFIG_CMDLINE_EXTENDED
  arm64: Extend the kernel command line from the bootloader
  arm64: kaslr: Refactor early init command line parsing

1  2  3  4  5  6  7  8  9 
arch/arm64/Kconfig
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/vmlinux.lds.S
arch/arm64/kvm/mmu.c
arch/arm64/mm/init.c
arch/arm64/mm/mmu.c

Simple merge
@@@@@@@@@@ -2076,6 -2123,19 -2123,29 -2123,19 -2130,19 -2123,19 -2123,19 -2123,19 -2123,19 +2130,29 @@@@@@@@@@ static const struct arm64_cpu_capabilit
                        .sign = FTR_UNSIGNED,
                },
         #endif
+        #ifdef CONFIG_ARM64_MTE
+               {
+                       .desc = "Memory Tagging Extension",
+                       .capability = ARM64_MTE,
+                       .type = ARM64_CPUCAP_STRICT_BOOT_CPU_FEATURE,
+                       .matches = has_cpuid_feature,
+                       .sys_reg = SYS_ID_AA64PFR1_EL1,
+                       .field_pos = ID_AA64PFR1_MTE_SHIFT,
+                       .min_field_value = ID_AA64PFR1_MTE,
+                       .sign = FTR_UNSIGNED,
+                       .cpu_enable = cpu_enable_mte,
+               },
+        #endif /* CONFIG_ARM64_MTE */
++ ++++++       {
++ ++++++               .desc = "RCpc load-acquire (LDAPR)",
++ ++++++               .capability = ARM64_HAS_LDAPR,
++ ++++++               .type = ARM64_CPUCAP_SYSTEM_FEATURE,
++ ++++++               .sys_reg = SYS_ID_AA64ISAR1_EL1,
++ ++++++               .sign = FTR_UNSIGNED,
++ ++++++               .field_pos = ID_AA64ISAR1_LRCPC_SHIFT,
++ ++++++               .matches = has_cpuid_feature,
++ ++++++               .min_field_value = 1,
++ ++++++       },
                {},
         };
         
Simple merge
Simple merge
Simple merge
@@@@@@@@@@ -458,14 -469,15 -469,15 -469,15 -469,15 -469,15 -469,30 -469,15 -469,15 +469,30 @@@@@@@@@@ void __init mark_linear_text_alias_ro(v
                                    PAGE_KERNEL_RO);
         }
         
++++++ ++static bool crash_mem_map __initdata;
++++++ ++
++++++ ++static int __init enable_crash_mem_map(char *arg)
++++++ ++{
++++++ ++       /*
++++++ ++        * Proper parameter parsing is done by reserve_crashkernel(). We only
++++++ ++        * need to know if the linear map has to avoid block mappings so that
++++++ ++        * the crashkernel reservations can be unmapped later.
++++++ ++        */
++++++ ++       crash_mem_map = true;
++++++ ++
++++++ ++       return 0;
++++++ ++}
++++++ ++early_param("crashkernel", enable_crash_mem_map);
++++++ ++
         static void __init map_mem(pgd_t *pgdp)
         {
----- ---       phys_addr_t kernel_start = __pa_symbol(_text);
+++++ +++       phys_addr_t kernel_start = __pa_symbol(_stext);
                phys_addr_t kernel_end = __pa_symbol(__init_begin);
-               struct memblock_region *reg;
+               phys_addr_t start, end;
                int flags = 0;
+               u64 i;
         
------ --       if (rodata_full || debug_pagealloc_enabled())
++++++ ++       if (rodata_full || crash_mem_map || debug_pagealloc_enabled())
                        flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS;
         
                /*
                 * the following for-loop
                 */
                memblock_mark_nomap(kernel_start, kernel_end - kernel_start);
------ --#ifdef CONFIG_KEXEC_CORE
------ --       if (crashk_res.end)
------ --               memblock_mark_nomap(crashk_res.start,
------ --                                   resource_size(&crashk_res));
------ --#endif
         
                /* map all the memory banks */
-               for_each_memblock(memory, reg) {
-                       phys_addr_t start = reg->base;
-                       phys_addr_t end = start + reg->size;
-        
+               for_each_mem_range(i, &start, &end) {
                        if (start >= end)
                                break;
-                       if (memblock_is_nomap(reg))
-                               continue;
-        
-                       __map_memblock(pgdp, start, end, PAGE_KERNEL, flags);
+                       /*
+                        * The linear map must allow allocation tags reading/writing
+                        * if MTE is present. Otherwise, it has the same attributes as
+                        * PAGE_KERNEL.
+                        */
+                       __map_memblock(pgdp, start, end, PAGE_KERNEL_TAGGED, flags);
                }
         
                /*