]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge tag 'powerpc-3.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Dec 2014 01:48:14 +0000 (17:48 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Dec 2014 01:48:14 +0000 (17:48 -0800)
Pull powerpc updates from Michael Ellerman:
 "Some nice cleanups like removing bootmem, and removal of
  __get_cpu_var().

  There is one patch to mm/gup.c.  This is the generic GUP
  implementation, but is only used by us and arm(64).  We have an ack
  from Steve Capper, and although we didn't get an ack from Andrew he
  told us to take the patch through the powerpc tree.

  There's one cxl patch.  This is in drivers/misc, but Greg said he was
  happy for us to manage fixes for it.

  There is an infrastructure patch to support an IPMI driver for OPAL.

  There is also an RTC driver for OPAL.  We weren't able to get any
  response from the RTC maintainer, Alessandro Zummo, so in the end we
  just merged the driver.

  The usual batch of Freescale updates from Scott"

* tag 'powerpc-3.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux: (101 commits)
  powerpc/powernv: Return to cpu offline loop when finished in KVM guest
  powerpc/book3s: Fix partial invalidation of TLBs in MCE code.
  powerpc/mm: don't do tlbie for updatepp request with NO HPTE fault
  powerpc/xmon: Cleanup the breakpoint flags
  powerpc/xmon: Enable HW instruction breakpoint on POWER8
  powerpc/mm/thp: Use tlbiel if possible
  powerpc/mm/thp: Remove code duplication
  powerpc/mm/hugetlb: Sanity check gigantic hugepage count
  powerpc/oprofile: Disable pagefaults during user stack read
  powerpc/mm: Check for matching hpte without taking hpte lock
  powerpc: Drop useless warning in eeh_init()
  powerpc/powernv: Cleanup unused MCE definitions/declarations.
  powerpc/eeh: Dump PHB diag-data early
  powerpc/eeh: Recover EEH error on ownership change for BCM5719
  powerpc/eeh: Set EEH_PE_RESET on PE reset
  powerpc/eeh: Refactor eeh_reset_pe()
  powerpc: Remove more traces of bootmem
  powerpc/pseries: Initialise nvram_pstore_info's buf_lock
  cxl: Name interrupts in /proc/interrupt
  cxl: Return error to PSL if IRQ demultiplexing fails & print clearer warning
  ...

19 files changed:
1  2 
arch/powerpc/include/asm/io.h
arch/powerpc/include/asm/pgtable-ppc64.h
arch/powerpc/kernel/ftrace.c
arch/powerpc/kernel/iommu.c
arch/powerpc/kernel/pci_64.c
arch/powerpc/mm/hugetlbpage.c
arch/powerpc/mm/numa.c
arch/powerpc/platforms/powernv/pci-ioda.c
arch/powerpc/platforms/powernv/pci.c
arch/powerpc/platforms/pseries/hotplug-memory.c
arch/powerpc/platforms/pseries/iommu.c
arch/powerpc/platforms/pseries/setup.c
arch/powerpc/sysdev/fsl_msi.c
arch/powerpc/sysdev/mpic_pasemi_msi.c
arch/powerpc/sysdev/mpic_u3msi.c
arch/powerpc/sysdev/ppc4xx_msi.c
arch/powerpc/xmon/xmon.c
drivers/rtc/Kconfig
include/linux/hugetlb.h

index 9eaf301ac952fccb9270d0dc89fb293ef17b34a9,5f0ad8904f6585ea263db722e448d191505b5515..a8d2ef30d473a12486659c7a2109eaa09fe1665a
@@@ -617,14 -617,10 +617,14 @@@ static inline void name at                                      
  /*
   * We don't do relaxed operations yet, at least not with this semantic
   */
 -#define readb_relaxed(addr) readb(addr)
 -#define readw_relaxed(addr) readw(addr)
 -#define readl_relaxed(addr) readl(addr)
 -#define readq_relaxed(addr) readq(addr)
 +#define readb_relaxed(addr)   readb(addr)
 +#define readw_relaxed(addr)   readw(addr)
 +#define readl_relaxed(addr)   readl(addr)
 +#define readq_relaxed(addr)   readq(addr)
 +#define writeb_relaxed(v, addr)       writeb(v, addr)
 +#define writew_relaxed(v, addr)       writew(v, addr)
 +#define writel_relaxed(v, addr)       writel(v, addr)
 +#define writeq_relaxed(v, addr)       writeq(v, addr)
  
  #ifdef CONFIG_PPC32
  #define mmiowb()
@@@ -855,9 -851,6 +855,6 @@@ static inline void * bus_to_virt(unsign
  
  #define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set)
  
- void __iomem *devm_ioremap_prot(struct device *dev, resource_size_t offset,
-                               size_t size, unsigned long flags);
  #endif /* __KERNEL__ */
  
  #endif /* _ASM_POWERPC_IO_H */
index 9b4b1904efae183c8eec2725b73e8c7c2d21b120,5600e434332fcbcc4fda6ef7ff813fe3808fef33..b9dcc936e2d1d2df1a399283a6f95dd02fb7b3cb
  #define pmd_none(pmd)         (!pmd_val(pmd))
  #define       pmd_bad(pmd)            (!is_kernel_addr(pmd_val(pmd)) \
                                 || (pmd_val(pmd) & PMD_BAD_BITS))
- #define       pmd_present(pmd)        (pmd_val(pmd) != 0)
+ #define       pmd_present(pmd)        (!pmd_none(pmd))
  #define       pmd_clear(pmdp)         (pmd_val(*(pmdp)) = 0)
  #define pmd_page_vaddr(pmd)   (pmd_val(pmd) & ~PMD_MASKED_BITS)
  extern struct page *pmd_page(pmd_t pmd);
  #define pud_present(pud)      (pud_val(pud) != 0)
  #define pud_clear(pudp)               (pud_val(*(pudp)) = 0)
  #define pud_page_vaddr(pud)   (pud_val(pud) & ~PUD_MASKED_BITS)
- #define pud_page(pud)         virt_to_page(pud_page_vaddr(pud))
  
+ extern struct page *pud_page(pud_t pud);
+ static inline pte_t pud_pte(pud_t pud)
+ {
+       return __pte(pud_val(pud));
+ }
+ static inline pud_t pte_pud(pte_t pte)
+ {
+       return __pud(pte_val(pte));
+ }
+ #define pud_write(pud)                pte_write(pud_pte(pud))
  #define pgd_set(pgdp, pudp)   ({pgd_val(*(pgdp)) = (unsigned long)(pudp);})
+ #define pgd_write(pgd)                pte_write(pgd_pte(pgd))
  
  /*
   * Find an entry in a page-table-directory.  We combine the address region
@@@ -422,7 -434,22 +434,22 @@@ extern void set_pmd_at(struct mm_struc
                       pmd_t *pmdp, pmd_t pmd);
  extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr,
                                 pmd_t *pmd);
+ /*
+  *
+  * For core kernel code by design pmd_trans_huge is never run on any hugetlbfs
+  * page. The hugetlbfs page table walking and mangling paths are totally
+  * separated form the core VM paths and they're differentiated by
+  *  VM_HUGETLB being set on vm_flags well before any pmd_trans_huge could run.
+  *
+  * pmd_trans_huge() is defined as false at build time if
+  * CONFIG_TRANSPARENT_HUGEPAGE=n to optimize away code blocks at build
+  * time in such case.
+  *
+  * For ppc64 we need to differntiate from explicit hugepages from THP, because
+  * for THP we also track the subpage details at the pmd level. We don't do
+  * that for explicit huge pages.
+  *
+  */
  static inline int pmd_trans_huge(pmd_t pmd)
  {
        /*
        return (pmd_val(pmd) & 0x3) && (pmd_val(pmd) & _PAGE_THP_HUGE);
  }
  
- static inline int pmd_large(pmd_t pmd)
- {
-       /*
-        * leaf pte for huge page, bottom two bits != 00
-        */
-       if (pmd_trans_huge(pmd))
-               return pmd_val(pmd) & _PAGE_PRESENT;
-       return 0;
- }
  static inline int pmd_trans_splitting(pmd_t pmd)
  {
        if (pmd_trans_huge(pmd))
  extern int has_transparent_hugepage(void);
  #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
  
+ static inline int pmd_large(pmd_t pmd)
+ {
+       /*
+        * leaf pte for huge page, bottom two bits != 00
+        */
+       return ((pmd_val(pmd) & 0x3) != 0x0);
+ }
  static inline pte_t pmd_pte(pmd_t pmd)
  {
        return __pte(pmd_val(pmd));
@@@ -467,7 -492,6 +492,7 @@@ static inline pte_t *pmdp_ptep(pmd_t *p
  }
  
  #define pmd_pfn(pmd)          pte_pfn(pmd_pte(pmd))
 +#define pmd_dirty(pmd)                pte_dirty(pmd_pte(pmd))
  #define pmd_young(pmd)                pte_young(pmd_pte(pmd))
  #define pmd_mkold(pmd)                pte_pmd(pte_mkold(pmd_pte(pmd)))
  #define pmd_wrprotect(pmd)    pte_pmd(pte_wrprotect(pmd_pte(pmd)))
@@@ -576,6 -600,5 +601,5 @@@ static inline int pmd_move_must_withdra
         */
        return true;
  }
  #endif /* __ASSEMBLY__ */
  #endif /* _ASM_POWERPC_PGTABLE_PPC64_H_ */
index e66af6d265e866ef49ad69be018dd21347275070,d7950317d3a1d5e126e49835e01d2408c613b111..44d4d8eb3c85c6a8e845b9048e0276842122a3f0
@@@ -449,7 -449,7 +449,7 @@@ void ftrace_replace_code(int enable
                rec = ftrace_rec_iter_record(iter);
                ret = __ftrace_replace_code(rec, enable);
                if (ret) {
 -                      ftrace_bug(ret, rec->ip);
 +                      ftrace_bug(ret, rec);
                        return;
                }
        }
@@@ -510,79 -510,36 +510,36 @@@ int ftrace_disable_ftrace_graph_caller(
  }
  #endif /* CONFIG_DYNAMIC_FTRACE */
  
- #ifdef CONFIG_PPC64
- extern void mod_return_to_handler(void);
- #endif
  /*
   * Hook the return address and push it in the stack of return addrs
-  * in current thread info.
+  * in current thread info. Return the address we want to divert to.
   */
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip)
  {
-       unsigned long old;
-       int faulted;
        struct ftrace_graph_ent trace;
-       unsigned long return_hooker = (unsigned long)&return_to_handler;
+       unsigned long return_hooker;
  
        if (unlikely(ftrace_graph_is_dead()))
-               return;
+               goto out;
  
        if (unlikely(atomic_read(&current->tracing_graph_pause)))
-               return;
- #ifdef CONFIG_PPC64
-       /* non core kernel code needs to save and restore the TOC */
-       if (REGION_ID(self_addr) != KERNEL_REGION_ID)
-               return_hooker = (unsigned long)&mod_return_to_handler;
- #endif
-       return_hooker = ppc_function_entry((void *)return_hooker);
+               goto out;
  
-       /*
-        * Protect against fault, even if it shouldn't
-        * happen. This tool is too much intrusive to
-        * ignore such a protection.
-        */
-       asm volatile(
-               "1: " PPC_LL "%[old], 0(%[parent])\n"
-               "2: " PPC_STL "%[return_hooker], 0(%[parent])\n"
-               "   li %[faulted], 0\n"
-               "3:\n"
-               ".section .fixup, \"ax\"\n"
-               "4: li %[faulted], 1\n"
-               "   b 3b\n"
-               ".previous\n"
-               ".section __ex_table,\"a\"\n"
-                       PPC_LONG_ALIGN "\n"
-                       PPC_LONG "1b,4b\n"
-                       PPC_LONG "2b,4b\n"
-               ".previous"
-               : [old] "=&r" (old), [faulted] "=r" (faulted)
-               : [parent] "r" (parent), [return_hooker] "r" (return_hooker)
-               : "memory"
-       );
-       if (unlikely(faulted)) {
-               ftrace_graph_stop();
-               WARN_ON(1);
-               return;
-       }
+       return_hooker = ppc_function_entry(return_to_handler);
  
-       trace.func = self_addr;
+       trace.func = ip;
        trace.depth = current->curr_ret_stack + 1;
  
        /* Only trace if the calling function expects to */
-       if (!ftrace_graph_entry(&trace)) {
-               *parent = old;
-               return;
-       }
+       if (!ftrace_graph_entry(&trace))
+               goto out;
+       if (ftrace_push_return_trace(parent, ip, &trace.depth, 0) == -EBUSY)
+               goto out;
  
-       if (ftrace_push_return_trace(old, self_addr, &trace.depth, 0) == -EBUSY)
-               *parent = old;
+       parent = return_hooker;
+ out:
+       return parent;
  }
  #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
  
