]> Git Repo - linux.git/commitdiff
Merge branch 'devel-stable' into for-next
authorRussell King <[email protected]>
Wed, 8 Nov 2017 19:42:47 +0000 (19:42 +0000)
committerRussell King <[email protected]>
Wed, 8 Nov 2017 19:42:47 +0000 (19:42 +0000)
1  2 
arch/arm/Kconfig
arch/arm/kernel/traps.c
arch/arm/mm/nommu.c

diff --combined arch/arm/Kconfig
index 979aac3e2fbfc9e90d08ea8de2d879ae5720a99f,bf91aa38051d02a8305e39495a3e33ad921a2708..631e61bc7ac4551e92e0b436e44e557be7270492
@@@ -2,7 -2,6 +2,7 @@@ config AR
        bool
        default y
        select ARCH_CLOCKSOURCE_DATA
 +      select ARCH_DISCARD_MEMBLOCK if !HAVE_ARCH_PFN_VALID
        select ARCH_HAS_DEBUG_VIRTUAL
        select ARCH_HAS_DEVMEM_IS_ALLOWED
        select ARCH_HAS_ELF_RANDOMIZE
@@@ -240,15 -239,6 +240,6 @@@ config NEED_RET_TO_USE
  config ARCH_MTD_XIP
        bool
  
- config VECTORS_BASE
-       hex
-       default 0xffff0000 if MMU || CPU_HIGH_VECTOR
-       default DRAM_BASE if REMAP_VECTORS_TO_RAM
-       default 0x00000000
-       help
-         The base address of exception vectors.  This must be two pages
-         in size.
  config ARM_PATCH_PHYS_VIRT
        bool "Patch physical to virtual translations at runtime" if EMBEDDED
        default y
@@@ -2006,6 -1996,17 +1997,17 @@@ config XIP_PHYS_ADD
          be linked for and stored to.  This address is dependent on your
          own flash usage.
  
+ config XIP_DEFLATED_DATA
+       bool "Store kernel .data section compressed in ROM"
+       depends on XIP_KERNEL
+       select ZLIB_INFLATE
+       help
+         Before the kernel is actually executed, its .data section has to be
+         copied to RAM from ROM. This option allows for storing that data
+         in compressed form and decompressed to RAM rather than merely being
+         copied, saving some precious ROM space. A possible drawback is a
+         slightly longer boot delay.
  config KEXEC
        bool "Kexec system call (EXPERIMENTAL)"
        depends on (!SMP || PM_SLEEP_SMP)
diff --combined arch/arm/kernel/traps.c
index 0fcd82f013883c58229aa8647d50047af010dde2,43c0560f7b2d2ca27a5cc86f026c2e441b8ad505..5cf04888c581df4a21053a826f8a2fdd58204435
@@@ -154,26 -154,30 +154,26 @@@ static void dump_mem(const char *lvl, c
        set_fs(fs);
  }
  
 -static void dump_instr(const char *lvl, struct pt_regs *regs)
 +static void __dump_instr(const char *lvl, struct pt_regs *regs)
  {
        unsigned long addr = instruction_pointer(regs);
        const int thumb = thumb_mode(regs);
        const int width = thumb ? 4 : 8;
 -      mm_segment_t fs;
        char str[sizeof("00000000 ") * 5 + 2 + 1], *p = str;
        int i;
  
        /*
 -       * We need to switch to kernel mode so that we can use __get_user
 -       * to safely read from kernel space.  Note that we now dump the
 -       * code first, just in case the backtrace kills us.
 +       * Note that we now dump the code first, just in case the backtrace
 +       * kills us.
         */
 -      fs = get_fs();
 -      set_fs(KERNEL_DS);
  
        for (i = -4; i < 1 + !!thumb; i++) {
                unsigned int val, bad;
  
                if (thumb)
 -                      bad = __get_user(val, &((u16 *)addr)[i]);
 +                      bad = get_user(val, &((u16 *)addr)[i]);
                else
 -                      bad = __get_user(val, &((u32 *)addr)[i]);
 +                      bad = get_user(val, &((u32 *)addr)[i]);
  
                if (!bad)
                        p += sprintf(p, i == 0 ? "(%0*x) " : "%0*x ",
                }
        }
        printk("%sCode: %s\n", lvl, str);
 +}
  
 -      set_fs(fs);
 +static void dump_instr(const char *lvl, struct pt_regs *regs)
 +{
 +      mm_segment_t fs;
 +
 +      if (!user_mode(regs)) {
 +              fs = get_fs();
 +              set_fs(KERNEL_DS);
 +              __dump_instr(lvl, regs);
 +              set_fs(fs);
 +      } else {
 +              __dump_instr(lvl, regs);
 +      }
  }
  
  #ifdef CONFIG_ARM_UNWIND
