The patch titled Subject: arch/x86/kernel/cpu/perf_event_msr.c: use sign_extend64() for sign extension has been added to the -mm tree. Its filename is arch-x86-use-sign_extend64-for-sign-extension.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/arch-x86-use-sign_extend64-for-sign-extension.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/arch-x86-use-sign_extend64-for-sign-extension.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Martin Kepplinger <martink@xxxxxxxxx> Subject: arch/x86/kernel/cpu/perf_event_msr.c: use sign_extend64() for sign extension Signed-off-by: Martin Kepplinger <martin.kepplinger@xxxxxxxxxxxxxxxxxxxxx> Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: George Spelvin <linux@xxxxxxxxxxx> Cc: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx> Cc: Maxime Coquelin <maxime.coquelin@xxxxxx> Cc: Denys Vlasenko <dvlasenk@xxxxxxxxxx> Cc: Yury Norov <yury.norov@xxxxxxxxx> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/x86/kernel/cpu/perf_event_msr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff -puN arch/x86/kernel/cpu/perf_event_msr.c~arch-x86-use-sign_extend64-for-sign-extension arch/x86/kernel/cpu/perf_event_msr.c --- a/arch/x86/kernel/cpu/perf_event_msr.c~arch-x86-use-sign_extend64-for-sign-extension +++ a/arch/x86/kernel/cpu/perf_event_msr.c @@ -163,10 +163,9 @@ again: goto again; delta = now - prev; - if (unlikely(event->hw.event_base == MSR_SMI_COUNT)) { - delta <<= 32; - delta >>= 32; /* sign extend */ - } + if (unlikely(event->hw.event_base == MSR_SMI_COUNT)) + delta = sign_extend64(delta, 31); + local64_add(now - prev, &event->count); } _ Patches currently in -mm which might be from martink@xxxxxxxxx are bitopsh-improve-sign_extend32s-documentation.patch bitopsh-add-sign_extend64.patch arch-sh-use-sign_extend64-for-sign-extension.patch arch-sh-use-sign_extend64-for-sign-extension-2.patch arch-x86-use-sign_extend64-for-sign-extension.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html