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.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

- Fix crashes when loading modules built with a different
CONFIG_RELOCATABLE value by adding CONFIG_RELOCATABLE to vermagic.

- Fix busy loops in the OPAL NVRAM driver if we get certain error
conditions from firmware.

- Remove tlbie trace points from KVM code that's called in real mode,
because it causes crashes.

- Fix checkstops caused by invalid tlbiel on Power9 Radix.

- Ensure the set of CPU features we "know" are always enabled is
actually the minimal set when we build with support for firmware
supplied CPU features.

Thanks to: Aneesh Kumar K.V, Anshuman Khandual, Nicholas Piggin.

* tag 'powerpc-4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/64s: Fix CPU_FTRS_ALWAYS vs DT CPU features
powerpc/mm/radix: Fix checkstops caused by invalid tlbiel
KVM: PPC: Book3S HV: trace_tlbie must not be called in realmode
powerpc/8xx: Fix build with hugetlbfs enabled
powerpc/powernv: Fix OPAL NVRAM driver OPAL_BUSY loops
powerpc/powernv: define a standard delay for OPAL_BUSY type retry loops
powerpc/fscr: Enable interrupts earlier before calling get_user()
powerpc/64s: Fix section mismatch warnings from setup_rfi_flush()
powerpc/modules: Fix crashes by adding CONFIG_RELOCATABLE to vermagic