index a83cf5ef64883669efebe3271c5ed77a0479e737,71e60bfb89e27a3bd8cc72fc5304f061a8dd1424..5d3968c4d79973a4645f9d7b4069056311fd42cc
@@@ -208,7 -208,7 +208,7 @@@ static unsigned long iommu_range_alloc(
         * We don't need to disable preemption here because any CPU can
         * safely use any IOMMU pool.
         */
-       pool_nr = __raw_get_cpu_var(iommu_pool_hash) & (tbl->nr_pools - 1);
+       pool_nr = __this_cpu_read(iommu_pool_hash) & (tbl->nr_pools - 1);
  
        if (largealloc)
                pool = &(tbl->large_pool);
@@@ -428,10 -428,10 +428,10 @@@ static void iommu_free(struct iommu_tab
                ppc_md.tce_flush(tbl);
  }
  
 -int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
 -               struct scatterlist *sglist, int nelems,
 -               unsigned long mask, enum dma_data_direction direction,
 -               struct dma_attrs *attrs)
 +int ppc_iommu_map_sg(struct device *dev, struct iommu_table *tbl,
 +                   struct scatterlist *sglist, int nelems,
 +                   unsigned long mask, enum dma_data_direction direction,
 +                   struct dma_attrs *attrs)
  {
        dma_addr_t dma_next = 0, dma_addr;
        struct scatterlist *s, *outs, *segstart;
  
        DBG("mapped %d elements:\n", outcount);
  
 -      /* For the sake of iommu_unmap_sg, we clear out the length in the
 +      /* For the sake of ppc_iommu_unmap_sg, we clear out the length in the
         * next entry of the sglist if we didn't fill the list completely
         */
        if (outcount < incount) {
  }
  
  
 -void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
 -              int nelems, enum dma_data_direction direction,
 -              struct dma_attrs *attrs)
 +void ppc_iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
 +                      int nelems, enum dma_data_direction direction,
 +                      struct dma_attrs *attrs)
  {
        struct scatterlist *sg;
  
index b15194e2c5fc55ca934dba97fe4863b2c273baa5,ba0f2d6fc27ff32f34f3d4ac0aebc02b90cce5a6..60bb187cb46ac0cc64c67a4f19fb1687492a25f1
@@@ -17,7 -17,6 +17,6 @@@
  #include <linux/pci.h>
  #include <linux/string.h>
  #include <linux/init.h>
- #include <linux/bootmem.h>
  #include <linux/export.h>
  #include <linux/mm.h>
  #include <linux/list.h>
@@@ -266,3 -265,13 +265,3 @@@ int pcibus_to_node(struct pci_bus *bus
  }
  EXPORT_SYMBOL(pcibus_to_node);
  #endif
 -
 -static void quirk_radeon_32bit_msi(struct pci_dev *dev)
 -{
 -      struct pci_dn *pdn = pci_get_pdn(dev);
 -
 -      if (pdn)
 -              pdn->force_32bit_msi = true;
 -}
 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x68f2, quirk_radeon_32bit_msi);
 -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0xaa68, quirk_radeon_32bit_msi);