@@@ -655,6 -647,9 +655,9 @@@ asmlinkage int arm_syscall(int no, stru
                set_tls(regs->ARM_r0);
                return 0;
  
+       case NR(get_tls):
+               return current_thread_info()->tp_value[0];
        default:
                /* Calls 9f00xx..9f07ff are defined to return -ENOSYS
                   if not implemented, rather than raising SIGILL.  This
diff --combined arch/arm/mm/nommu.c
index 91537d90f5f526e4e9135b2b0e5403141172a4cb,4c56b567cb4704783e2a555ac4444b60bdea960f..e4370810f4f13f9a5a3bb7b7712babb9f3725fe8
@@@ -27,259 -27,7 +27,7 @@@ unsigned long vectors_base
  
  #ifdef CONFIG_ARM_MPU
  struct mpu_rgn_info mpu_rgn_info;
- /* Region number */
- static void rgnr_write(u32 v)
- {
-       asm("mcr        p15, 0, %0, c6, c2, 0" : : "r" (v));
- }
- /* Data-side / unified region attributes */
- /* Region access control register */
- static void dracr_write(u32 v)
- {
-       asm("mcr        p15, 0, %0, c6, c1, 4" : : "r" (v));
- }
- /* Region size register */
- static void drsr_write(u32 v)
- {
-       asm("mcr        p15, 0, %0, c6, c1, 2" : : "r" (v));
- }
- /* Region base address register */
- static void drbar_write(u32 v)
- {
-       asm("mcr        p15, 0, %0, c6, c1, 0" : : "r" (v));
- }
- static u32 drbar_read(void)
- {
-       u32 v;
-       asm("mrc        p15, 0, %0, c6, c1, 0" : "=r" (v));
-       return v;
- }
- /* Optional instruction-side region attributes */
- /* I-side Region access control register */
- static void iracr_write(u32 v)
- {
-       asm("mcr        p15, 0, %0, c6, c1, 5" : : "r" (v));
- }
- /* I-side Region size register */
- static void irsr_write(u32 v)
- {
-       asm("mcr        p15, 0, %0, c6, c1, 3" : : "r" (v));
- }
- /* I-side Region base address register */
- static void irbar_write(u32 v)
- {
-       asm("mcr        p15, 0, %0, c6, c1, 1" : : "r" (v));
- }
- static unsigned long irbar_read(void)
- {
-       unsigned long v;
-       asm("mrc        p15, 0, %0, c6, c1, 1" : "=r" (v));
-       return v;
- }
- /* MPU initialisation functions */
- void __init adjust_lowmem_bounds_mpu(void)
- {
-       phys_addr_t phys_offset = PHYS_OFFSET;
-       phys_addr_t aligned_region_size, specified_mem_size, rounded_mem_size;
-       struct memblock_region *reg;
-       bool first = true;
-       phys_addr_t mem_start;
-       phys_addr_t mem_end;
-       for_each_memblock(memory, reg) {
-               if (first) {
-                       /*
-                        * Initially only use memory continuous from
-                        * PHYS_OFFSET */
-                       if (reg->base != phys_offset)
-                               panic("First memory bank must be contiguous from PHYS_OFFSET");
-                       mem_start = reg->base;
-                       mem_end = reg->base + reg->size;
-                       specified_mem_size = reg->size;
-                       first = false;
-               } else {
-                       /*
-                        * memblock auto merges contiguous blocks, remove
-                        * all blocks afterwards in one go (we can't remove
-                        * blocks separately while iterating)
-                        */
-                       pr_notice("Ignoring RAM after %pa, memory at %pa ignored\n",
-                                 &mem_end, &reg->base);
-                       memblock_remove(reg->base, 0 - reg->base);
-                       break;
-               }
-       }
-       /*
-        * MPU has curious alignment requirements: Size must be power of 2, and
-        * region start must be aligned to the region size
-        */
-       if (phys_offset != 0)
-               pr_info("PHYS_OFFSET != 0 => MPU Region size constrained by alignment requirements\n");
-       /*
-        * Maximum aligned region might overflow phys_addr_t if phys_offset is
-        * 0. Hence we keep everything below 4G until we take the smaller of
-        * the aligned_region_size and rounded_mem_size, one of which is
-        * guaranteed to be smaller than the maximum physical address.
-        */
-       aligned_region_size = (phys_offset - 1) ^ (phys_offset);
-       /* Find the max power-of-two sized region that fits inside our bank */
-       rounded_mem_size = (1 <<  __fls(specified_mem_size)) - 1;
-       /* The actual region size is the smaller of the two */
-       aligned_region_size = aligned_region_size < rounded_mem_size
-                               ? aligned_region_size + 1
-                               : rounded_mem_size + 1;
-       if (aligned_region_size != specified_mem_size) {
-               pr_warn("Truncating memory from %pa to %pa (MPU region constraints)",
-                               &specified_mem_size, &aligned_region_size);
-               memblock_remove(mem_start + aligned_region_size,
-                               specified_mem_size - aligned_region_size);
-               mem_end = mem_start + aligned_region_size;
-       }
-       pr_debug("MPU Region from %pa size %pa (end %pa))\n",
-               &phys_offset, &aligned_region_size, &mem_end);
- }
- static int mpu_present(void)
- {
-       return ((read_cpuid_ext(CPUID_EXT_MMFR0) & MMFR0_PMSA) == MMFR0_PMSAv7);
- }
- static int mpu_max_regions(void)
- {
-       /*
-        * We don't support a different number of I/D side regions so if we
-        * have separate instruction and data memory maps then return
-        * whichever side has a smaller number of supported regions.
-        */
-       u32 dregions, iregions, mpuir;
-       mpuir = read_cpuid(CPUID_MPUIR);
-       dregions = iregions = (mpuir & MPUIR_DREGION_SZMASK) >> MPUIR_DREGION;
-       /* Check for separate d-side and i-side memory maps */
-       if (mpuir & MPUIR_nU)
-               iregions = (mpuir & MPUIR_IREGION_SZMASK) >> MPUIR_IREGION;
-       /* Use the smallest of the two maxima */
-       return min(dregions, iregions);
- }
- static int mpu_iside_independent(void)
- {
-       /* MPUIR.nU specifies whether there is *not* a unified memory map */
-       return read_cpuid(CPUID_MPUIR) & MPUIR_nU;
- }
- static int mpu_min_region_order(void)
- {
-       u32 drbar_result, irbar_result;
-       /* We've kept a region free for this probing */
-       rgnr_write(MPU_PROBE_REGION);
-       isb();
-       /*
-        * As per ARM ARM, write 0xFFFFFFFC to DRBAR to find the minimum
-        * region order
-       */
-       drbar_write(0xFFFFFFFC);
-       drbar_result = irbar_result = drbar_read();
-       drbar_write(0x0);
-       /* If the MPU is non-unified, we use the larger of the two minima*/
-       if (mpu_iside_independent()) {
-               irbar_write(0xFFFFFFFC);
-               irbar_result = irbar_read();
-               irbar_write(0x0);
-       }
-       isb(); /* Ensure that MPU region operations have completed */
-       /* Return whichever result is larger */
-       return __ffs(max(drbar_result, irbar_result));
- }
- static int mpu_setup_region(unsigned int number, phys_addr_t start,
-                       unsigned int size_order, unsigned int properties)
- {
-       u32 size_data;
-       /* We kept a region free for probing resolution of MPU regions*/
-       if (number > mpu_max_regions() || number == MPU_PROBE_REGION)
-               return -ENOENT;
-       if (size_order > 32)
-               return -ENOMEM;
-       if (size_order < mpu_min_region_order())
-               return -ENOMEM;
-       /* Writing N to bits 5:1 (RSR_SZ)  specifies region size 2^N+1 */
-       size_data = ((size_order - 1) << MPU_RSR_SZ) | 1 << MPU_RSR_EN;
-       dsb(); /* Ensure all previous data accesses occur with old mappings */
-       rgnr_write(number);
-       isb();
-       drbar_write(start);
-       dracr_write(properties);
-       isb(); /* Propagate properties before enabling region */
-       drsr_write(size_data);
-       /* Check for independent I-side registers */
-       if (mpu_iside_independent()) {
-               irbar_write(start);
-               iracr_write(properties);
-               isb();
-               irsr_write(size_data);
-       }
-       isb();
-       /* Store region info (we treat i/d side the same, so only store d) */
-       mpu_rgn_info.rgns[number].dracr = properties;
-       mpu_rgn_info.rgns[number].drbar = start;
-       mpu_rgn_info.rgns[number].drsr = size_data;
-       return 0;
- }
- /*
- * Set up default MPU regions, doing nothing if there is no MPU
- */
- void __init mpu_setup(void)
- {
-       int region_err;
-       if (!mpu_present())
-               return;
-       region_err = mpu_setup_region(MPU_RAM_REGION, PHYS_OFFSET,
-                                       ilog2(memblock.memory.regions[0].size),
-                                       MPU_AP_PL1RW_PL0RW | MPU_RGN_NORMAL);
-       if (region_err) {
-               panic("MPU region initialization failure! %d", region_err);
-       } else {
-               pr_info("Using ARMv7 PMSA Compliant MPU. "
-                        "Region independence: %s, Max regions: %d\n",
-                       mpu_iside_independent() ? "Yes" : "No",
-                       mpu_max_regions());
-       }
- }
- #else
- static void adjust_lowmem_bounds_mpu(void) {}
- static void __init mpu_setup(void) {}
- #endif /* CONFIG_ARM_MPU */
+ #endif
  
  #ifdef CONFIG_CPU_CP15
  #ifdef CONFIG_CPU_HIGH_VECTOR
@@@ -344,11 -92,6 +92,11 @@@ void __init arm_mm_memblock_reserve(voi
         * reserved here.
         */
  #endif
 +      /*
 +       * In any case, always ensure address 0 is never used as many things
 +       * get very confused if 0 is returned as a legitimate address.
 +       */
 +      memblock_reserve(0, 1);
  }
  
  void __init adjust_lowmem_bounds(void)
This page took 0.086196 seconds and 4 git commands to generate.