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.6-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.6 subdirectory.

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


>From 646af7e56d9541c68783519d0431c1515b7ce3e8 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.6/net-remove-skb-recycling.patch
queue-3.6/infiniband-pass-rdma_cm-module-to-netlink_dump_start.patch
queue-3.6/net-fix-skb_under_panic-oops-in-neigh_resolve_output.patch
queue-3.6/ipv4-fix-sending-of-redirects.patch
queue-3.6/ipvs-fix-arp-resolving-for-direct-routing-mode.patch
queue-3.6/ipv4-add-flowi_flag_known_nh.patch
queue-3.6/netlink-add-reference-of-module-in-netlink_dump_start.patch
queue-3.6/rds-fix-rds-ping-spinlock-recursion.patch
queue-3.6/sparc64-like-x86-we-should-check-current-mm-during-perf-backtrace-generation.patch
queue-3.6/sparc64-fix-ptrace-interaction-with-force_successful_syscall_return.patch
queue-3.6/ipv4-fix-forwarding-for-strict-source-routes.patch
queue-3.6/sparc64-fix-bit-twiddling-in-sparc_pmu_enable_event.patch
queue-3.6/skge-add-dma-mask-quirk-for-marvell-88e8001-on-asus-p5nsli-motherboard.patch
queue-3.6/ipv4-make-sure-nh_pcpu_rth_output-is-always-allocated.patch
queue-3.6/ipv6-gro-should-be-ecn-friendly.patch
queue-3.6/ipv4-always-invalidate-or-update-the-route-on-pmtu-events.patch
queue-3.6/ipv6-addrconf-fix-proc-net-if_inet6.patch
queue-3.6/ipv4-don-t-report-stale-pmtu-values-to-userspace.patch
queue-3.6/ipv4-don-t-create-nh-exeption-when-the-device-mtu-is-smaller-than-the-reported-pmtu.patch
queue-3.6/ipv4-introduce-rt_uses_gateway.patch
queue-3.6/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