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

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

Pull powerpc fixes from Michael Ellerman:
"A minor fix to our IMC PMU code to print a less confusing error
message when the driver can't initialise properly.

A fix for a bug where a user requesting an unsupported branch sampling
filter can corrupt PMU state, preventing the PMU from counting
properly.

And finally a fix for a bug in our support for kexec_file_load(),
which prevented loading a kernel and initramfs. Most versions of kexec
don't yet use kexec_file_load().

Thanks to: Anju T Sudhakar, Dave Young, Madhavan Srinivasan, Ravi
Bangoria, Thiago Jung Bauermann"

* tag 'powerpc-5.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/kexec: Fix loading of kernel + initramfs with kexec_file_load()
powerpc/perf: Fix MMCRA corruption by bhrb_filter
powerpc/powernv: Return for invalid IMC domain

+19 -3
+5 -1
arch/powerpc/kernel/kexec_elf_64.c
··· 547 547 kbuf.memsz = phdr->p_memsz; 548 548 kbuf.buf_align = phdr->p_align; 549 549 kbuf.buf_min = phdr->p_paddr + base; 550 + kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; 550 551 ret = kexec_add_buffer(&kbuf); 551 552 if (ret) 552 553 goto out; ··· 582 581 struct kexec_buf kbuf = { .image = image, .buf_min = 0, 583 582 .buf_max = ppc64_rma_size }; 584 583 struct kexec_buf pbuf = { .image = image, .buf_min = 0, 585 - .buf_max = ppc64_rma_size, .top_down = true }; 584 + .buf_max = ppc64_rma_size, .top_down = true, 585 + .mem = KEXEC_BUF_MEM_UNKNOWN }; 586 586 587 587 ret = build_elf_exec_info(kernel_buf, kernel_len, &ehdr, &elf_info); 588 588 if (ret) ··· 608 606 kbuf.bufsz = kbuf.memsz = initrd_len; 609 607 kbuf.buf_align = PAGE_SIZE; 610 608 kbuf.top_down = false; 609 + kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; 611 610 ret = kexec_add_buffer(&kbuf); 612 611 if (ret) 613 612 goto out; ··· 641 638 kbuf.bufsz = kbuf.memsz = fdt_size; 642 639 kbuf.buf_align = PAGE_SIZE; 643 640 kbuf.top_down = true; 641 + kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; 644 642 ret = kexec_add_buffer(&kbuf); 645 643 if (ret) 646 644 goto out;
+4 -2
arch/powerpc/perf/core-book3s.c
··· 1846 1846 int n; 1847 1847 int err; 1848 1848 struct cpu_hw_events *cpuhw; 1849 + u64 bhrb_filter; 1849 1850 1850 1851 if (!ppmu) 1851 1852 return -ENOENT; ··· 1952 1951 err = power_check_constraints(cpuhw, events, cflags, n + 1); 1953 1952 1954 1953 if (has_branch_stack(event)) { 1955 - cpuhw->bhrb_filter = ppmu->bhrb_filter_map( 1954 + bhrb_filter = ppmu->bhrb_filter_map( 1956 1955 event->attr.branch_sample_type); 1957 1956 1958 - if (cpuhw->bhrb_filter == -1) { 1957 + if (bhrb_filter == -1) { 1959 1958 put_cpu_var(cpu_hw_events); 1960 1959 return -EOPNOTSUPP; 1961 1960 } 1961 + cpuhw->bhrb_filter = bhrb_filter; 1962 1962 } 1963 1963 1964 1964 put_cpu_var(cpu_hw_events);
+3
arch/powerpc/perf/power8-pmu.c
··· 25 25 #define POWER8_MMCRA_IFM1 0x0000000040000000UL 26 26 #define POWER8_MMCRA_IFM2 0x0000000080000000UL 27 27 #define POWER8_MMCRA_IFM3 0x00000000C0000000UL 28 + #define POWER8_MMCRA_BHRB_MASK 0x00000000C0000000UL 28 29 29 30 /* 30 31 * Raw event encoding for PowerISA v2.07 (Power8): ··· 240 239 241 240 static void power8_config_bhrb(u64 pmu_bhrb_filter) 242 241 { 242 + pmu_bhrb_filter &= POWER8_MMCRA_BHRB_MASK; 243 + 243 244 /* Enable BHRB filter in PMU */ 244 245 mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter)); 245 246 }
+3
arch/powerpc/perf/power9-pmu.c
··· 88 88 #define POWER9_MMCRA_IFM1 0x0000000040000000UL 89 89 #define POWER9_MMCRA_IFM2 0x0000000080000000UL 90 90 #define POWER9_MMCRA_IFM3 0x00000000C0000000UL 91 + #define POWER9_MMCRA_BHRB_MASK 0x00000000C0000000UL 91 92 92 93 /* Nasty Power9 specific hack */ 93 94 #define PVR_POWER9_CUMULUS 0x00002000 ··· 297 296 298 297 static void power9_config_bhrb(u64 pmu_bhrb_filter) 299 298 { 299 + pmu_bhrb_filter &= POWER9_MMCRA_BHRB_MASK; 300 + 300 301 /* Enable BHRB filter in PMU */ 301 302 mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter)); 302 303 }
+4
arch/powerpc/platforms/powernv/opal-imc.c
··· 157 157 struct imc_pmu *pmu_ptr; 158 158 u32 offset; 159 159 160 + /* Return for unknown domain */ 161 + if (domain < 0) 162 + return -EINVAL; 163 + 160 164 /* memory for pmu */ 161 165 pmu_ptr = kzalloc(sizeof(*pmu_ptr), GFP_KERNEL); 162 166 if (!pmu_ptr)