]> Git Repo - linux.git/commitdiff
Merge tag 'powerpc-5.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
authorLinus Torvalds <[email protected]>
Sun, 2 Jun 2019 17:21:04 +0000 (10:21 -0700)
committerLinus Torvalds <[email protected]>
Sun, 2 Jun 2019 17:21:04 +0000 (10:21 -0700)
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

1  2 
arch/powerpc/perf/core-book3s.c
arch/powerpc/perf/power8-pmu.c
arch/powerpc/perf/power9-pmu.c
arch/powerpc/platforms/powernv/opal-imc.c

index 7e129f62cd675ff57d22121a3ba8c1be1a9ab1b2,2c21ff896e2c8c3bfb89e716cbf2500c2379bec7..ca92e01d0bd1b11a413949e0d526933cf0a112c0
@@@ -1,8 -1,12 +1,8 @@@
 +// SPDX-License-Identifier: GPL-2.0-or-later
  /*
   * Performance event support - powerpc architecture code
   *
   * Copyright 2008-2009 Paul Mackerras, IBM Corporation.
 - *
 - * This program is free software; you can redistribute it and/or
 - * modify it under the terms of the GNU General Public License
 - * as published by the Free Software Foundation; either version
 - * 2 of the License, or (at your option) any later version.
   */
  #include <linux/kernel.h>
  #include <linux/sched.h>
@@@ -1846,6 -1850,7 +1846,7 @@@ static int power_pmu_event_init(struct 
        int n;
        int err;
        struct cpu_hw_events *cpuhw;
+       u64 bhrb_filter;
  
        if (!ppmu)
                return -ENOENT;
        err = power_check_constraints(cpuhw, events, cflags, n + 1);
  
        if (has_branch_stack(event)) {
-               cpuhw->bhrb_filter = ppmu->bhrb_filter_map(
+               bhrb_filter = ppmu->bhrb_filter_map(
                                        event->attr.branch_sample_type);
  
-               if (cpuhw->bhrb_filter == -1) {
+               if (bhrb_filter == -1) {
                        put_cpu_var(cpu_hw_events);
                        return -EOPNOTSUPP;
                }
+               cpuhw->bhrb_filter = bhrb_filter;
        }
  
        put_cpu_var(cpu_hw_events);
index b47e9fb5e899bc28530294d52dec143ed6b4c1c8,c0eb3e2329f0eccd5ca1454ace9ef6134c7ffc98..3a5fcc20ff31695e86ac292c3d622dab70519b57
@@@ -1,9 -1,13 +1,9 @@@
 +// SPDX-License-Identifier: GPL-2.0-or-later
  /*
   * Performance counter support for POWER8 processors.
   *
   * Copyright 2009 Paul Mackerras, IBM Corporation.
   * Copyright 2013 Michael Ellerman, IBM Corporation.
 - *
 - * This program is free software; you can redistribute it and/or
 - * modify it under the terms of the GNU General Public License
 - * as published by the Free Software Foundation; either version
 - * 2 of the License, or (at your option) any later version.
   */
  
  #define pr_fmt(fmt)   "power8-pmu: " fmt
@@@ -25,6 -29,7 +25,7 @@@ enum 
  #define       POWER8_MMCRA_IFM1               0x0000000040000000UL
  #define       POWER8_MMCRA_IFM2               0x0000000080000000UL
  #define       POWER8_MMCRA_IFM3               0x00000000C0000000UL
+ #define       POWER8_MMCRA_BHRB_MASK          0x00000000C0000000UL
  
  /*
   * Raw event encoding for PowerISA v2.07 (Power8):
@@@ -239,6 -244,8 +240,8 @@@ static u64 power8_bhrb_filter_map(u64 b
  
  static void power8_config_bhrb(u64 pmu_bhrb_filter)
  {
+       pmu_bhrb_filter &= POWER8_MMCRA_BHRB_MASK;
        /* Enable BHRB filter in PMU */
        mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter));
  }
index 738ed26c538d733fb17cab0045c07e17403effdc,e19c492bd6ecb7dc03ed8ec01142ff77d365340d..08c3ef7961982606a38d8e9508784c625e4df720
@@@ -1,10 -1,14 +1,10 @@@
 +// SPDX-License-Identifier: GPL-2.0-or-later
  /*
   * Performance counter support for POWER9 processors.
   *
   * Copyright 2009 Paul Mackerras, IBM Corporation.
   * Copyright 2013 Michael Ellerman, IBM Corporation.
   * Copyright 2016 Madhavan Srinivasan, IBM Corporation.
 - *
 - * This program is free software; you can redistribute it and/or
 - * modify it under the terms of the GNU General Public License
 - * as published by the Free Software Foundation; either version
 - * 2 of the License, or later version.
   */
  
  #define pr_fmt(fmt)   "power9-pmu: " fmt
@@@ -88,6 -92,7 +88,7 @@@ enum 
  #define POWER9_MMCRA_IFM1             0x0000000040000000UL
  #define POWER9_MMCRA_IFM2             0x0000000080000000UL
  #define POWER9_MMCRA_IFM3             0x00000000C0000000UL
+ #define POWER9_MMCRA_BHRB_MASK                0x00000000C0000000UL
  
  /* Nasty Power9 specific hack */
  #define PVR_POWER9_CUMULUS            0x00002000
@@@ -296,6 -301,8 +297,8 @@@ static u64 power9_bhrb_filter_map(u64 b
  
  static void power9_config_bhrb(u64 pmu_bhrb_filter)
  {
+       pmu_bhrb_filter &= POWER9_MMCRA_BHRB_MASK;
        /* Enable BHRB filter in PMU */
        mtspr(SPRN_MMCRA, (mfspr(SPRN_MMCRA) | pmu_bhrb_filter));
  }
index 1b6932890a736fca450cbba5ee89595fdb3bbbbc,52e9e159bb70a0f7f60936e1d75b4322b954e2b0..186109bdd41be2c3d05f1bc93059960454a1d27f
@@@ -1,4 -1,3 +1,4 @@@
 +// SPDX-License-Identifier: GPL-2.0-or-later
  /*
   * OPAL IMC interface detection driver
   * Supported on POWERNV platform
@@@ -6,6 -5,11 +6,6 @@@
   * Copyright  (C) 2017 Madhavan Srinivasan, IBM Corporation.
   *            (C) 2017 Anju T Sudhakar, IBM Corporation.
   *            (C) 2017 Hemant K Shaw, IBM Corporation.
 - *
 - * This program is free software; you can redistribute it and/or
 - * modify it under the terms of the GNU General Public License
 - * as published by the Free Software Foundation; either version
 - * 2 of the License, or later version.
   */
  #include <linux/kernel.h>
  #include <linux/platform_device.h>
@@@ -157,6 -161,10 +157,10 @@@ static int imc_pmu_create(struct device
        struct imc_pmu *pmu_ptr;
        u32 offset;
  
+       /* Return for unknown domain */
+       if (domain < 0)
+               return -EINVAL;
        /* memory for pmu */
        pmu_ptr = kzalloc(sizeof(*pmu_ptr), GFP_KERNEL);
        if (!pmu_ptr)
This page took 0.076824 seconds and 4 git commands to generate.