Merge tag 'arc-v3.10-rc1-part1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 9 May 2013 21:36:27 +0000 (14:36 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 9 May 2013 21:36:27 +0000 (14:36 -0700)
Pull ARC port updates from Vineet Gupta:
 "Support for two new platforms based on ARC700:
   - Abilis TB10x SoC [Chritisian/Pierrick]
   - Simulator only System-C Model [Mischa]

  ARC specific MM improvements:
   - Avoid full TLB flush (ASID increment) on munmap (even single page)
   - VIPT Cache Flushing improvements
     + Delayed dcache flush for non-aliasing dcache (big performance boost)
     + icache flush aliasing agnostic (no need to kill all possible aliases)

  Others:
   - Avoid needless rebuild of DTB files for every kernel build
   - Remove builtin cmdline as that is already provided by DeviceTree/bootargs
   - Fixing unaligned access emulation corner case
   - checkpatch fixes [Sachin]
   - Various fixlets [Noam]
   - Minor build failures/cleanups"

* tag 'arc-v3.10-rc1-part1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: (35 commits)
  ARC: [mm] Lazy D-cache flush (non aliasing VIPT)
  ARC: [mm] micro-optimize page size icache invalidate
  ARC: [mm] remove the pessimistic all-alias-invalidate icache helpers
  ARC: [mm] consolidate icache/dcache sync code
  ARC: [mm] optimise icache flush for kernel mappings
  ARC: [mm] optimise icache flush for user mappings
  ARC: [mm] optimize needless full mm TLB flush on munmap
  ARC: Add support for nSIM OSCI System C model
  ARC: [TB10x] Adapt device tree to new compatible string
  ARC: [TB10x] Add support for TB10x platform
  ARC: [TB10x] Device tree of TB100 and TB101 Development Kits
  ARC: Prepare interrupt code for external controllers
  ARC: Allow embedded arc-intc to be properly placed in DT intc hierarchy
  ARC: [cmdline] Don't overwrite u-boot provided bootargs
  ARC: [cmdline] Remove CONFIG_CMDLINE
  ARC: [plat-arcfpga] defconfig update
  ARC: unaligned access emulation broken if callee-reg dest of LD/ST
  ARC: unaligned access emulation error handling consolidation
  ARC: Debug/crash-printing Improvements
  ARC: fix typo with clock speed
  ...

1  2 
arch/arc/kernel/disasm.c
arch/arc/kernel/troubleshoot.c
arch/arc/mm/init.c

diff --combined arch/arc/kernel/disasm.c
index d14764ae2c6068f7f8c6b2459233e9751901570f,df957a4dbd603123ce76e8727218d9ad68bf719e..b8a549c4f54071f97d26c473a9dca532e1db8b41
@@@ -12,8 -12,8 +12,8 @@@
  #include <linux/types.h>
  #include <linux/kprobes.h>
  #include <linux/slab.h>
+ #include <linux/uaccess.h>
  #include <asm/disasm.h>
- #include <asm/uaccess.h>
  
  #if defined(CONFIG_KGDB) || defined(CONFIG_ARC_MISALIGN_ACCESS) || \
        defined(CONFIG_KPROBES)
@@@ -535,4 -535,4 +535,4 @@@ int __kprobes disasm_next_pc(unsigned l
        return instr.is_branch;
  }
  
 -#endif /* CONFIG_KGDB || CONFIG_MISALIGN_ACCESS || CONFIG_KPROBES */
 +#endif /* CONFIG_KGDB || CONFIG_ARC_MISALIGN_ACCESS || CONFIG_KPROBES */
index 0aec01985bf99feda33dc44dc7262eb581f81c6e,a39d5812cc09a8d6e698b3eb163bed417f4c7745..11c301b81c92bfb7def6577a869c4e0f2c0432a3
@@@ -26,7 -26,6 +26,6 @@@ static noinline void print_reg_file(lon
        char buf[512];
        int n = 0, len = sizeof(buf);
  
-       /* weird loop because pt_regs regs rev r12..r0, r25..r13 */
        for (i = start_num; i < start_num + 13; i++) {
                n += scnprintf(buf + n, len - n, "r%02u: 0x%08lx\t",
                               i, (unsigned long)*reg_rev);
                if (((i + 1) % 3) == 0)
                        n += scnprintf(buf + n, len - n, "\n");
  
+               /* because pt_regs has regs reversed: r12..r0, r25..r13 */
                reg_rev--;
        }
  
        if (start_num != 0)
                n += scnprintf(buf + n, len - n, "\n\n");
  
-       pr_info("%s", buf);
+       /* To continue printing callee regs on same line as scratch regs */
+       if (start_num == 0)
+               pr_info("%s", buf);
+       else
+               pr_cont("%s\n", buf);
  }
  
  static void show_callee_regs(struct callee_regs *cregs)
@@@ -71,7 -75,7 +75,7 @@@ void print_task_path_n_nm(struct task_s
        }
  
  done:
 -      pr_info("%s, TGID %u\n", path_nm, tsk->tgid);
 +      pr_info("Path: %s\n", path_nm);
  }
  EXPORT_SYMBOL(print_task_path_n_nm);
  
