Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Thu, 2 May 2013 17:16:16 +0000 (10:16 -0700)]
Pull powerpc update from Benjamin Herrenschmidt:
 "The main highlights this time around are:

   - A pile of addition POWER8 bits and nits, such as updated
     performance counter support (Michael Ellerman), new branch history
     buffer support (Anshuman Khandual), base support for the new PCI
     host bridge when not using the hypervisor (Gavin Shan) and other
     random related bits and fixes from various contributors.

   - Some rework of our page table format by Aneesh Kumar which fixes a
     thing or two and paves the way for THP support.  THP itself will
     not make it this time around however.

   - More Freescale updates, including Altivec support on the new e6500
     cores, new PCI controller support, and a pile of new boards support
     and updates.

   - The usual batch of trivial cleanups & fixes"

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (156 commits)
  powerpc: Fix build error for book3e
  powerpc: Context switch the new EBB SPRs
  powerpc: Turn on the EBB H/FSCR bits
  powerpc: Replace CPU_FTR_BCTAR with CPU_FTR_ARCH_207S
  powerpc: Setup BHRB instructions facility in HFSCR for POWER8
  powerpc: Fix interrupt range check on debug exception
  powerpc: Update tlbie/tlbiel as per ISA doc
  powerpc: Print page size info during boot
  powerpc: print both base and actual page size on hash failure
  powerpc: Fix hpte_decode to use the correct decoding for page sizes
  powerpc: Decode the pte-lp-encoding bits correctly.
  powerpc: Use encode avpn where we need only avpn values
  powerpc: Reduce PTE table memory wastage
  powerpc: Move the pte free routines from common header
  powerpc: Reduce the PTE_INDEX_SIZE
  powerpc: Switch 16GB and 16MB explicit hugepages to a different page table format
  powerpc: New hugepage directory format
  powerpc: Don't truncate pgd_index wrongly
  powerpc: Don't hard code the size of pte page
  powerpc: Save DAR and DSISR in pt_regs on MCE
  ...

18 files changed:
1  2 
arch/metag/mm/Kconfig
arch/powerpc/Kconfig
arch/powerpc/include/asm/hugetlb.h
arch/powerpc/kernel/lparcfg.c
arch/powerpc/kernel/process.c
arch/powerpc/kernel/rtas_flash.c
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/mm/init_64.c
arch/powerpc/mm/mem.c
arch/powerpc/mm/numa.c
arch/powerpc/platforms/512x/Kconfig
arch/powerpc/platforms/512x/mpc512x_shared.c
arch/powerpc/platforms/cell/spufs/file.c
arch/powerpc/xmon/xmon.c
drivers/macintosh/via-pmu.c
drivers/pci/probe.c
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c

@@@ -93,11 -93,9 +93,6 @@@ config ARCH_SPARSEMEM_ENABL
  config ARCH_SPARSEMEM_DEFAULT
        def_bool y
  