+63 -40
+21 -2
arch/powerpc/include/asm/cputable.h
··· 545 545 #ifdef CONFIG_PPC_BOOK3E 546 546 #define CPU_FTRS_ALWAYS (CPU_FTRS_E6500 & CPU_FTRS_E5500) 547 547 #else 548 + 549 + #ifdef CONFIG_PPC_DT_CPU_FTRS 550 + #define CPU_FTRS_DT_CPU_BASE \ 551 + (CPU_FTR_LWSYNC | \ 552 + CPU_FTR_FPU_UNAVAILABLE | \ 553 + CPU_FTR_NODSISRALIGN | \ 554 + CPU_FTR_NOEXECUTE | \ 555 + CPU_FTR_COHERENT_ICACHE | \ 556 + CPU_FTR_STCX_CHECKS_ADDRESS | \ 557 + CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ 558 + CPU_FTR_DAWR | \ 559 + CPU_FTR_ARCH_206 | \ 560 + CPU_FTR_ARCH_207S) 561 + #else 562 + #define CPU_FTRS_DT_CPU_BASE (~0ul) 563 + #endif 564 + 548 565 #ifdef CONFIG_CPU_LITTLE_ENDIAN 549 566 #define CPU_FTRS_ALWAYS \ 550 567 (CPU_FTRS_POSSIBLE & ~CPU_FTR_HVMODE & CPU_FTRS_POWER7 & \ 551 568 CPU_FTRS_POWER8E & CPU_FTRS_POWER8 & CPU_FTRS_POWER8_DD1 & \ 552 - CPU_FTRS_POWER9 & CPU_FTRS_POWER9_DD1 & CPU_FTRS_POWER9_DD2_1) 569 + CPU_FTRS_POWER9 & CPU_FTRS_POWER9_DD1 & CPU_FTRS_POWER9_DD2_1 & \ 570 + CPU_FTRS_DT_CPU_BASE) 553 571 #else 554 572 #define CPU_FTRS_ALWAYS \ 555 573 (CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & \ 556 574 CPU_FTRS_POWER6 & CPU_FTRS_POWER7 & CPU_FTRS_CELL & \ 557 575 CPU_FTRS_PA6T & CPU_FTRS_POWER8 & CPU_FTRS_POWER8E & \ 558 576 CPU_FTRS_POWER8_DD1 & ~CPU_FTR_HVMODE & CPU_FTRS_POSSIBLE & \ 559 - CPU_FTRS_POWER9 & CPU_FTRS_POWER9_DD1 & CPU_FTRS_POWER9_DD2_1) 577 + CPU_FTRS_POWER9 & CPU_FTRS_POWER9_DD1 & CPU_FTRS_POWER9_DD2_1 & \ 578 + CPU_FTRS_DT_CPU_BASE) 560 579 #endif /* CONFIG_CPU_LITTLE_ENDIAN */ 561 580 #endif 562 581 #else
+11 -1
arch/powerpc/include/asm/module.h
··· 15 15 16 16 17 17 #ifdef CC_USING_MPROFILE_KERNEL 18 - #define MODULE_ARCH_VERMAGIC "mprofile-kernel" 18 + #define MODULE_ARCH_VERMAGIC_FTRACE "mprofile-kernel " 19 + #else 20 + #define MODULE_ARCH_VERMAGIC_FTRACE "" 19 21 #endif 22 + 23 + #ifdef CONFIG_RELOCATABLE 24 + #define MODULE_ARCH_VERMAGIC_RELOCATABLE "relocatable " 25 + #else 26 + #define MODULE_ARCH_VERMAGIC_RELOCATABLE "" 27 + #endif 28 + 29 + #define MODULE_ARCH_VERMAGIC MODULE_ARCH_VERMAGIC_FTRACE MODULE_ARCH_VERMAGIC_RELOCATABLE 20 30 21 31 #ifndef __powerpc64__ 22 32 /*
+3
arch/powerpc/include/asm/opal.h
··· 21 21 /* We calculate number of sg entries based on PAGE_SIZE */ 22 22 #define SG_ENTRIES_PER_NODE ((PAGE_SIZE - 16) / sizeof(struct opal_sg_entry)) 23 23 24 + /* Default time to sleep or delay between OPAL_BUSY/OPAL_BUSY_EVENT loops */ 25 + #define OPAL_BUSY_DELAY_MS 10 26 + 24 27 /* /sys/firmware/opal */ 25 28 extern struct kobject *opal_kobj; 26 29
+1 -13
arch/powerpc/kernel/dt_cpu_ftrs.c
··· 53 53 int disabled; 54 54 }; 55 55 56 - #define CPU_FTRS_BASE \ 57 - (CPU_FTR_LWSYNC | \ 58 - CPU_FTR_FPU_UNAVAILABLE |\ 59 - CPU_FTR_NODSISRALIGN |\ 60 - CPU_FTR_NOEXECUTE |\ 61 - CPU_FTR_COHERENT_ICACHE | \ 62 - CPU_FTR_STCX_CHECKS_ADDRESS |\ 63 - CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ 64 - CPU_FTR_DAWR | \ 65 - CPU_FTR_ARCH_206 |\ 66 - CPU_FTR_ARCH_207S) 67 - 68 56 #define MMU_FTRS_HASH_BASE (MMU_FTRS_POWER8) 69 57 70 58 #define COMMON_USER_BASE (PPC_FEATURE_32 | PPC_FEATURE_64 | \ ··· 112 124 113 125 static struct cpu_spec __initdata base_cpu_spec = { 114 126 .cpu_name = NULL, 115 - .cpu_features = CPU_FTRS_BASE, 127 + .cpu_features = CPU_FTRS_DT_CPU_BASE, 116 128 .cpu_user_features = COMMON_USER_BASE, 117 129 .cpu_user_features2 = COMMON_USER2_BASE, 118 130 .mmu_features = 0,
+1 -1
arch/powerpc/kernel/setup_64.c
··· 880 880 rfi_flush = enable; 881 881 } 882 882 883 - static void init_fallback_flush(void) 883 + static void __ref init_fallback_flush(void) 884 884 { 885 885 u64 l1d_size, limit; 886 886 int cpu;
+17 -15
arch/powerpc/kernel/traps.c
··· 1613 1613 value = mfspr(SPRN_FSCR); 1614 1614 1615 1615 status = value >> 56; 1616 + if ((hv || status >= 2) && 1617 + (status < ARRAY_SIZE(facility_strings)) && 1618 + facility_strings[status]) 1619 + facility = facility_strings[status]; 1620 + 1621 + /* We should not have taken this interrupt in kernel */ 1622 + if (!user_mode(regs)) { 1623 + pr_emerg("Facility '%s' unavailable (%d) exception in kernel mode at %lx\n", 1624 + facility, status, regs->nip); 1625 + die("Unexpected facility unavailable exception", regs, SIGABRT); 1626 + } 1627 + 1628 + /* We restore the interrupt state now */ 1629 + if (!arch_irq_disabled_regs(regs)) 1630 + local_irq_enable(); 1631 + 1616 1632 if (status == FSCR_DSCR_LG) { 1617 1633 /* 1618 1634 * User is accessing the DSCR register using the problem ··· 1695 1679 return; 1696 1680 } 1697 1681 1698 - if ((hv || status >= 2) && 1699 - (status < ARRAY_SIZE(facility_strings)) && 1700 - facility_strings[status]) 1701 - facility = facility_strings[status]; 1702 - 1703 - /* We restore the interrupt state now */ 1704 - if (!arch_irq_disabled_regs(regs)) 1705 - local_irq_enable(); 1706 - 1707 1682 pr_err_ratelimited("%sFacility '%s' unavailable (%d), exception at 0x%lx, MSR=%lx\n", 1708 1683 hv ? "Hypervisor " : "", facility, status, regs->nip, regs->msr); 1709 1684 1710 1685 out: 1711 - if (user_mode(regs)) { 1712 - _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); 1713 - return; 1714 - } 1715 - 1716 - die("Unexpected facility unavailable exception", regs, SIGABRT); 1686 + _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); 1717 1687 } 1718 1688 #endif 1719 1689
-4
arch/powerpc/kvm/book3s_hv_rm_mmu.c
··· 470 470 for (i = 0; i < npages; ++i) { 471 471 asm volatile(PPC_TLBIE_5(%0,%1,0,0,0) : : 472 472 "r" (rbvalues[i]), "r" (kvm->arch.lpid)); 473 - trace_tlbie(kvm->arch.lpid, 0, rbvalues[i], 474 - kvm->arch.lpid, 0, 0, 0); 475 473 } 476 474 477 475 if (cpu_has_feature(CPU_FTR_P9_TLBIE_BUG)) { ··· 490 492 for (i = 0; i < npages; ++i) { 491 493 asm volatile(PPC_TLBIEL(%0,%1,0,0,0) : : 492 494 "r" (rbvalues[i]), "r" (0)); 493 - trace_tlbie(kvm->arch.lpid, 1, rbvalues[i], 494 - 0, 0, 0, 0); 495 495 } 496 496 asm volatile("ptesync" : : : "memory"); 497 497 }
+1
arch/powerpc/mm/slice.c
··· 35 35 #include <asm/mmu.h> 36 36 #include <asm/copro.h> 37 37 #include <asm/hugetlb.h> 38 + #include <asm/mmu_context.h> 38 39 39 40 static DEFINE_SPINLOCK(slice_convert_lock); 40 41
+2 -3
arch/powerpc/mm/tlb-radix.c
··· 33 33 { 34 34 unsigned long rb; 35 35 unsigned long rs; 36 - unsigned int r = 1; /* radix format */ 37 36 38 37 rb = (set << PPC_BITLSHIFT(51)) | (is << PPC_BITLSHIFT(53)); 39 38 rs = ((unsigned long)pid << PPC_BITLSHIFT(31)); 40 39 41 - asm volatile(PPC_TLBIEL(%0, %1, %2, %3, %4) 42 - : : "r"(rb), "r"(rs), "i"(ric), "i"(prs), "r"(r) 40 + asm volatile(PPC_TLBIEL(%0, %1, %2, %3, 1) 41 + : : "r"(rb), "r"(rs), "i"(ric), "i"(prs) 43 42 : "memory"); 44 43 } 45 44
+6 -1
arch/powerpc/platforms/powernv/opal-nvram.c
··· 11 11 12 12 #define DEBUG 13 13 14 + #include <linux/delay.h> 14 15 #include <linux/kernel.h> 15 16 #include <linux/init.h> 16 17 #include <linux/of.h> ··· 57 56 58 57 while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) { 59 58 rc = opal_write_nvram(__pa(buf), count, off); 60 - if (rc == OPAL_BUSY_EVENT) 59 + if (rc == OPAL_BUSY_EVENT) { 60 + msleep(OPAL_BUSY_DELAY_MS); 61 61 opal_poll_events(NULL); 62 + } else if (rc == OPAL_BUSY) { 63 + msleep(OPAL_BUSY_DELAY_MS); 64 + } 62 65 } 63 66 64 67 if (rc)