mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: "Udo A. Steinberg" <us15@os.inf.tu-dresden.de>
Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
	ak@suse.de
Subject: [PATCH] Fix interchanged parameters to release_{evntsel,perfctr}_nmi
Date: Fri, 8 Jun 2007 08:02:44 +0200	[thread overview]
Message-ID: <20070608060244.GA2369@atjola.homenet> (raw)
In-Reply-To: <20070603150246.5151dda6@laptop.hypervisor.org>

On 2007.06.03 15:02:46 +0200, Udo A. Steinberg wrote:
> On Tue, 29 May 2007 14:52:53 +0200 Michal Piotrowski (MP) wrote:
> 
> MP> Here is a list of some known regressions in 2.6.22-rc3.
> MP> 
> MP> Feel free to add new regressions/remove fixed etc.
> MP> http://kernelnewbies.org/known_regressions
> 
> Here's another 2.6.22-rc3 regression. It was ok on 2.6.21. I believe it
> triggered during: echo 0 > /proc/sys/kernel/nmi_watchdog
> 
> 
> ------------[ cut here ]------------
> kernel BUG at arch/i386/kernel/cpu/perfctr-watchdog.c:126!
> invalid opcode: 0000 [#1]
> PREEMPT 
> Modules linked in:
> CPU:    0
> EIP:    0060:[<c010cae5>]    Not tainted VLI
> EFLAGS: 00010286   (2.6.22-rc3 #2)
> EIP is at release_evntsel_nmi+0x16/0x22
> eax: 000000c1   ebx: 080f7408   ecx: c04296e0   edx: ffffff3b
> esi: 00000001   edi: f69d4240   ebp: 00000002   esp: f6962f30
> ds: 007b   es: 007b   fs: 0000  gs: 0033  ss: 0068
> Process rc.M (pid: 1281, ti=f6962000 task=f706c030 task.ti=f6962000)
> Stack: c010cb60 c010cda3 c0110abe 080f7408 f6962f64 f6962fa0 c042ab68 ffffffff 
>        c01853a8 080f7408 f6962f64 f6962fa0 080f7408 00000002 c042a774 f69d4240 
>        080f7408 c0185339 00000002 c0156d33 f6962fa0 f7fcccb4 f69d4240 fffffff7 
> Call Trace:
>  [<c010cb60>] single_msr_unreserve+0xd/0x1a
>  [<c010cda3>] disable_lapic_nmi_watchdog+0x2b/0x39
>  [<c0110abe>] proc_nmi_enabled+0xa0/0xbd
>  [<c01853a8>] proc_sys_write+0x6f/0x8c
>  [<c0185339>] proc_sys_write+0x0/0x8c
>  [<c0156d33>] vfs_write+0x8a/0x10c
>  [<c01571ef>] sys_write+0x41/0x67
>  [<c0103c30>] syscall_call+0x7/0xb
>  =======================
> Code: 00 c7 04 24 f6 5d 3c c0 e8 7d e0 00 00 83 ca ff 89 d0 5a 59 c3 8b 0d 28
> 6e 48 c0 31 d2 85 c9 74 0e 89 c2 2b 51 18 83 fa 42 76 04 <0f> 0b eb fe 0f b3 15
> 38 6e 48 c0 c3 8b 0d 28 6e 48 c0 31 d2 85 EIP: [<c010cae5>]
> release_evntsel_nmi+0x16/0x22 SS:ESP 0068:f6962f30

The culprit seems to be 09198e68501a7e34737cd9264d266f42429abcdc:
[PATCH] i386: Clean up NMI watchdog code

In two places, the parameters to release_{evntsel,perfctr}_nmi
got interchanged during the cleanup. Unfortunately, the NMI watchdog
doesn't want to be enabled on my T43 at all (or I just have no idea what
magic is required to make it happy), so this patch untested. Could you
give it a spin?

Thanks,
Björn


From: Björn Steinbrink <B.Steinbrink@gmx.de>

Fix interchanged parameters to release_{evntsel,perfctr}_nmi.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
---
diff --git a/arch/i386/kernel/cpu/perfctr-watchdog.c b/arch/i386/kernel/cpu/perfctr-watchdog.c
index 2b04c8f..e490ac2 100644
--- a/arch/i386/kernel/cpu/perfctr-watchdog.c
+++ b/arch/i386/kernel/cpu/perfctr-watchdog.c
@@ -276,8 +276,8 @@ static int single_msr_reserve(void)
 
 static void single_msr_unreserve(void)
 {
-	release_evntsel_nmi(wd_ops->perfctr);
-	release_perfctr_nmi(wd_ops->evntsel);
+	release_evntsel_nmi(wd_ops->evntsel);
+	release_perfctr_nmi(wd_ops->perfctr);
 }
 
 static void single_msr_rearm(struct nmi_watchdog_ctlblk *wd, unsigned nmi_hz)
@@ -475,10 +475,10 @@ static void p4_unreserve(void)
 {
 #ifdef CONFIG_SMP
 	if (smp_num_siblings > 1)
-		release_evntsel_nmi(MSR_P4_IQ_PERFCTR1);
+		release_perfctr_nmi(MSR_P4_IQ_PERFCTR1);
 #endif
-	release_evntsel_nmi(MSR_P4_IQ_PERFCTR0);
-	release_perfctr_nmi(MSR_P4_CRU_ESCR0);
+	release_evntsel_nmi(MSR_P4_CRU_ESCR0);
+	release_perfctr_nmi(MSR_P4_IQ_PERFCTR0);
 }
 
 static void p4_rearm(struct nmi_watchdog_ctlblk *wd, unsigned nmi_hz)

  reply	other threads:[~2007-06-08  6:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-29 12:52 [1/4] 2.6.22-rc3: known regressions Michal Piotrowski
2007-05-29 14:34 ` Jan Kara
2007-05-29 14:41   ` Florin Iucha
2007-05-30  4:35 ` Sam Ravnborg
2007-06-03 13:02 ` Udo A. Steinberg
2007-06-08  6:02   ` Björn Steinbrink [this message]
2007-06-08  6:41     ` [PATCH] Fix interchanged parameters to release_{evntsel,perfctr}_nmi Andrew Morton
2007-06-08 10:58       ` Ingo Molnar
2007-06-08 18:44         ` [PATCH 0/2] i386: Fix two more NMI watchdog bugs Björn Steinbrink
2007-06-08 18:46           ` [PATCH 1/2] i386: Fix NMI watchdog not reserving its MSRs Björn Steinbrink
2007-06-08 18:50           ` [PATCH 2/2] i386: Use the right wrapper to disable the NMI watchdog Björn Steinbrink
2007-06-08 20:43           ` [PATCH 0/2] i386: Fix two more NMI watchdog bugs Ingo Molnar
2007-06-08 20:49             ` Udo A. Steinberg
2007-06-08 20:57               ` Andrew Morton
2007-06-08 21:13                 ` Udo A. Steinberg
2007-06-08 22:28               ` Andi Kleen
2007-06-09  2:27             ` [PATCH] i386: Fix the K7 NMI watchdog checkbit Björn Steinbrink
2007-06-09  2:33               ` Björn Steinbrink

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070608060244.GA2369@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    --cc=us15@os.inf.tu-dresden.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®