This is a note to let you know that I've just added the patch titled

    sparc64: Fix bit twiddling in sparc_pmu_enable_event().

to the 3.4-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sparc64-fix-bit-twiddling-in-sparc_pmu_enable_event.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 60f463df0d39ddb5d875ed6052d458e4224055f2 Mon Sep 17 00:00:00 2001
From: "David S. Miller" <[email protected]>
Date: Tue, 16 Oct 2012 13:05:25 -0700
Subject: sparc64: Fix bit twiddling in sparc_pmu_enable_event().


From: "David S. Miller" <[email protected]>

[ Upstream commit e793d8c6740f8fe704fa216e95685f4d92c4c4b9 ]

There was a serious disconnect in the logic happening in
sparc_pmu_disable_event() vs. sparc_pmu_enable_event().

Event disable is implemented by programming a NOP event into the PCR.

However, event enable was not reversing this operation.  Instead, it
was setting the User/Priv/Hypervisor trace enable bits.

That's not sparc_pmu_enable_event()'s job, that's what
sparc_pmu_enable() and sparc_pmu_disable() do .

The intent of sparc_pmu_enable_event() is clear, since it first clear
out the event type encoding field.  So fix this by OR'ing in the event
encoding rather than the trace enable bits.

Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 arch/sparc/kernel/perf_event.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -557,11 +557,13 @@ static u64 nop_for_index(int idx)
 
 static inline void sparc_pmu_enable_event(struct cpu_hw_events *cpuc, struct 
hw_perf_event *hwc, int idx)
 {
-       u64 val, mask = mask_for_index(idx);
+       u64 enc, val, mask = mask_for_index(idx);
+
+       enc = perf_event_get_enc(cpuc->events[idx]);
 
        val = cpuc->pcr;
        val &= ~mask;
-       val |= hwc->config;
+       val |= event_encoding(enc, idx);
        cpuc->pcr = val;
 
        pcr_ops->write(cpuc->pcr);


Patches currently in stable-queue which might be from [email protected] are

queue-3.4/infiniband-pass-rdma_cm-module-to-netlink_dump_start.patch
queue-3.4/net-fix-skb_under_panic-oops-in-neigh_resolve_output.patch
queue-3.4/netlink-add-reference-of-module-in-netlink_dump_start.patch
queue-3.4/sparc64-be-less-verbose-during-vmemmap-population.patch
queue-3.4/rds-fix-rds-ping-spinlock-recursion.patch
queue-3.4/sparc64-do-not-clobber-personality-flags-in-sys_sparc64_personality.patch
queue-3.4/sparc64-like-x86-we-should-check-current-mm-during-perf-backtrace-generation.patch
queue-3.4/sparc64-fix-ptrace-interaction-with-force_successful_syscall_return.patch
queue-3.4/sparc64-fix-bit-twiddling-in-sparc_pmu_enable_event.patch
queue-3.4/skge-add-dma-mask-quirk-for-marvell-88e8001-on-asus-p5nsli-motherboard.patch
queue-3.4/ipv6-addrconf-fix-proc-net-if_inet6.patch
queue-3.4/vlan-don-t-deliver-frames-for-unknown-vlans-to-protocols.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to