- config MAX_ACTIVE_REGIONS
-       int
-       default "2" if SPARSEMEM
-       default "1"
 -config ARCH_POPULATES_NODE_MAP
 -      def_bool y
 -
  config ARCH_SELECT_MEMORY_MODEL
        def_bool y
  
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -316,9 -310,9 +328,9 @@@ static ssize_t rtas_flash_write(struct 
         * proc file
         */
        if (uf->flist == NULL) {
-               uf->flist = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
+               uf->flist = kmem_cache_zalloc(flash_block_cache, GFP_KERNEL);
                if (!uf->flist)
 -                      return -ENOMEM;
 +                      goto nomem;
        }
  
        fl = uf->flist;
        next_free = fl->num_blocks;
        if (next_free == FLASH_BLOCKS_PER_NODE) {
                /* Need to allocate another block_list */
-               fl->next = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
+               fl->next = kmem_cache_zalloc(flash_block_cache, GFP_KERNEL);
                if (!fl->next)
 -                      return -ENOMEM;
 +                      goto nomem;
                fl = fl->next;
                next_free = 0;
        }
  
        if (count > RTAS_BLK_SIZE)
                count = RTAS_BLK_SIZE;
-       p = kmem_cache_alloc(flash_block_cache, GFP_KERNEL);
+       p = kmem_cache_zalloc(flash_block_cache, GFP_KERNEL);
        if (!p)
 -              return -ENOMEM;
 +              goto nomem;
        
        if(copy_from_user(p, buffer, count)) {
                kmem_cache_free(flash_block_cache, p);
@@@ -694,65 -722,98 +706,70 @@@ static int __init rtas_flash_init(void
                return 1;
        }
  
 -      firmware_flash_pde = create_flash_pde("powerpc/rtas/"
 -                                            FIRMWARE_FLASH_NAME,
 -                                            &rtas_flash_operations);
 -      if (firmware_flash_pde == NULL) {
 -              rc = -ENOMEM;
 -              goto cleanup;
 -      }
 +      rtas_validate_flash_data.buf = kzalloc(VALIDATE_BUF_SIZE, GFP_KERNEL);
 +      if (!rtas_validate_flash_data.buf)
 +              return -ENOMEM;
  
 -      rc = initialize_flash_pde_data("ibm,update-flash-64-and-reboot",
 -                                     sizeof(struct rtas_update_flash_t), 
 -                                     firmware_flash_pde);
 -      if (rc != 0)
 -              goto cleanup;
 -
 -      firmware_update_pde = create_flash_pde("powerpc/rtas/"
 -                                             FIRMWARE_UPDATE_NAME,
 -                                             &rtas_flash_operations);
 -      if (firmware_update_pde == NULL) {
 -              rc = -ENOMEM;
 -              goto cleanup;
 +      flash_block_cache = kmem_cache_create("rtas_flash_cache",
 +                                            RTAS_BLK_SIZE, RTAS_BLK_SIZE, 0,
-                                             rtas_block_ctor);
++                                            NULL);
 +      if (!flash_block_cache) {
 +              printk(KERN_ERR "%s: failed to create block cache\n",
 +                              __func__);
 +              goto enomem_buf;
        }
  
 -      rc = initialize_flash_pde_data("ibm,update-flash-64-and-reboot",
 -                                     sizeof(struct rtas_update_flash_t), 
 -                                     firmware_update_pde);
 -      if (rc != 0)
 -              goto cleanup;
 -
 -      validate_pde = create_flash_pde("powerpc/rtas/" VALIDATE_FLASH_NAME,
 -                                      &validate_flash_operations);
 -      if (validate_pde == NULL) {
 -              rc = -ENOMEM;
 -              goto cleanup;
 -      }
 +      for (i = 0; i < ARRAY_SIZE(rtas_flash_files); i++) {
 +              const struct rtas_flash_file *f = &rtas_flash_files[i];
 +              int token;
  
 -      rc = initialize_flash_pde_data("ibm,validate-flash-image",
 -                                     sizeof(struct rtas_validate_flash_t), 
 -                                     validate_pde);
 -      if (rc != 0)
 -              goto cleanup;
 -
 -      manage_pde = create_flash_pde("powerpc/rtas/" MANAGE_FLASH_NAME,
 -                                    &manage_flash_operations);
 -      if (manage_pde == NULL) {
 -              rc = -ENOMEM;
 -              goto cleanup;
 -      }
 +              if (!proc_create(f->filename, S_IRUSR | S_IWUSR, NULL, &f->fops))
 +                      goto enomem;
  
 -      rc = initialize_flash_pde_data("ibm,manage-flash-image",
 -                                     sizeof(struct rtas_manage_flash_t),
 -                                     manage_pde);
 -      if (rc != 0)
 -              goto cleanup;
 +              /*
 +               * This code assumes that the status int is the first member of the
 +               * struct
 +               */
 +              token = rtas_token(f->rtas_call_name);
 +              if (token == RTAS_UNKNOWN_SERVICE)
 +                      *f->status = FLASH_AUTH;
 +              else
 +                      *f->status = FLASH_NO_OP;
 +      }
  
        rtas_flash_term_hook = rtas_flash_firmware;
 -
 -      flash_block_cache = kmem_cache_create("rtas_flash_cache",
 -                              RTAS_BLK_SIZE, RTAS_BLK_SIZE, 0,
 -                              NULL);
 -      if (!flash_block_cache) {
 -              printk(KERN_ERR "%s: failed to create block cache\n",
 -                              __func__);
 -              rc = -ENOMEM;
 -              goto cleanup;
 -      }
        return 0;
  
 -cleanup:
 -      remove_flash_pde(firmware_flash_pde);
 -      remove_flash_pde(firmware_update_pde);
 -      remove_flash_pde(validate_pde);
 -      remove_flash_pde(manage_pde);
 +enomem:
 +      while (--i >= 0) {
 +              const struct rtas_flash_file *f = &rtas_flash_files[i];
 +              remove_proc_entry(f->filename, NULL);
 +      }
  
 -      return rc;
 +      kmem_cache_destroy(flash_block_cache);
 +enomem_buf:
 +      kfree(rtas_validate_flash_data.buf);
 +      return -ENOMEM;
  }
  
  static void __exit rtas_flash_cleanup(void)
  {
 +      int i;
 +
        rtas_flash_term_hook = NULL;
  
+       if (rtas_firmware_flash_list) {
+               free_flash_list(rtas_firmware_flash_list);
+               rtas_firmware_flash_list = NULL;
+       }
 -      if (flash_block_cache)
 -              kmem_cache_destroy(flash_block_cache);
 +      for (i = 0; i < ARRAY_SIZE(rtas_flash_files); i++) {
 +              const struct rtas_flash_file *f = &rtas_flash_files[i];
 +              remove_proc_entry(f->filename, NULL);
 +      }
  
 -      remove_flash_pde(firmware_flash_pde);
 -      remove_flash_pde(firmware_update_pde);
 -      remove_flash_pde(validate_pde);
 -      remove_flash_pde(manage_pde);
 +      kmem_cache_destroy(flash_block_cache);
 +      kfree(rtas_validate_flash_data.buf);
  }
  
  module_init(rtas_flash_init);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/binfmt_elf.c
Simple merge
Simple merge