@@@ -83,6 -87,10 +87,10 @@@ static void show_faulting_vma(unsigned 
        dev_t dev = 0;
        char *nm = buf;
  
+       /* can't use print_vma_addr() yet as it doesn't check for
+        * non-inclusive vma
+        */
        vma = find_vma(current->active_mm, address);
  
        /* check against the find_vma( ) behaviour which returns the next VMA
                        ino = inode->i_ino;
                }
                pr_info("    @off 0x%lx in [%s]\n"
-                       "    VMA: 0x%08lx to 0x%08lx\n\n",
-                      address - vma->vm_start, nm, vma->vm_start, vma->vm_end);
-       } else
+                       "    VMA: 0x%08lx to 0x%08lx\n",
+                       vma->vm_start < TASK_UNMAPPED_BASE ?
+                               address : address - vma->vm_start,
+                       nm, vma->vm_start, vma->vm_end);
+       } else {
                pr_info("    @No matching VMA found\n");
+       }
  }
  
  static void show_ecr_verbose(struct pt_regs *regs)
        unsigned long address;
  
        cause_reg = current->thread.cause_code;
-       pr_info("\n[ECR]: 0x%08x => ", cause_reg);
+       pr_info("\n[ECR   ]: 0x%08x => ", cause_reg);
  
        /* For Data fault, this is data address not instruction addr */
        address = current->thread.fault_address;
  
        /* For DTLB Miss or ProtV, display the memory involved too */
        if (vec == ECR_V_DTLB_MISS) {
-               pr_cont("Invalid (%s) @ 0x%08lx by insn @ 0x%08lx\n",
+               pr_cont("Invalid %s 0x%08lx by insn @ 0x%08lx\n",
                       (cause_code == 0x01) ? "Read From" :
                       ((cause_code == 0x02) ? "Write to" : "EX"),
                       address, regs->ret);
@@@ -163,25 -174,27 +174,28 @@@ void show_regs(struct pt_regs *regs
                return;
  
        print_task_path_n_nm(tsk, buf);
 +      show_regs_print_info(KERN_INFO);
  
        if (current->thread.cause_code)
                show_ecr_verbose(regs);
  
-       pr_info("[EFA]: 0x%08lx\n", current->thread.fault_address);
-       pr_info("[ERET]: 0x%08lx (PC of Faulting Instr)\n", regs->ret);
+       pr_info("[EFA   ]: 0x%08lx\n[BLINK ]: %pS\n[ERET  ]: %pS\n",
+               current->thread.fault_address,
+               (void *)regs->blink, (void *)regs->ret);
  
-       show_faulting_vma(regs->ret, buf);      /* faulting code, not data */
+       if (user_mode(regs))
+               show_faulting_vma(regs->ret, buf); /* faulting code, not data */
  
-       /* can't use print_vma_addr() yet as it doesn't check for
-        * non-inclusive vma
-        */
+       pr_info("[STAT32]: 0x%08lx", regs->status32);
+ #define STS_BIT(r, bit)       r->status32 & STATUS_##bit##_MASK ? #bit : ""
+       if (!user_mode(regs))
+               pr_cont(" : %2s %2s %2s %2s %2s\n",
+                       STS_BIT(regs, AE), STS_BIT(regs, A2), STS_BIT(regs, A1),
+                       STS_BIT(regs, E2), STS_BIT(regs, E1));
  
-       /* print special regs */
-       pr_info("status32: 0x%08lx\n", regs->status32);
-       pr_info(" SP: 0x%08lx\tFP: 0x%08lx\n", regs->sp, regs->fp);
-       pr_info("BTA: 0x%08lx\tBLINK: 0x%08lx\n",
-               regs->bta, regs->blink);
+       pr_info("BTA: 0x%08lx\t SP: 0x%08lx\t FP: 0x%08lx\n",
+               regs->bta, regs->sp, regs->fp);
        pr_info("LPS: 0x%08lx\tLPE: 0x%08lx\tLPC: 0x%08lx\n",
               regs->lp_start, regs->lp_end, regs->lp_count);
  
diff --combined arch/arc/mm/init.c
index 727d4794ea0fa7167e8901743e45d69cda66c76e,6634cf50e3b4660b74daf4d7df89aeaf905888a5..4a177365b2c42a94abe000ec4d9de016e7f48abb
@@@ -10,9 -10,6 +10,6 @@@
  #include <linux/mm.h>
  #include <linux/bootmem.h>
  #include <linux/memblock.h>
- #ifdef CONFIG_BLOCK_DEV_RAM
- #include <linux/blk.h>
- #endif
  #include <linux/swap.h>
  #include <linux/module.h>
  #include <asm/page.h>
@@@ -144,18 -141,37 +141,18 @@@ void __init mem_init(void
                PAGES_TO_KB(reserved_pages));
  }
  
 -static void __init free_init_pages(const char *what, unsigned long begin,
 -                                 unsigned long end)
 -{
 -      unsigned long addr;
 -
 -      pr_info("Freeing %s: %ldk [%lx] to [%lx]\n",
 -              what, TO_KB(end - begin), begin, end);
 -
 -      /* need to check that the page we free is not a partial page */
 -      for (addr = begin; addr + PAGE_SIZE <= end; addr += PAGE_SIZE) {
 -              ClearPageReserved(virt_to_page(addr));
 -              init_page_count(virt_to_page(addr));
 -              free_page(addr);
 -              totalram_pages++;
 -      }
 -}
 -
  /*
   * free_initmem: Free all the __init memory.
   */
  void __init_refok free_initmem(void)
  {
 -      free_init_pages("unused kernel memory",
 -                      (unsigned long)__init_begin,
 -                      (unsigned long)__init_end);
 +      free_initmem_default(0);
  }
  
  #ifdef CONFIG_BLK_DEV_INITRD
  void __init free_initrd_mem(unsigned long start, unsigned long end)
  {
 -      free_init_pages("initrd memory", start, end);
 +      free_reserved_area(start, end, 0, "initrd");
  }
  #endif