linux_dsm_epyc7002/arch/powerpc
Michael Ellerman db6711b7a1 powerpc/perf: Add missing break in power7_marked_instr_event()
In power7_marked_instr_event() there is a switch case that is missing
a break or an explicit fallthrough, it's not immediately clear which
it should be.

The function determines based on the PMU event code, whether the event
is a "marked" event (which then requires us to configure the PMU in a
certain way). On Power7 there is no specific bit(s) in the event to
tell us that, we just have to know.

Rather than having a full list of every event and whether they are
marked, we pull apart the event code and for events with certain
values of certain fields we can say that those are all marked events.

We take the psel (bits 0-7) of the event, and look at bits 4-7. For a
value of 6 we say that if the entire psel == 0x64 then if the pmc == 3
the event is marked, else not, and otherwise we continue.

It is then that we fallthrough to the 8 case, where we return true if
the unit == 0xd.

The question is should the 6 case also fallthrough and check for
unit == 0xd, or should it return.

Looking at the full list of events we see that there are zero events
where (psel >> 4) == 0x6 and unit == 0xd.

So the answer is it doesn't really matter, there are no valid event
codes that will return a different result whether we fallthrough or
break.

But equally, testing the 6 case events against unit == 0xd is slightly
bogus, as there are no such events. So to make the code clearer, and
avoid any future confusion, have the 6 case break rather than falling
through.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
2018-10-03 15:39:45 +10:00
..
boot powerpc/boot: Ensure _zimage_start is a weak symbol 2018-09-19 22:08:12 +10:00
configs powerpc/configs: Update skiroot defconfig 2018-09-19 22:08:12 +10:00
crypto powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
include Revert "convert SLB miss handlers to C" and subsequent commits 2018-10-03 15:32:49 +10:00
kernel Revert "convert SLB miss handlers to C" and subsequent commits 2018-10-03 15:32:49 +10:00
kvm PPC KVM fixes for 4.19 2018-09-04 21:12:46 +02:00
lib powerpc/64: Remove static branch hints from memset() 2018-09-17 21:17:25 +10:00
math-emu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm Revert "convert SLB miss handlers to C" and subsequent commits 2018-10-03 15:32:49 +10:00
net powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
oprofile treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
perf powerpc/perf: Add missing break in power7_marked_instr_event() 2018-10-03 15:39:45 +10:00
platforms powerpc/pseries: Remove VLA from lparcfg_write() 2018-09-19 22:08:12 +10:00
purgatory powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
sysdev powerpc/xive: Use xive_cpu->chip_id instead of looking it up again 2018-09-19 21:58:09 +10:00
tools powerpc: Add a checkpatch wrapper with our preferred settings 2018-08-07 21:49:25 +10:00
xmon Revert "convert SLB miss handlers to C" and subsequent commits 2018-10-03 15:32:49 +10:00
Kconfig powerpc: disable support for relative ksymtab references 2018-08-29 16:12:07 -07:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile powerpc: avoid -mno-sched-epilog on GCC 4.9 and newer 2018-09-19 22:01:56 +10:00
Makefile.postlink License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00