Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-4.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
- Fix build error on 32-bit with checkpoint restart from Aneesh Kumar
- Fix dedotify for binutils >= 2.26 from Andreas Schwab
- Don't trace hcalls on offline CPUs from Denis Kirjanov
- eeh: Fix stale cached primary bus from Gavin Shan
- eeh: Fix stale PE primary bus from Gavin Shan
- mm: Fix Multi hit ERAT cause by recent THP update from Aneesh Kumar K.V
- ioda: Set "read" permission when "write" is set from Alexey Kardashevskiy

* tag 'powerpc-4.5-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/ioda: Set "read" permission when "write" is set
powerpc/mm: Fix Multi hit ERAT cause by recent THP update
powerpc/powernv: Fix stale PE primary bus
powerpc/eeh: Fix stale cached primary bus
powerpc/pseries: Don't trace hcalls on offline CPUs
powerpc: Fix dedotify for binutils >= 2.26
powerpc/book3s_32: Fix build error with checkpoint restart

+91 -7
+2 -2
arch/powerpc/Kconfig
··· 557 557 558 558 config PPC_4K_PAGES 559 559 bool "4k page size" 560 - select HAVE_ARCH_SOFT_DIRTY if CHECKPOINT_RESTORE && PPC_BOOK3S 560 + select HAVE_ARCH_SOFT_DIRTY if PPC_BOOK3S_64 561 561 562 562 config PPC_16K_PAGES 563 563 bool "16k page size" ··· 566 566 config PPC_64K_PAGES 567 567 bool "64k page size" 568 568 depends on !PPC_FSL_BOOK3E && (44x || PPC_STD_MMU_64 || PPC_BOOK3E_64) 569 - select HAVE_ARCH_SOFT_DIRTY if CHECKPOINT_RESTORE && PPC_BOOK3S 569 + select HAVE_ARCH_SOFT_DIRTY if PPC_BOOK3S_64 570 570 571 571 config PPC_256K_PAGES 572 572 bool "256k page size"
+4
arch/powerpc/include/asm/book3s/64/pgtable.h
··· 281 281 extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, 282 282 pmd_t *pmdp); 283 283 284 + #define __HAVE_ARCH_PMDP_HUGE_SPLIT_PREPARE 285 + extern void pmdp_huge_split_prepare(struct vm_area_struct *vma, 286 + unsigned long address, pmd_t *pmdp); 287 + 284 288 #define pmd_move_must_withdraw pmd_move_must_withdraw 285 289 struct spinlock; 286 290 static inline int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl,
+1
arch/powerpc/include/asm/eeh.h
··· 81 81 #define EEH_PE_KEEP (1 << 8) /* Keep PE on hotplug */ 82 82 #define EEH_PE_CFG_RESTRICTED (1 << 9) /* Block config on error */ 83 83 #define EEH_PE_REMOVED (1 << 10) /* Removed permanently */ 84 + #define EEH_PE_PRI_BUS (1 << 11) /* Cached primary bus */ 84 85 85 86 struct eeh_pe { 86 87 int type; /* PE type: PHB/Bus/Device */
+6 -2
arch/powerpc/include/asm/trace.h
··· 57 57 extern void hcall_tracepoint_regfunc(void); 58 58 extern void hcall_tracepoint_unregfunc(void); 59 59 60 - TRACE_EVENT_FN(hcall_entry, 60 + TRACE_EVENT_FN_COND(hcall_entry, 61 61 62 62 TP_PROTO(unsigned long opcode, unsigned long *args), 63 63 64 64 TP_ARGS(opcode, args), 65 + 66 + TP_CONDITION(cpu_online(raw_smp_processor_id())), 65 67 66 68 TP_STRUCT__entry( 67 69 __field(unsigned long, opcode) ··· 78 76 hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc 79 77 ); 80 78 81 - TRACE_EVENT_FN(hcall_exit, 79 + TRACE_EVENT_FN_COND(hcall_exit, 82 80 83 81 TP_PROTO(unsigned long opcode, unsigned long retval, 84 82 unsigned long *retbuf), 85 83 86 84 TP_ARGS(opcode, retval, retbuf), 85 + 86 + TP_CONDITION(cpu_online(raw_smp_processor_id())), 87 87 88 88 TP_STRUCT__entry( 89 89 __field(unsigned long, opcode)
+3
arch/powerpc/kernel/eeh_driver.c
··· 564 564 */ 565 565 eeh_pe_state_mark(pe, EEH_PE_KEEP); 566 566 if (bus) { 567 + eeh_pe_state_clear(pe, EEH_PE_PRI_BUS); 567 568 pci_lock_rescan_remove(); 568 569 pcibios_remove_pci_devices(bus); 569 570 pci_unlock_rescan_remove(); ··· 804 803 * the their PCI config any more. 805 804 */ 806 805 if (frozen_bus) { 806 + eeh_pe_state_clear(pe, EEH_PE_PRI_BUS); 807 807 eeh_pe_dev_mode_mark(pe, EEH_DEV_REMOVED); 808 808 809 809 pci_lock_rescan_remove(); ··· 888 886 continue; 889 887 890 888 /* Notify all devices to be down */ 889 + eeh_pe_state_clear(pe, EEH_PE_PRI_BUS); 891 890 bus = eeh_pe_bus_get(phb_pe); 892 891 eeh_pe_dev_traverse(pe, 893 892 eeh_report_failure, NULL);
+1 -1
arch/powerpc/kernel/eeh_pe.c
··· 928 928 bus = pe->phb->bus; 929 929 } else if (pe->type & EEH_PE_BUS || 930 930 pe->type & EEH_PE_DEVICE) { 931 - if (pe->bus) { 931 + if (pe->state & EEH_PE_PRI_BUS) { 932 932 bus = pe->bus; 933 933 goto out; 934 934 }
+1 -1
arch/powerpc/kernel/module_64.c
··· 340 340 if (name[0] == '.') { 341 341 if (strcmp(name+1, "TOC.") == 0) 342 342 syms[i].st_shndx = SHN_ABS; 343 - memmove(name, name+1, strlen(name)); 343 + syms[i].st_name++; 344 344 } 345 345 } 346 346 }
+32
arch/powerpc/mm/pgtable_64.c
··· 646 646 return pgtable; 647 647 } 648 648 649 + void pmdp_huge_split_prepare(struct vm_area_struct *vma, 650 + unsigned long address, pmd_t *pmdp) 651 + { 652 + VM_BUG_ON(address & ~HPAGE_PMD_MASK); 653 + VM_BUG_ON(REGION_ID(address) != USER_REGION_ID); 654 + 655 + /* 656 + * We can't mark the pmd none here, because that will cause a race 657 + * against exit_mmap. We need to continue mark pmd TRANS HUGE, while 658 + * we spilt, but at the same time we wan't rest of the ppc64 code 659 + * not to insert hash pte on this, because we will be modifying 660 + * the deposited pgtable in the caller of this function. Hence 661 + * clear the _PAGE_USER so that we move the fault handling to 662 + * higher level function and that will serialize against ptl. 663 + * We need to flush existing hash pte entries here even though, 664 + * the translation is still valid, because we will withdraw 665 + * pgtable_t after this. 666 + */ 667 + pmd_hugepage_update(vma->vm_mm, address, pmdp, _PAGE_USER, 0); 668 + } 669 + 670 + 649 671 /* 650 672 * set a new huge pmd. We should not be called for updating 651 673 * an existing pmd entry. That should go via pmd_hugepage_update. ··· 685 663 return set_pte_at(mm, addr, pmdp_ptep(pmdp), pmd_pte(pmd)); 686 664 } 687 665 666 + /* 667 + * We use this to invalidate a pmdp entry before switching from a 668 + * hugepte to regular pmd entry. 669 + */ 688 670 void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, 689 671 pmd_t *pmdp) 690 672 { 691 673 pmd_hugepage_update(vma->vm_mm, address, pmdp, _PAGE_PRESENT, 0); 674 + 675 + /* 676 + * This ensures that generic code that rely on IRQ disabling 677 + * to prevent a parallel THP split work as expected. 678 + */ 679 + kick_all_cpus_sync(); 692 680 } 693 681 694 682 /*
+4 -1
arch/powerpc/platforms/powernv/eeh-powernv.c
··· 444 444 * PCI devices of the PE are expected to be removed prior 445 445 * to PE reset. 446 446 */ 447 - if (!edev->pe->bus) 447 + if (!(edev->pe->state & EEH_PE_PRI_BUS)) { 448 448 edev->pe->bus = pci_find_bus(hose->global_number, 449 449 pdn->busno); 450 + if (edev->pe->bus) 451 + edev->pe->state |= EEH_PE_PRI_BUS; 452 + } 450 453 451 454 /* 452 455 * Enable EEH explicitly so that we will do EEH check
+1
arch/powerpc/platforms/powernv/pci-ioda.c
··· 3180 3180 3181 3181 static const struct pci_controller_ops pnv_pci_ioda_controller_ops = { 3182 3182 .dma_dev_setup = pnv_pci_dma_dev_setup, 3183 + .dma_bus_setup = pnv_pci_dma_bus_setup, 3183 3184 #ifdef CONFIG_PCI_MSI 3184 3185 .setup_msi_irqs = pnv_setup_msi_irqs, 3185 3186 .teardown_msi_irqs = pnv_teardown_msi_irqs,
+26
arch/powerpc/platforms/powernv/pci.c
··· 599 599 u64 rpn = __pa(uaddr) >> tbl->it_page_shift; 600 600 long i; 601 601 602 + if (proto_tce & TCE_PCI_WRITE) 603 + proto_tce |= TCE_PCI_READ; 604 + 602 605 for (i = 0; i < npages; i++) { 603 606 unsigned long newtce = proto_tce | 604 607 ((rpn + i) << tbl->it_page_shift); ··· 622 619 unsigned long idx = index - tbl->it_offset; 623 620 624 621 BUG_ON(*hpa & ~IOMMU_PAGE_MASK(tbl)); 622 + 623 + if (newtce & TCE_PCI_WRITE) 624 + newtce |= TCE_PCI_READ; 625 625 626 626 oldtce = xchg(pnv_tce(tbl, idx), cpu_to_be64(newtce)); 627 627 *hpa = be64_to_cpu(oldtce) & ~(TCE_PCI_READ | TCE_PCI_WRITE); ··· 764 758 765 759 if (phb && phb->dma_dev_setup) 766 760 phb->dma_dev_setup(phb, pdev); 761 + } 762 + 763 + void pnv_pci_dma_bus_setup(struct pci_bus *bus) 764 + { 765 + struct pci_controller *hose = bus->sysdata; 766 + struct pnv_phb *phb = hose->private_data; 767 + struct pnv_ioda_pe *pe; 768 + 769 + list_for_each_entry(pe, &phb->ioda.pe_list, list) { 770 + if (!(pe->flags & (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL))) 771 + continue; 772 + 773 + if (!pe->pbus) 774 + continue; 775 + 776 + if (bus->number == ((pe->rid >> 8) & 0xFF)) { 777 + pe->pbus = bus; 778 + break; 779 + } 780 + } 767 781 } 768 782 769 783 void pnv_pci_shutdown(void)
+1
arch/powerpc/platforms/powernv/pci.h
··· 242 242 extern int pnv_eeh_phb_reset(struct pci_controller *hose, int option); 243 243 244 244 extern void pnv_pci_dma_dev_setup(struct pci_dev *pdev); 245 + extern void pnv_pci_dma_bus_setup(struct pci_bus *bus); 245 246 extern int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type); 246 247 extern void pnv_teardown_msi_irqs(struct pci_dev *pdev); 247 248
+8
include/asm-generic/pgtable.h
··· 239 239 pmd_t *pmdp); 240 240 #endif 241 241 242 + #ifndef __HAVE_ARCH_PMDP_HUGE_SPLIT_PREPARE 243 + static inline void pmdp_huge_split_prepare(struct vm_area_struct *vma, 244 + unsigned long address, pmd_t *pmdp) 245 + { 246 + 247 + } 248 + #endif 249 + 242 250 #ifndef __HAVE_ARCH_PTE_SAME 243 251 static inline int pte_same(pte_t pte_a, pte_t pte_b) 244 252 {
+1
mm/huge_memory.c
··· 2861 2861 young = pmd_young(*pmd); 2862 2862 dirty = pmd_dirty(*pmd); 2863 2863 2864 + pmdp_huge_split_prepare(vma, haddr, pmd); 2864 2865 pgtable = pgtable_trans_huge_withdraw(mm, pmd); 2865 2866 pmd_populate(mm, &_pmd, pgtable); 2866 2867