index 6a4a5fcb9730877e0f089add23c6c522a41cc72c,868ab0fc5fbf02e2aa3286e121a10123cc44df1b..5ff4e07d920a365a7860df9bba0afc33c82b442a
@@@ -62,6 -62,9 +62,9 @@@ static unsigned nr_gpages
  /*
   * We have PGD_INDEX_SIZ = 12 and PTE_INDEX_SIZE = 8, so that we can have
   * 16GB hugepage pte in PGD and 16MB hugepage pte at PMD;
+  *
+  * Defined in such a way that we can optimize away code block at build time
+  * if CONFIG_HUGETLB_PAGE=n.
   */
  int pmd_huge(pmd_t pmd)
  {
@@@ -230,7 -233,7 +233,7 @@@ pte_t *huge_pte_alloc(struct mm_struct 
        if (hugepd_none(*hpdp) && __hugepte_alloc(mm, hpdp, addr, pdshift, pshift))
                return NULL;
  
-       return hugepte_offset(hpdp, addr, pdshift);
+       return hugepte_offset(*hpdp, addr, pdshift);
  }
  
  #else
@@@ -270,13 -273,13 +273,13 @@@ pte_t *huge_pte_alloc(struct mm_struct 
        if (hugepd_none(*hpdp) && __hugepte_alloc(mm, hpdp, addr, pdshift, pshift))
                return NULL;
  
-       return hugepte_offset(hpdp, addr, pdshift);
+       return hugepte_offset(*hpdp, addr, pdshift);
  }
  #endif
  
  #ifdef CONFIG_PPC_FSL_BOOK3E
  /* Build list of addresses of gigantic pages.  This function is used in early
-  * boot before the buddy or bootmem allocator is setup.
+  * boot before the buddy allocator is setup.
   */
  void add_gpage(u64 addr, u64 page_size, unsigned long number_of_pages)
  {
@@@ -312,7 -315,7 +315,7 @@@ int alloc_bootmem_huge_page(struct hsta
         * If gpages can be in highmem we can't use the trick of storing the
         * data structure in the page; allocate space for this
         */
-       m = alloc_bootmem(sizeof(struct huge_bootmem_page));
+       m = memblock_virt_alloc(sizeof(struct huge_bootmem_page), 0);
        m->phys = gpage_freearray[idx].gpage_list[--nr_gpages];
  #else
        m = phys_to_virt(gpage_freearray[idx].gpage_list[--nr_gpages]);
@@@ -352,6 -355,13 +355,13 @@@ static int __init do_gpage_early_setup(
                if (size != 0) {
                        if (sscanf(val, "%lu", &npages) <= 0)
                                npages = 0;
+                       if (npages > MAX_NUMBER_GPAGES) {
+                               pr_warn("MMU: %lu pages requested for page "
+                                       "size %llu KB, limiting to "
+                                       __stringify(MAX_NUMBER_GPAGES) "\n",
+                                       npages, size / 1024);
+                               npages = MAX_NUMBER_GPAGES;
+                       }
                        gpage_npages[shift_to_mmu_psize(__ffs(size))] = npages;
                        size = 0;
                }
@@@ -399,7 -409,7 +409,7 @@@ void __init reserve_hugetlb_gpages(void
  #else /* !PPC_FSL_BOOK3E */
  
  /* Build list of addresses of gigantic pages.  This function is used in early
-  * boot before the buddy or bootmem allocator is setup.
+  * boot before the buddy allocator is setup.
   */
  void add_gpage(u64 addr, u64 page_size, unsigned long number_of_pages)
  {
@@@ -462,7 -472,7 +472,7 @@@ static void hugepd_free(struct mmu_gath
  {
        struct hugepd_freelist **batchp;
  
-       batchp = &get_cpu_var(hugepd_freelist_cur);
+       batchp = this_cpu_ptr(&hugepd_freelist_cur);
  
        if (atomic_read(&tlb->mm->mm_users) < 2 ||
            cpumask_equal(mm_cpumask(tlb->mm),
@@@ -517,6 -527,8 +527,6 @@@ static void free_hugepd_range(struct mm
        for (i = 0; i < num_hugepd; i++, hpdp++)
                hpdp->pd = 0;
  
 -      tlb->need_flush = 1;
 -
  #ifdef CONFIG_PPC_FSL_BOOK3E
        hugepd_free(tlb, hugepte);
  #else
@@@ -536,7 -548,7 +546,7 @@@ static void hugetlb_free_pmd_range(stru
        do {
                pmd = pmd_offset(pud, addr);
                next = pmd_addr_end(addr, end);
-               if (!is_hugepd(pmd)) {
+               if (!is_hugepd(__hugepd(pmd_val(*pmd)))) {
                        /*
                         * if it is not hugepd pointer, we should already find
                         * it cleared.
@@@ -585,7 -597,7 +595,7 @@@ static void hugetlb_free_pud_range(stru
        do {
                pud = pud_offset(pgd, addr);
                next = pud_addr_end(addr, end);
-               if (!is_hugepd(pud)) {
+               if (!is_hugepd(__hugepd(pud_val(*pud)))) {
                        if (pud_none_or_clear_bad(pud))
                                continue;
                        hugetlb_free_pmd_range(tlb, pud, addr, next, floor,
@@@ -651,7 -663,7 +661,7 @@@ void hugetlb_free_pgd_range(struct mmu_
        do {
                next = pgd_addr_end(addr, end);
                pgd = pgd_offset(tlb->mm, addr);
-               if (!is_hugepd(pgd)) {
+               if (!is_hugepd(__hugepd(pgd_val(*pgd)))) {
                        if (pgd_none_or_clear_bad(pgd))
                                continue;
                        hugetlb_free_pud_range(tlb, pgd, addr, next, floor, ceiling);
@@@ -711,12 -723,11 +721,11 @@@ static unsigned long hugepte_addr_end(u
        return (__boundary - 1 < end - 1) ? __boundary : end;
  }
  
- int gup_hugepd(hugepd_t *hugepd, unsigned pdshift,
-              unsigned long addr, unsigned long end,
-              int write, struct page **pages, int *nr)
+ int gup_huge_pd(hugepd_t hugepd, unsigned long addr, unsigned pdshift,
+               unsigned long end, int write, struct page **pages, int *nr)
  {
        pte_t *ptep;
-       unsigned long sz = 1UL << hugepd_shift(*hugepd);
+       unsigned long sz = 1UL << hugepd_shift(hugepd);
        unsigned long next;
  
        ptep = hugepte_offset(hugepd, addr, pdshift);
@@@ -959,7 -970,7 +968,7 @@@ pte_t *find_linux_pte_or_hugepte(pgd_t 
        else if (pgd_huge(pgd)) {
                ret_pte = (pte_t *) pgdp;
                goto out;
-       } else if (is_hugepd(&pgd))
+       } else if (is_hugepd(__hugepd(pgd_val(pgd))))
                hpdp = (hugepd_t *)&pgd;
        else {
                /*
                else if (pud_huge(pud)) {
                        ret_pte = (pte_t *) pudp;
                        goto out;
-               } else if (is_hugepd(&pud))
+               } else if (is_hugepd(__hugepd(pud_val(pud))))
                        hpdp = (hugepd_t *)&pud;
                else {
                        pdshift = PMD_SHIFT;
                        if (pmd_huge(pmd) || pmd_large(pmd)) {
                                ret_pte = (pte_t *) pmdp;
                                goto out;
-                       } else if (is_hugepd(&pmd))
+                       } else if (is_hugepd(__hugepd(pmd_val(pmd))))
                                hpdp = (hugepd_t *)&pmd;
                        else
                                return pte_offset_kernel(&pmd, ea);
        if (!hpdp)
                return NULL;
  
-       ret_pte = hugepte_offset(hpdp, ea, pdshift);
+       ret_pte = hugepte_offset(*hpdp, ea, pdshift);
        pdshift = hugepd_shift(*hpdp);
  out:
        if (shift)
@@@ -1036,14 -1047,6 +1045,6 @@@ int gup_hugepte(pte_t *ptep, unsigned l
        if ((pte_val(pte) & mask) != mask)
                return 0;
  
- #ifdef CONFIG_TRANSPARENT_HUGEPAGE
-       /*
-        * check for splitting here
-        */
-       if (pmd_trans_splitting(pte_pmd(pte)))
-               return 0;
- #endif
        /* hugepages are never "special" */
        VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
  
diff --combined arch/powerpc/mm/numa.c
index 9fe6002c1d5aaa431168dcd35e2d0104cfc17ee1,417b0a523a47f1962f2a80e55285230c96706d11..0257a7d659ef4184359ab65f13d70638793a8df9
@@@ -134,28 -134,6 +134,6 @@@ static int __init fake_numa_create_new_
        return 0;
  }
  
- /*
-  * get_node_active_region - Return active region containing pfn
-  * Active range returned is empty if none found.
-  * @pfn: The page to return the region for
-  * @node_ar: Returned set to the active region containing @pfn
-  */
- static void __init get_node_active_region(unsigned long pfn,
-                                         struct node_active_region *node_ar)
- {
-       unsigned long start_pfn, end_pfn;
-       int i, nid;
-       for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) {
-               if (pfn >= start_pfn && pfn < end_pfn) {
-                       node_ar->nid = nid;
-                       node_ar->start_pfn = start_pfn;
-                       node_ar->end_pfn = end_pfn;
-                       break;
-               }
-       }
- }
  static void reset_numa_cpu_lookup_table(void)
  {
        unsigned int cpu;
@@@ -928,134 -906,48 +906,48 @@@ static void __init dump_numa_memory_top
        }
  }
  
- /*
-  * Allocate some memory, satisfying the memblock or bootmem allocator where
-  * required. nid is the preferred node and end is the physical address of
-  * the highest address in the node.
-  *
-  * Returns the virtual address of the memory.
-  */
- static void __init *careful_zallocation(int nid, unsigned long size,
-                                      unsigned long align,
-                                      unsigned long end_pfn)
- {
-       void *ret;
-       int new_nid;
-       unsigned long ret_paddr;
-       ret_paddr = __memblock_alloc_base(size, align, end_pfn << PAGE_SHIFT);
-       /* retry over all memory */
-       if (!ret_paddr)
-               ret_paddr = __memblock_alloc_base(size, align, memblock_end_of_DRAM());
-       if (!ret_paddr)
-               panic("numa.c: cannot allocate %lu bytes for node %d",
-                     size, nid);
-       ret = __va(ret_paddr);
-       /*
-        * We initialize the nodes in numeric order: 0, 1, 2...
-        * and hand over control from the MEMBLOCK allocator to the
-        * bootmem allocator.  If this function is called for
-        * node 5, then we know that all nodes <5 are using the
-        * bootmem allocator instead of the MEMBLOCK allocator.
-        *
-        * So, check the nid from which this allocation came
-        * and double check to see if we need to use bootmem
-        * instead of the MEMBLOCK.  We don't free the MEMBLOCK memory
-        * since it would be useless.
-        */
-       new_nid = early_pfn_to_nid(ret_paddr >> PAGE_SHIFT);
-       if (new_nid < nid) {
-               ret = __alloc_bootmem_node(NODE_DATA(new_nid),
-                               size, align, 0);
-               dbg("alloc_bootmem %p %lx\n", ret, size);
-       }
-       memset(ret, 0, size);
-       return ret;
- }
  static struct notifier_block ppc64_numa_nb = {
        .notifier_call = cpu_numa_callback,
        .priority = 1 /* Must run before sched domains notifier. */
  };
  
- static void __init mark_reserved_regions_for_nid(int nid)
+ /* Initialize NODE_DATA for a node on the local memory */
+ static void __init setup_node_data(int nid, u64 start_pfn, u64 end_pfn)
  {
-       struct pglist_data *node = NODE_DATA(nid);
-       struct memblock_region *reg;
+       u64 spanned_pages = end_pfn - start_pfn;
+       const size_t nd_size = roundup(sizeof(pg_data_t), SMP_CACHE_BYTES);
+       u64 nd_pa;
+       void *nd;
+       int tnid;
  
-       for_each_memblock(reserved, reg) {
-               unsigned long physbase = reg->base;
-               unsigned long size = reg->size;
-               unsigned long start_pfn = physbase >> PAGE_SHIFT;
-               unsigned long end_pfn = PFN_UP(physbase + size);
-               struct node_active_region node_ar;
-               unsigned long node_end_pfn = pgdat_end_pfn(node);
+       if (spanned_pages)
+               pr_info("Initmem setup node %d [mem %#010Lx-%#010Lx]\n",
+                       nid, start_pfn << PAGE_SHIFT,
+                       (end_pfn << PAGE_SHIFT) - 1);
+       else
+               pr_info("Initmem setup node %d\n", nid);
  
-               /*
-                * Check to make sure that this memblock.reserved area is
-                * within the bounds of the node that we care about.
-                * Checking the nid of the start and end points is not
-                * sufficient because the reserved area could span the
-                * entire node.
-                */
-               if (end_pfn <= node->node_start_pfn ||
-                   start_pfn >= node_end_pfn)
-                       continue;
+       nd_pa = memblock_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
+       nd = __va(nd_pa);
  
-               get_node_active_region(start_pfn, &node_ar);
-               while (start_pfn < end_pfn &&
-                       node_ar.start_pfn < node_ar.end_pfn) {
-                       unsigned long reserve_size = size;
-                       /*
-                        * if reserved region extends past active region
-                        * then trim size to active region
-                        */
-                       if (end_pfn > node_ar.end_pfn)
-                               reserve_size = (node_ar.end_pfn << PAGE_SHIFT)
-                                       - physbase;
-                       /*
-                        * Only worry about *this* node, others may not
-                        * yet have valid NODE_DATA().
-                        */
-                       if (node_ar.nid == nid) {
-                               dbg("reserve_bootmem %lx %lx nid=%d\n",
-                                       physbase, reserve_size, node_ar.nid);
-                               reserve_bootmem_node(NODE_DATA(node_ar.nid),
-                                               physbase, reserve_size,
-                                               BOOTMEM_DEFAULT);
-                       }
-                       /*
-                        * if reserved region is contained in the active region
-                        * then done.
-                        */
-                       if (end_pfn <= node_ar.end_pfn)
-                               break;
-                       /*
-                        * reserved region extends past the active region
-                        *   get next active region that contains this
-                        *   reserved region
-                        */
-                       start_pfn = node_ar.end_pfn;
-                       physbase = start_pfn << PAGE_SHIFT;
-                       size = size - reserve_size;
-                       get_node_active_region(start_pfn, &node_ar);
-               }
-       }
- }
+       /* report and initialize */
+       pr_info("  NODE_DATA [mem %#010Lx-%#010Lx]\n",
+               nd_pa, nd_pa + nd_size - 1);
+       tnid = early_pfn_to_nid(nd_pa >> PAGE_SHIFT);
+       if (tnid != nid)
+               pr_info("    NODE_DATA(%d) on node %d\n", nid, tnid);
  
+       node_data[nid] = nd;
+       memset(NODE_DATA(nid), 0, sizeof(pg_data_t));
+       NODE_DATA(nid)->node_id = nid;
+       NODE_DATA(nid)->node_start_pfn = start_pfn;
+       NODE_DATA(nid)->node_spanned_pages = spanned_pages;
+ }
  
- void __init do_init_bootmem(void)
+ void __init initmem_init(void)
  {
        int nid, cpu;
  
-       min_low_pfn = 0;
        max_low_pfn = memblock_end_of_DRAM() >> PAGE_SHIFT;
        max_pfn = max_low_pfn;
  
        else
                dump_numa_memory_topology();
  
+       memblock_dump_all();
        for_each_online_node(nid) {
                unsigned long start_pfn, end_pfn;
-               void *bootmem_vaddr;
-               unsigned long bootmap_pages;
  
                get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
-               /*
-                * Allocate the node structure node local if possible
-                *
-                * Be careful moving this around, as it relies on all
-                * previous nodes' bootmem to be initialized and have
-                * all reserved areas marked.
-                */
-               NODE_DATA(nid) = careful_zallocation(nid,
-                                       sizeof(struct pglist_data),
-                                       SMP_CACHE_BYTES, end_pfn);
-               dbg("node %d\n", nid);
-               dbg("NODE_DATA() = %p\n", NODE_DATA(nid));
-               NODE_DATA(nid)->bdata = &bootmem_node_data[nid];
-               NODE_DATA(nid)->node_start_pfn = start_pfn;
-               NODE_DATA(nid)->node_spanned_pages = end_pfn - start_pfn;
-               if (NODE_DATA(nid)->node_spanned_pages == 0)
-                       continue;
-               dbg("start_paddr = %lx\n", start_pfn << PAGE_SHIFT);
-               dbg("end_paddr = %lx\n", end_pfn << PAGE_SHIFT);
-               bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
-               bootmem_vaddr = careful_zallocation(nid,
-                                       bootmap_pages << PAGE_SHIFT,
-                                       PAGE_SIZE, end_pfn);
-               dbg("bootmap_vaddr = %p\n", bootmem_vaddr);
-               init_bootmem_node(NODE_DATA(nid),
-                                 __pa(bootmem_vaddr) >> PAGE_SHIFT,
-                                 start_pfn, end_pfn);
-               free_bootmem_with_active_regions(nid, end_pfn);
-               /*
-                * Be very careful about moving this around.  Future
-                * calls to careful_zallocation() depend on this getting
-                * done correctly.
-                */
-               mark_reserved_regions_for_nid(nid);
+               setup_node_data(nid, start_pfn, end_pfn);
                sparse_memory_present_with_active_regions(nid);
        }
  
-       init_bootmem_done = 1;
+       sparse_init();
  
-       /*
-        * Now bootmem is initialised we can create the node to cpumask
-        * lookup tables and setup the cpu callback to populate them.
-        */
        setup_node_to_cpumask_map();
  
        reset_numa_cpu_lookup_table();
@@@ -1711,11 -1557,12 +1557,11 @@@ static void stage_topology_update(int c
  static int dt_update_callback(struct notifier_block *nb,
                                unsigned long action, void *data)
  {
 -      struct of_prop_reconfig *update;
 +      struct of_reconfig_data *update = data;
        int rc = NOTIFY_DONE;
  
        switch (action) {
        case OF_RECONFIG_UPDATE_PROPERTY:
 -              update = (struct of_prop_reconfig *)data;
                if (!of_prop_cmp(update->dn->type, "cpu") &&
                    !of_prop_cmp(update->prop->name, "ibm,associativity")) {
                        u32 core_id;
index 3ba435ec3dcd584e5f466b78eae18379a69d482b,cc861c14840d449650fc24117b2ccac8dc7ac1ec..fac88ed8a915eb782e750b6749df1bff0a9b5790
@@@ -91,6 -91,24 +91,24 @@@ static inline bool pnv_pci_is_mem_pref_
                (IORESOURCE_MEM_64 | IORESOURCE_PREFETCH));
  }
  
+ static void pnv_ioda_reserve_pe(struct pnv_phb *phb, int pe_no)
+ {
+       if (!(pe_no >= 0 && pe_no < phb->ioda.total_pe)) {
+               pr_warn("%s: Invalid PE %d on PHB#%x\n",
+                       __func__, pe_no, phb->hose->global_number);
+               return;
+       }
+       if (test_and_set_bit(pe_no, phb->ioda.pe_alloc)) {
+               pr_warn("%s: PE %d was assigned on PHB#%x\n",
+                       __func__, pe_no, phb->hose->global_number);
+               return;
+       }
+       phb->ioda.pe_array[pe_no].phb = phb;
+       phb->ioda.pe_array[pe_no].pe_number = pe_no;
+ }
  static int pnv_ioda_alloc_pe(struct pnv_phb *phb)
  {
        unsigned long pe;
@@@ -172,7 -190,7 +190,7 @@@ fail
        return -EIO;
  }
  
- static void pnv_ioda2_alloc_m64_pe(struct pnv_phb *phb)
+ static void pnv_ioda2_reserve_m64_pe(struct pnv_phb *phb)
  {
        resource_size_t sgsz = phb->ioda.m64_segsize;
        struct pci_dev *pdev;
         * instead of root bus.
         */
        list_for_each_entry(pdev, &phb->hose->bus->devices, bus_list) {
-               for (i = PCI_BRIDGE_RESOURCES;
-                    i <= PCI_BRIDGE_RESOURCE_END; i++) {
-                       r = &pdev->resource[i];
+               for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
+                       r = &pdev->resource[PCI_BRIDGE_RESOURCES + i];
                        if (!r->parent ||
                            !pnv_pci_is_mem_pref_64(r->flags))
                                continue;
  
                        base = (r->start - phb->ioda.m64_base) / sgsz;
                        for (step = 0; step < resource_size(r) / sgsz; step++)
-                               set_bit(base + step, phb->ioda.pe_alloc);
+                               pnv_ioda_reserve_pe(phb, base + step);
                }
        }
  }
@@@ -287,8 -304,6 +304,6 @@@ done
        while ((i = find_next_bit(pe_alloc, phb->ioda.total_pe, i + 1)) <
                phb->ioda.total_pe) {
                pe = &phb->ioda.pe_array[i];
-               pe->phb = phb;
-               pe->pe_number = i;
  
                if (!master_pe) {
                        pe->flags |= PNV_IODA_PE_MASTER;
@@@ -313,6 -328,12 +328,12 @@@ static void __init pnv_ioda_parse_m64_w
        const u32 *r;
        u64 pci_addr;
  
+       /* FIXME: Support M64 for P7IOC */
+       if (phb->type != PNV_PHB_IODA2) {
+               pr_info("  Not support M64 window\n");
+               return;
+       }
        if (!firmware_has_feature(FW_FEATURE_OPALv3)) {
                pr_info("  Firmware too old to support M64 window\n");
                return;
                return;
        }
  
-       /* FIXME: Support M64 for P7IOC */
-       if (phb->type != PNV_PHB_IODA2) {
-               pr_info("  Not support M64 window\n");
-               return;
-       }
        res = &hose->mem_resources[1];
        res->start = of_translate_address(dn, r + 2);
        res->end = res->start + of_read_number(r + 4, 2) - 1;
        /* Use last M64 BAR to cover M64 window */
        phb->ioda.m64_bar_idx = 15;
        phb->init_m64 = pnv_ioda2_init_m64;
-       phb->alloc_m64_pe = pnv_ioda2_alloc_m64_pe;
+       phb->reserve_m64_pe = pnv_ioda2_reserve_m64_pe;
        phb->pick_m64_pe = pnv_ioda2_pick_m64_pe;
  }
  
@@@ -358,7 -373,9 +373,9 @@@ static void pnv_ioda_freeze_pe(struct p
        /* Fetch master PE */
        if (pe->flags & PNV_IODA_PE_SLAVE) {
                pe = pe->master;
-               WARN_ON(!pe || !(pe->flags & PNV_IODA_PE_MASTER));
+               if (WARN_ON(!pe || !(pe->flags & PNV_IODA_PE_MASTER)))
+                       return;
                pe_no = pe->pe_number;
        }
  
@@@ -507,6 -524,106 +524,106 @@@ static struct pnv_ioda_pe *pnv_ioda_get
  }
  #endif /* CONFIG_PCI_MSI */
  
+ static int pnv_ioda_set_one_peltv(struct pnv_phb *phb,
+                                 struct pnv_ioda_pe *parent,
+                                 struct pnv_ioda_pe *child,
+                                 bool is_add)
+ {
+       const char *desc = is_add ? "adding" : "removing";
+       uint8_t op = is_add ? OPAL_ADD_PE_TO_DOMAIN :
+                             OPAL_REMOVE_PE_FROM_DOMAIN;
+       struct pnv_ioda_pe *slave;
+       long rc;
+       /* Parent PE affects child PE */
+       rc = opal_pci_set_peltv(phb->opal_id, parent->pe_number,
+                               child->pe_number, op);
+       if (rc != OPAL_SUCCESS) {
+               pe_warn(child, "OPAL error %ld %s to parent PELTV\n",
+                       rc, desc);
+               return -ENXIO;
+       }
+       if (!(child->flags & PNV_IODA_PE_MASTER))
+               return 0;
+       /* Compound case: parent PE affects slave PEs */
+       list_for_each_entry(slave, &child->slaves, list) {
+               rc = opal_pci_set_peltv(phb->opal_id, parent->pe_number,
+                                       slave->pe_number, op);
+               if (rc != OPAL_SUCCESS) {
+                       pe_warn(slave, "OPAL error %ld %s to parent PELTV\n",
+                               rc, desc);
+                       return -ENXIO;
+               }
+       }
+       return 0;
+ }
+ static int pnv_ioda_set_peltv(struct pnv_phb *phb,
+                             struct pnv_ioda_pe *pe,
+                             bool is_add)
+ {
+       struct pnv_ioda_pe *slave;
+       struct pci_dev *pdev;
+       int ret;
+       /*
+        * Clear PE frozen state. If it's master PE, we need
+        * clear slave PE frozen state as well.
+        */
+       if (is_add) {
+               opal_pci_eeh_freeze_clear(phb->opal_id, pe->pe_number,
+                                         OPAL_EEH_ACTION_CLEAR_FREEZE_ALL);
+               if (pe->flags & PNV_IODA_PE_MASTER) {
+                       list_for_each_entry(slave, &pe->slaves, list)
+                               opal_pci_eeh_freeze_clear(phb->opal_id,
+                                                         slave->pe_number,
+                                                         OPAL_EEH_ACTION_CLEAR_FREEZE_ALL);
+               }
+       }
+       /*
+        * Associate PE in PELT. We need add the PE into the
+        * corresponding PELT-V as well. Otherwise, the error
+        * originated from the PE might contribute to other
+        * PEs.
+        */
+       ret = pnv_ioda_set_one_peltv(phb, pe, pe, is_add);
+       if (ret)
+               return ret;
+       /* For compound PEs, any one affects all of them */
+       if (pe->flags & PNV_IODA_PE_MASTER) {
+               list_for_each_entry(slave, &pe->slaves, list) {
+                       ret = pnv_ioda_set_one_peltv(phb, slave, pe, is_add);
+                       if (ret)
+                               return ret;
+               }
+       }
+       if (pe->flags & (PNV_IODA_PE_BUS_ALL | PNV_IODA_PE_BUS))
+               pdev = pe->pbus->self;
+       else
+               pdev = pe->pdev->bus->self;
+       while (pdev) {
+               struct pci_dn *pdn = pci_get_pdn(pdev);
+               struct pnv_ioda_pe *parent;
+               if (pdn && pdn->pe_number != IODA_INVALID_PE) {
+                       parent = &phb->ioda.pe_array[pdn->pe_number];
+                       ret = pnv_ioda_set_one_peltv(phb, parent, pe, is_add);
+                       if (ret)
+                               return ret;
+               }
+               pdev = pdev->bus->self;
+       }
+       return 0;
+ }
  static int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
  {
        struct pci_dev *parent;
                return -ENXIO;
        }
  
-       rc = opal_pci_set_peltv(phb->opal_id, pe->pe_number,
-                               pe->pe_number, OPAL_ADD_PE_TO_DOMAIN);
-       if (rc)
-               pe_warn(pe, "OPAL error %d adding self to PELTV\n", rc);
-       opal_pci_eeh_freeze_clear(phb->opal_id, pe->pe_number,
-                                 OPAL_EEH_ACTION_CLEAR_FREEZE_ALL);
+       /* Configure PELTV */
+       pnv_ioda_set_peltv(phb, pe, true);
  
-       /* Add to all parents PELT-V */
-       while (parent) {
-               struct pci_dn *pdn = pci_get_pdn(parent);
-               if (pdn && pdn->pe_number != IODA_INVALID_PE) {
-                       rc = opal_pci_set_peltv(phb->opal_id, pdn->pe_number,
-                                               pe->pe_number, OPAL_ADD_PE_TO_DOMAIN);
-                       /* XXX What to do in case of error ? */
-               }
-               parent = parent->bus->self;
-       }
        /* Setup reverse map */
        for (rid = pe->rid; rid < rid_end; rid++)
                phb->ioda.pe_rmap[rid] = pe->pe_number;
  
        /* Setup one MVTs on IODA1 */
-       if (phb->type == PNV_PHB_IODA1) {
-               pe->mve_number = pe->pe_number;
-               rc = opal_pci_set_mve(phb->opal_id, pe->mve_number,
-                                     pe->pe_number);
+       if (phb->type != PNV_PHB_IODA1) {
+               pe->mve_number = 0;
+               goto out;
+       }
+       pe->mve_number = pe->pe_number;
+       rc = opal_pci_set_mve(phb->opal_id, pe->mve_number, pe->pe_number);
+       if (rc != OPAL_SUCCESS) {
+               pe_err(pe, "OPAL error %ld setting up MVE %d\n",
+                      rc, pe->mve_number);
+               pe->mve_number = -1;
+       } else {
+               rc = opal_pci_set_mve_enable(phb->opal_id,
+                                            pe->mve_number, OPAL_ENABLE_MVE);
                if (rc) {
-                       pe_err(pe, "OPAL error %ld setting up MVE %d\n",
+                       pe_err(pe, "OPAL error %ld enabling MVE %d\n",
                               rc, pe->mve_number);
                        pe->mve_number = -1;
-               } else {
-                       rc = opal_pci_set_mve_enable(phb->opal_id,
-                                                    pe->mve_number, OPAL_ENABLE_MVE);
-                       if (rc) {
-                               pe_err(pe, "OPAL error %ld enabling MVE %d\n",
-                                      rc, pe->mve_number);
-                               pe->mve_number = -1;
-                       }
                }
-       } else if (phb->type == PNV_PHB_IODA2)
-               pe->mve_number = 0;
+       }
  
+ out:
        return 0;
  }
  
@@@ -837,8 -942,8 +942,8 @@@ static void pnv_pci_ioda_setup_PEs(void
                phb = hose->private_data;
  
                /* M64 layout might affect PE allocation */
-               if (phb->alloc_m64_pe)
-                       phb->alloc_m64_pe(phb);
+               if (phb->reserve_m64_pe)
+                       phb->reserve_m64_pe(phb);
  
                pnv_ioda_setup_PEs(hose->bus);
        }
@@@ -1509,6 -1614,7 +1614,6 @@@ static int pnv_pci_ioda_msi_setup(struc
                                  unsigned int is_64, struct msi_msg *msg)
  {
        struct pnv_ioda_pe *pe = pnv_ioda_get_pe(dev);
 -      struct pci_dn *pdn = pci_get_pdn(dev);
        unsigned int xive_num = hwirq - phb->msi_base;
        __be32 data;
        int rc;
                return -ENXIO;
  
        /* Force 32-bit MSI on some broken devices */
 -      if (pdn && pdn->force_32bit_msi)
 +      if (dev->no_64bit_msi)
                is_64 = 0;
  
        /* Assign XIVE to PE */
@@@ -1834,19 -1940,14 +1939,14 @@@ static void __init pnv_pci_init_ioda_ph
        phb_id = be64_to_cpup(prop64);
        pr_debug("  PHB-ID  : 0x%016llx\n", phb_id);
  
-       phb = alloc_bootmem(sizeof(struct pnv_phb));
-       if (!phb) {
-               pr_err("  Out of memory !\n");
-               return;
-       }
+       phb = memblock_virt_alloc(sizeof(struct pnv_phb), 0);
  
        /* Allocate PCI controller */
-       memset(phb, 0, sizeof(struct pnv_phb));
        phb->hose = hose = pcibios_alloc_controller(np);
        if (!phb->hose) {
                pr_err("  Can't allocate PCI controller for %s\n",
                       np->full_name);
-               free_bootmem((unsigned long)phb, sizeof(struct pnv_phb));
+               memblock_free(__pa(phb), sizeof(struct pnv_phb));
                return;
        }
  
        }
        pemap_off = size;
        size += phb->ioda.total_pe * sizeof(struct pnv_ioda_pe);
-       aux = alloc_bootmem(size);
-       memset(aux, 0, size);
+       aux = memblock_virt_alloc(size, 0);
        phb->ioda.pe_alloc = aux;
        phb->ioda.m32_segmap = aux + m32map_off;
        if (phb->type == PNV_PHB_IODA1)
        if (is_kdump_kernel()) {
                pr_info("  Issue PHB reset ...\n");
                ioda_eeh_phb_reset(hose, EEH_RESET_FUNDAMENTAL);
 -              ioda_eeh_phb_reset(hose, OPAL_DEASSERT_RESET);
 +              ioda_eeh_phb_reset(hose, EEH_RESET_DEACTIVATE);
        }
  
-       /* Configure M64 window */
-       if (phb->init_m64 && phb->init_m64(phb))
+       /* Remove M64 resource if we can't configure it successfully */
+       if (!phb->init_m64 || phb->init_m64(phb))
                hose->mem_resources[1].flags = 0;
  }
  
index 540fc6dd56b34609565ec5cde6b2d4ba516c2f21,ba7452708db3275fe85179da7f5b4e4c04759a01..4945e87f12dca58b44a6e98c27b5dcde1f12a054
@@@ -16,7 -16,6 +16,6 @@@
  #include <linux/delay.h>
  #include <linux/string.h>
  #include <linux/init.h>
- #include <linux/bootmem.h>
  #include <linux/irq.h>
  #include <linux/io.h>
  #include <linux/msi.h>
@@@ -50,6 -49,7 +49,6 @@@ static int pnv_setup_msi_irqs(struct pc
  {
        struct pci_controller *hose = pci_bus_to_host(pdev->bus);
        struct pnv_phb *phb = hose->private_data;
 -      struct pci_dn *pdn = pci_get_pdn(pdev);
        struct msi_desc *entry;
        struct msi_msg msg;
        int hwirq;
@@@ -59,7 -59,7 +58,7 @@@
        if (WARN_ON(!phb) || !phb->msi_bmp.bitmap)
                return -ENODEV;
  
 -      if (pdn && pdn->force_32bit_msi && !phb->msi32_support)
 +      if (pdev->no_64bit_msi && !phb->msi32_support)
                return -ENODEV;
  
        list_for_each_entry(entry, &pdev->msi_list, list) {
@@@ -90,7 -90,7 +89,7 @@@
                        return rc;
                }
                irq_set_msi_desc(virq, entry);
 -              write_msi_msg(virq, &msg);
 +              pci_write_msi_msg(virq, &msg);
        }
        return 0;
  }
index 1bbb78fab53000e66b39b8d1289967a3caee4c91,3cb256c2138e486d24a61ba6b09a8841939216f0..fa41f0da5b6f4687952388f04d1ff114c93520f9
@@@ -12,7 -12,6 +12,6 @@@
  #include <linux/of.h>
  #include <linux/of_address.h>
  #include <linux/memblock.h>
- #include <linux/vmalloc.h>
  #include <linux/memory.h>
  #include <linux/memory_hotplug.h>
  
@@@ -66,22 -65,6 +65,6 @@@ unsigned long pseries_memory_block_size
  }
  
  #ifdef CONFIG_MEMORY_HOTREMOVE
- static int pseries_remove_memory(u64 start, u64 size)
- {
-       int ret;
-       /* Remove htab bolted mappings for this section of memory */
-       start = (unsigned long)__va(start);
-       ret = remove_section_mapping(start, start + size);
-       /* Ensure all vmalloc mappings are flushed in case they also
-        * hit that section of memory
-        */
-       vm_unmap_aliases();
-       return ret;
- }
  static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size)
  {
        unsigned long block_sz, start_pfn;
@@@ -183,7 -166,7 +166,7 @@@ static int pseries_add_mem_node(struct 
        return (ret < 0) ? -EINVAL : 0;
  }
  
 -static int pseries_update_drconf_memory(struct of_prop_reconfig *pr)
 +static int pseries_update_drconf_memory(struct of_reconfig_data *pr)
  {
        struct of_drconf_cell *new_drmem, *old_drmem;
        unsigned long memblock_size;
  }
  
  static int pseries_memory_notifier(struct notifier_block *nb,
 -                                 unsigned long action, void *node)
 +                                 unsigned long action, void *data)
  {
 -      struct of_prop_reconfig *pr;
 +      struct of_reconfig_data *rd = data;
        int err = 0;
  
        switch (action) {
        case OF_RECONFIG_ATTACH_NODE:
 -              err = pseries_add_mem_node(node);
 +              err = pseries_add_mem_node(rd->dn);
                break;
        case OF_RECONFIG_DETACH_NODE:
 -              err = pseries_remove_mem_node(node);
 +              err = pseries_remove_mem_node(rd->dn);
                break;
        case OF_RECONFIG_UPDATE_PROPERTY:
 -              pr = (struct of_prop_reconfig *)node;
 -              if (!strcmp(pr->prop->name, "ibm,dynamic-memory"))
 -                      err = pseries_update_drconf_memory(pr);
 +              if (!strcmp(rd->prop->name, "ibm,dynamic-memory"))
 +                      err = pseries_update_drconf_memory(rd);
                break;
        }
        return notifier_from_errno(err);
@@@ -261,10 -245,6 +244,6 @@@ static int __init pseries_memory_hotplu
        if (firmware_has_feature(FW_FEATURE_LPAR))
                of_reconfig_notifier_register(&pseries_mem_nb);
  
- #ifdef CONFIG_MEMORY_HOTREMOVE
-       ppc_md.remove_memory = pseries_remove_memory;
- #endif
        return 0;
  }
  machine_device_initcall(pseries, pseries_memory_hotplug_init);
index 3e5bfdafee63f350793d89d53a5d88fcf9870e18,1cc3db95ee71f1d9b7f85e780a401507895f6ae2..1d3d52dc3ff31ed6ce0ab9b554c45c1233d0f039
@@@ -199,7 -199,7 +199,7 @@@ static int tce_buildmulti_pSeriesLP(str
  
        local_irq_save(flags);  /* to protect tcep and the page behind it */
  
-       tcep = __get_cpu_var(tce_page);
+       tcep = __this_cpu_read(tce_page);
  
        /* This is safe to do since interrupts are off when we're called
         * from iommu_alloc{,_sg}()
                        return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
                                            direction, attrs);
                }
-               __get_cpu_var(tce_page) = tcep;
+               __this_cpu_write(tce_page, tcep);
        }
  
        rpn = __pa(uaddr) >> TCE_SHIFT;
@@@ -398,7 -398,7 +398,7 @@@ static int tce_setrange_multi_pSeriesLP
        long l, limit;
  
        local_irq_disable();    /* to protect tcep and the page behind it */
-       tcep = __get_cpu_var(tce_page);
+       tcep = __this_cpu_read(tce_page);
  
        if (!tcep) {
                tcep = (__be64 *)__get_free_page(GFP_ATOMIC);
                        local_irq_enable();
                        return -ENOMEM;
                }
-               __get_cpu_var(tce_page) = tcep;
+               __this_cpu_write(tce_page, tcep);
        }
  
        proto_tce = TCE_PCI_READ | TCE_PCI_WRITE;
@@@ -574,8 -574,7 +574,7 @@@ static void pci_dma_bus_setup_pSeries(s
        while (isa_dn && isa_dn != dn)
                isa_dn = isa_dn->parent;
  
-       if (isa_dn_orig)
-               of_node_put(isa_dn_orig);
+       of_node_put(isa_dn_orig);
  
        /* Count number of direct PCI children of the PHB. */
        for (children = 0, tmp = dn->child; tmp; tmp = tmp->sibling)
@@@ -1251,11 -1250,10 +1250,11 @@@ static struct notifier_block iommu_mem_
        .notifier_call = iommu_mem_notifier,
  };
  
 -static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
 +static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *data)
  {
        int err = NOTIFY_OK;
 -      struct device_node *np = node;
 +      struct of_reconfig_data *rd = data;
 +      struct device_node *np = rd->dn;
        struct pci_dn *pci = PCI_DN(np);
        struct direct_window *window;
  
index ed8a90022a3d92721dbbdd7ef1485408fefb52ae,8b8fb19a4097f5080a13fb0d0508a22e41199247..e445b6701f5048f5fd7233602482b8d1a1b70237
@@@ -251,10 -251,9 +251,10 @@@ static void __init pseries_discover_pic
               " interrupt-controller\n");
  }
  
 -static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
 +static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *data)
  {
 -      struct device_node *np = node;
 +      struct of_reconfig_data *rd = data;
 +      struct device_node *np = rd->dn;
        struct pci_dn *pci = NULL;
        int err = NOTIFY_OK;
  
@@@ -500,7 -499,11 +500,11 @@@ static void __init pSeries_setup_arch(v
  
        if (firmware_has_feature(FW_FEATURE_SET_MODE)) {
                long rc;
-               if ((rc = pSeries_enable_reloc_on_exc()) != H_SUCCESS) {
+               rc = pSeries_enable_reloc_on_exc();
+               if (rc == H_P2) {
+                       pr_info("Relocation on exceptions not supported\n");
+               } else if (rc != H_SUCCESS) {
                        pr_warn("Unable to enable relocation on exceptions: "
                                "%ld\n", rc);
                }
@@@ -660,6 -663,34 +664,34 @@@ static void __init pSeries_init_early(v
        pr_debug(" <- pSeries_init_early()\n");
  }
  
+ /**
+  * pseries_power_off - tell firmware about how to power off the system.
+  *
+  * This function calls either the power-off rtas token in normal cases
+  * or the ibm,power-off-ups token (if present & requested) in case of
+  * a power failure. If power-off token is used, power on will only be
+  * possible with power button press. If ibm,power-off-ups token is used
+  * it will allow auto poweron after power is restored.
+  */
+ static void pseries_power_off(void)
+ {
+       int rc;
+       int rtas_poweroff_ups_token = rtas_token("ibm,power-off-ups");
+       if (rtas_flash_term_hook)
+               rtas_flash_term_hook(SYS_POWER_OFF);
+       if (rtas_poweron_auto == 0 ||
+               rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) {
+               rc = rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1);
+               printk(KERN_INFO "RTAS power-off returned %d\n", rc);
+       } else {
+               rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL);
+               printk(KERN_INFO "RTAS ibm,power-off-ups returned %d\n", rc);
+       }
+       for (;;);
+ }
  /*
   * Called very early, MMU is off, device-tree isn't unflattened
   */
@@@ -742,6 -773,8 +774,8 @@@ static int __init pSeries_probe(void
        else
                hpte_init_native();
  
+       pm_power_off = pseries_power_off;
        pr_debug("Machine is%s LPAR !\n",
                 (powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not");
  
@@@ -755,34 -788,6 +789,6 @@@ static int pSeries_pci_probe_mode(struc
        return PCI_PROBE_NORMAL;
  }
  
- /**
-  * pSeries_power_off - tell firmware about how to power off the system.
-  *
-  * This function calls either the power-off rtas token in normal cases
-  * or the ibm,power-off-ups token (if present & requested) in case of
-  * a power failure. If power-off token is used, power on will only be
-  * possible with power button press. If ibm,power-off-ups token is used
-  * it will allow auto poweron after power is restored.
-  */
- static void pSeries_power_off(void)
- {
-       int rc;
-       int rtas_poweroff_ups_token = rtas_token("ibm,power-off-ups");
-       if (rtas_flash_term_hook)
-               rtas_flash_term_hook(SYS_POWER_OFF);
-       if (rtas_poweron_auto == 0 ||
-               rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) {
-               rc = rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1);
-               printk(KERN_INFO "RTAS power-off returned %d\n", rc);
-       } else {
-               rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL);
-               printk(KERN_INFO "RTAS ibm,power-off-ups returned %d\n", rc);
-       }
-       for (;;);
- }
  #ifndef CONFIG_PCI
  void pSeries_final_fixup(void) { }
  #endif
@@@ -797,7 -802,6 +803,6 @@@ define_machine(pseries) 
        .pcibios_fixup          = pSeries_final_fixup,
        .pci_probe_mode         = pSeries_pci_probe_mode,
        .restart                = rtas_restart,
-       .power_off              = pSeries_power_off,
        .halt                   = rtas_halt,
        .panic                  = rtas_os_term,
        .get_boot_time          = rtas_get_boot_time,
index 7aed8d0876b78e9d63c13a6b18a1e8b3f00a0431,8f37204bf94f66b063d122f99efabf936b00dfae..d09f4fa2c3d1b41370b1e3057cf50dc3c49bab45
@@@ -13,7 -13,6 +13,6 @@@
   *
   */
  #include <linux/irq.h>
- #include <linux/bootmem.h>
  #include <linux/msi.h>
  #include <linux/pci.h>
  #include <linux/slab.h>
@@@ -82,8 -81,8 +81,8 @@@ static void fsl_msi_print_chip(struct i
  
  
  static struct irq_chip fsl_msi_chip = {
 -      .irq_mask       = mask_msi_irq,
 -      .irq_unmask     = unmask_msi_irq,
 +      .irq_mask       = pci_msi_mask_irq,
 +      .irq_unmask     = pci_msi_unmask_irq,
        .irq_ack        = fsl_msi_end_irq,
        .irq_print_chip = fsl_msi_print_chip,
  };
@@@ -242,7 -241,7 +241,7 @@@ static int fsl_setup_msi_irqs(struct pc
                irq_set_msi_desc(virq, entry);
  
                fsl_compose_msi_msg(pdev, hwirq, &msg, msi_data);
 -              write_msi_msg(virq, &msg);
 +              pci_write_msi_msg(virq, &msg);
        }
        return 0;
  
@@@ -361,7 -360,7 +360,7 @@@ static int fsl_msi_setup_hwirq(struct f
        cascade_data->virq = virt_msir;
        msi->cascade_array[irq_index] = cascade_data;
  
 -      ret = request_irq(virt_msir, fsl_msi_cascade, 0,
 +      ret = request_irq(virt_msir, fsl_msi_cascade, IRQF_NO_THREAD,
                          "fsl-msi-cascade", cascade_data);
        if (ret) {
                dev_err(&dev->dev, "failed to request_irq(%d), ret = %d\n",
index 45c114bc430b6fec08fdf5bbe2cd8b696095ed28,428de9d23120b2df54db37dab05af3fed883031a..a3f660eed6deae7d95e121bee79aa42fae463887
@@@ -16,7 -16,6 +16,6 @@@
  #undef DEBUG
  
  #include <linux/irq.h>
- #include <linux/bootmem.h>
  #include <linux/msi.h>
  #include <asm/mpic.h>
  #include <asm/prom.h>
@@@ -42,7 -41,7 +41,7 @@@ static struct mpic *msi_mpic
  static void mpic_pasemi_msi_mask_irq(struct irq_data *data)
  {
        pr_debug("mpic_pasemi_msi_mask_irq %d\n", data->irq);
 -      mask_msi_irq(data);
 +      pci_msi_mask_irq(data);
        mpic_mask_irq(data);
  }
  
@@@ -50,7 -49,7 +49,7 @@@ static void mpic_pasemi_msi_unmask_irq(
  {
        pr_debug("mpic_pasemi_msi_unmask_irq %d\n", data->irq);
        mpic_unmask_irq(data);
 -      unmask_msi_irq(data);
 +      pci_msi_unmask_irq(data);
  }
  
  static struct irq_chip mpic_pasemi_msi_chip = {
@@@ -136,7 -135,7 +135,7 @@@ static int pasemi_msi_setup_msi_irqs(st
                 * register to generate MSI [512...1023]
                 */
                msg.data = hwirq-0x200;
 -              write_msi_msg(virq, &msg);
 +              pci_write_msi_msg(virq, &msg);
        }
  
        return 0;
index 0dff1cd4448113ca0540713a24f87f45db159373,4ce8f54f234c42d4d8ab887099ce51d7cbba7e2a..b2cef18093893c9323dbea08f9aaf1ed0dab328a
@@@ -10,7 -10,6 +10,6 @@@
   */
  
  #include <linux/irq.h>
- #include <linux/bootmem.h>
  #include <linux/msi.h>
  #include <asm/mpic.h>
  #include <asm/prom.h>
@@@ -25,14 -24,14 +24,14 @@@ static struct mpic *msi_mpic
  
  static void mpic_u3msi_mask_irq(struct irq_data *data)
  {
 -      mask_msi_irq(data);
 +      pci_msi_mask_irq(data);
        mpic_mask_irq(data);
  }
  
  static void mpic_u3msi_unmask_irq(struct irq_data *data)
  {
        mpic_unmask_irq(data);
 -      unmask_msi_irq(data);
 +      pci_msi_unmask_irq(data);
  }
  
  static struct irq_chip mpic_u3msi_chip = {
@@@ -171,7 -170,7 +170,7 @@@ static int u3msi_setup_msi_irqs(struct 
                printk("u3msi: allocated virq 0x%x (hw 0x%x) addr 0x%lx\n",
                          virq, hwirq, (unsigned long)addr);
                msg.data = hwirq;
 -              write_msi_msg(virq, &msg);
 +              pci_write_msi_msg(virq, &msg);
  
                hwirq++;
        }
index 518eabbe0bdc6279733eeb6eb541c64cbddc6e60,a59f2890897a9d8013510ea0542311fbb75cfb4a..5e622c0544c4b59234d5c7e616cf32d5dd233f70
@@@ -22,7 -22,6 +22,6 @@@
   */
  
  #include <linux/irq.h>
- #include <linux/bootmem.h>
  #include <linux/pci.h>
  #include <linux/msi.h>
  #include <linux/of_platform.h>
@@@ -116,7 -115,7 +115,7 @@@ static int ppc4xx_setup_msi_irqs(struc
  
                irq_set_msi_desc(virq, entry);
                msg.data = int_no;
 -              write_msi_msg(virq, &msg);
 +              pci_write_msi_msg(virq, &msg);
        }
        return 0;
  }
diff --combined arch/powerpc/xmon/xmon.c
index c8efbb37d6e076ab123a3d5d8066f58edd36acd8,dfe3372386999683b91217f238b3ff778dd48574..5b150f0c5df94a39587ea6b519e12192d28bce3c
  #include <asm/paca.h>
  #endif
  
+ #if defined(CONFIG_PPC_SPLPAR)
+ #include <asm/plpar_wrappers.h>
+ #else
+ static inline long plapr_set_ciabr(unsigned long ciabr) {return 0; };
+ #endif
  #include "nonstdio.h"
  #include "dis-asm.h"
  
@@@ -88,10 -94,9 +94,9 @@@ struct bpt 
  };
  
  /* Bits in bpt.enabled */
- #define BP_IABR_TE    1               /* IABR translation enabled */
- #define BP_IABR               2
- #define BP_TRAP               8
- #define BP_DABR               0x10
+ #define BP_CIABR      1
+ #define BP_TRAP               2
+ #define BP_DABR               4
  
  #define NBPTS 256
  static struct bpt bpts[NBPTS];
@@@ -270,6 -275,45 +275,45 @@@ static inline void cinval(void *p
        asm volatile ("dcbi 0,%0; icbi 0,%0" : : "r" (p));
  }
  
+ /**
+  * write_ciabr() - write the CIABR SPR
+  * @ciabr:    The value to write.
+  *
+  * This function writes a value to the CIARB register either directly
+  * through mtspr instruction if the kernel is in HV privilege mode or
+  * call a hypervisor function to achieve the same in case the kernel
+  * is in supervisor privilege mode.
+  */
+ static void write_ciabr(unsigned long ciabr)
+ {
+       if (!cpu_has_feature(CPU_FTR_ARCH_207S))
+               return;
+       if (cpu_has_feature(CPU_FTR_HVMODE)) {
+               mtspr(SPRN_CIABR, ciabr);
+               return;
+       }
+       plapr_set_ciabr(ciabr);
+ }
+ /**
+  * set_ciabr() - set the CIABR
+  * @addr:     The value to set.
+  *
+  * This function sets the correct privilege value into the the HW
+  * breakpoint address before writing it up in the CIABR register.
+  */
+ static void set_ciabr(unsigned long addr)
+ {
+       addr &= ~CIABR_PRIV;
+       if (cpu_has_feature(CPU_FTR_HVMODE))
+               addr |= CIABR_PRIV_HYPER;
+       else
+               addr |= CIABR_PRIV_SUPER;
+       write_ciabr(addr);
+ }
  /*
   * Disable surveillance (the service processor watchdog function)
   * while we are in xmon.
@@@ -293,10 -337,10 +337,10 @@@ static inline void disable_surveillance
        args.token = rtas_token("set-indicator");
        if (args.token == RTAS_UNKNOWN_SERVICE)
                return;
 -      args.nargs = 3;
 -      args.nret = 1;
 +      args.nargs = cpu_to_be32(3);
 +      args.nret = cpu_to_be32(1);
        args.rets = &args.args[3];
 -      args.args[0] = SURVEILLANCE_TOKEN;
 +      args.args[0] = cpu_to_be32(SURVEILLANCE_TOKEN);
        args.args[1] = 0;
        args.args[2] = 0;
        enter_rtas(__pa(&args));
@@@ -727,7 -771,7 +771,7 @@@ static void insert_bpts(void
  
        bp = bpts;
        for (i = 0; i < NBPTS; ++i, ++bp) {
-               if ((bp->enabled & (BP_TRAP|BP_IABR)) == 0)
+               if ((bp->enabled & (BP_TRAP|BP_CIABR)) == 0)
                        continue;
                if (mread(bp->address, &bp->instr[0], 4) != 4) {
                        printf("Couldn't read instruction at %lx, "
                        continue;
                }
                store_inst(&bp->instr[0]);
-               if (bp->enabled & BP_IABR)
+               if (bp->enabled & BP_CIABR)
                        continue;
                if (mwrite(bp->address, &bpinstr, 4) != 4) {
                        printf("Couldn't write instruction at %lx, "
@@@ -764,9 -808,9 +808,9 @@@ static void insert_cpu_bpts(void
                brk.len = 8;
                __set_breakpoint(&brk);
        }
-       if (iabr && cpu_has_feature(CPU_FTR_IABR))
-               mtspr(SPRN_IABR, iabr->address
-                        | (iabr->enabled & (BP_IABR|BP_IABR_TE)));
+       if (iabr)
+               set_ciabr(iabr->address);
  }
  
  static void remove_bpts(void)
  
        bp = bpts;
        for (i = 0; i < NBPTS; ++i, ++bp) {
-               if ((bp->enabled & (BP_TRAP|BP_IABR)) != BP_TRAP)
+               if ((bp->enabled & (BP_TRAP|BP_CIABR)) != BP_TRAP)
                        continue;
                if (mread(bp->address, &instr, 4) == 4
                    && instr == bpinstr
  static void remove_cpu_bpts(void)
  {
        hw_breakpoint_disable();
-       if (cpu_has_feature(CPU_FTR_IABR))
-               mtspr(SPRN_IABR, 0);
+       write_ciabr(0);
  }
  
  /* Command interpreting routine */
@@@ -907,7 -950,7 +950,7 @@@ cmds(struct pt_regs *excp
                case 'u':
                        dump_segments();
                        break;
- #elif defined(CONFIG_4xx)
+ #elif defined(CONFIG_44x)
                case 'u':
                        dump_tlb_44x();
                        break;
@@@ -981,7 -1024,8 +1024,8 @@@ static void bootcmds(void
        else if (cmd == 'h')
                ppc_md.halt();
        else if (cmd == 'p')
-               ppc_md.power_off();
+               if (pm_power_off)
+                       pm_power_off();
  }
  
  static int cpu_cmd(void)
@@@ -1127,7 -1171,7 +1171,7 @@@ static char *breakpoint_help_string 
      "b <addr> [cnt]   set breakpoint at given instr addr\n"
      "bc               clear all breakpoints\n"
      "bc <n/addr>      clear breakpoint number n or at addr\n"
-     "bi <addr> [cnt]  set hardware instr breakpoint (POWER3/RS64 only)\n"
+     "bi <addr> [cnt]  set hardware instr breakpoint (POWER8 only)\n"
      "bd <addr> [cnt]  set hardware data breakpoint\n"
      "";
  
@@@ -1166,13 -1210,13 +1210,13 @@@ bpt_cmds(void
                break;
  
        case 'i':       /* bi - hardware instr breakpoint */
-               if (!cpu_has_feature(CPU_FTR_IABR)) {
+               if (!cpu_has_feature(CPU_FTR_ARCH_207S)) {
                        printf("Hardware instruction breakpoint "
                               "not supported on this cpu\n");
                        break;
                }
                if (iabr) {
-                       iabr->enabled &= ~(BP_IABR | BP_IABR_TE);
+                       iabr->enabled &= ~BP_CIABR;
                        iabr = NULL;
                }
                if (!scanhex(&a))
                        break;
                bp = new_breakpoint(a);
                if (bp != NULL) {
-                       bp->enabled |= BP_IABR | BP_IABR_TE;
+                       bp->enabled |= BP_CIABR;
                        iabr = bp;
                }
                break;
                                if (!bp->enabled)
                                        continue;
                                printf("%2x %s   ", BP_NUM(bp),
-                                   (bp->enabled & BP_IABR)? "inst": "trap");
+                                   (bp->enabled & BP_CIABR) ? "inst": "trap");
                                xmon_print_symbol(bp->address, "  ", "\n");
                        }
                        break;
diff --combined drivers/rtc/Kconfig
index 4511ddc1ac31b2ed1a0c0c9a5d60bf40bcd7d53c,c8f0ec7464ce5255b128912d49734d12f31352bc..f15cddfeb8971d4d466ace178fec6bc61eb9a086
@@@ -192,14 -192,6 +192,14 @@@ config RTC_DRV_DS137
          This driver can also be built as a module. If so, the module
          will be called rtc-ds1374.
  
 +config RTC_DRV_DS1374_WDT
 +      bool "Dallas/Maxim DS1374 watchdog timer"
 +      depends on RTC_DRV_DS1374
 +      help
 +        If you say Y here you will get support for the
 +        watchdog timer in the Dallas Semiconductor DS1374
 +        real-time clock chips.
 +
  config RTC_DRV_DS1672
        tristate "Dallas/Maxim DS1672"
        help
@@@ -987,6 -979,17 +987,17 @@@ config RTC_DRV_NUC90
          If you say yes here you get support for the RTC subsystem of the
          NUC910/NUC920 used in embedded systems.
  
+ config RTC_DRV_OPAL
+       tristate "IBM OPAL RTC driver"
+       depends on PPC_POWERNV
+       default y
+       help
+         If you say yes here you get support for the PowerNV platform RTC
+         driver based on OPAL interfaces.
+         This driver can also be built as a module. If so, the module
+         will be called rtc-opal.
  comment "on-CPU RTC drivers"
  
  config RTC_DRV_DAVINCI
@@@ -1117,42 -1120,36 +1128,42 @@@ config RTC_DRV_AT91RM920
          this is powered by the backup power supply.
  
  config RTC_DRV_AT91SAM9
 -      tristate "AT91SAM9x/AT91CAP9 RTT as RTC"
 -      depends on ARCH_AT91 && !(ARCH_AT91RM9200 || ARCH_AT91X40)
 +      tristate "AT91SAM9 RTT as RTC"
 +      depends on ARCH_AT91
 +      select MFD_SYSCON
        help
 -        RTC driver for the Atmel AT91SAM9x and AT91CAP9 internal RTT
 -        (Real Time Timer). These timers are powered by the backup power
 -        supply (such as a small coin cell battery), but do not need to
 -        be used as RTCs.
 -
 -        (On AT91SAM9rl and AT91SAM9G45 chips you probably want to use the
 -        dedicated RTC module and leave the RTT available for other uses.)
 +        Some AT91SAM9 SoCs provide an RTT (Real Time Timer) block which
 +        can be used as an RTC thanks to the backup power supply (e.g. a
 +        small coin cell battery) which keeps this block and the GPBR
 +        (General Purpose Backup Registers) block powered when the device
 +        is shutdown.
 +        Some AT91SAM9 SoCs provide a real RTC block, on those ones you'd
 +        probably want to use the real RTC block instead of the "RTT as an
 +        RTC" driver.
  
  config RTC_DRV_AT91SAM9_RTT
        int
        range 0 1
        default 0
 -      prompt "RTT module Number" if ARCH_AT91SAM9263
        depends on RTC_DRV_AT91SAM9
        help
 +        This option is only relevant for legacy board support and
 +        won't be used when booting a DT board.
 +
          More than one RTT module is available. You can choose which
          one will be used as an RTC. The default of zero is normally
          OK to use, though some systems use that for non-RTC purposes.
  
  config RTC_DRV_AT91SAM9_GPBR
        int
 -      range 0 3 if !ARCH_AT91SAM9263
 -      range 0 15 if ARCH_AT91SAM9263
 +      range 0 3
        default 0
        prompt "Backup Register Number"
        depends on RTC_DRV_AT91SAM9
        help
 +        This option is only relevant for legacy board support and
 +        won't be used when booting a DT board.
 +
          The RTC driver needs to use one of the General Purpose Backup
          Registers (GPBRs) as well as the RTT. You can choose which one
          will be used. The default of zero is normally OK to use, but
diff --combined include/linux/hugetlb.h
index cdd149ca5cc050029770cc8fee6477de3a7ff0c3,e6b62f30ab217ea30338c2bd58c5d52264c90c91..431b7fc605c9bccff38613418dce7b74d3a86d95
@@@ -175,6 -175,52 +175,52 @@@ static inline void __unmap_hugepage_ran
  }
  
  #endif /* !CONFIG_HUGETLB_PAGE */
+ /*
+  * hugepages at page global directory. If arch support
+  * hugepages at pgd level, they need to define this.
+  */
+ #ifndef pgd_huge
+ #define pgd_huge(x)   0
+ #endif
+ #ifndef pgd_write
+ static inline int pgd_write(pgd_t pgd)
+ {
+       BUG();
+       return 0;
+ }
+ #endif
+ #ifndef pud_write
+ static inline int pud_write(pud_t pud)
+ {
+       BUG();
+       return 0;
+ }
+ #endif
+ #ifndef is_hugepd
+ /*
+  * Some architectures requires a hugepage directory format that is
+  * required to support multiple hugepage sizes. For example
+  * a4fe3ce76 "powerpc/mm: Allow more flexible layouts for hugepage pagetables"
+  * introduced the same on powerpc. This allows for a more flexible hugepage
+  * pagetable layout.
+  */
+ typedef struct { unsigned long pd; } hugepd_t;
+ #define is_hugepd(hugepd) (0)
+ #define __hugepd(x) ((hugepd_t) { (x) })
+ static inline int gup_huge_pd(hugepd_t hugepd, unsigned long addr,
+                             unsigned pdshift, unsigned long end,
+                             int write, struct page **pages, int *nr)
+ {
+       return 0;
+ }
+ #else
+ extern int gup_huge_pd(hugepd_t hugepd, unsigned long addr,
+                      unsigned pdshift, unsigned long end,
+                      int write, struct page **pages, int *nr);
+ #endif
  
  #define HUGETLB_ANON_FILE "anon_hugepage"
  
@@@ -311,8 -357,7 +357,8 @@@ static inline struct hstate *hstate_siz
  {
        if (!page_size_log)
                return &default_hstate;
 -      return size_to_hstate(1 << page_size_log);
 +
 +      return size_to_hstate(1UL << page_size_log);
  }
  
  static inline struct hstate *hstate_vma(struct vm_area_struct *vma)