2009-12-03 14:52:47

by Mikael Pettersson

[permalink] [raw]
Subject: [PATCH 2.6.32] x86: enable lapic nmi watchdog on AMD Family 11h

The x86 lapic nmi watchdog does not recognize AMD Family 11h,
resulting in:

NMI watchdog: CPU not supported

As far as I can see from available documentation (the BKDM),
family 11h looks identical to family 10h as far as the PMU
is concerned.

Extending the check to accept family 11h results in:

Testing NMI watchdog ... OK.

I've been running with this change on a Turion X2 Ultra ZM-82
laptop for a couple of weeks now without problems.

Signed-off-by: Mikael Pettersson <[email protected]>
---

diff -rupN linux-2.6.32/arch/x86/kernel/cpu/perfctr-watchdog.c linux-2.6.32.x86-amd-fam11-nmi/arch/x86/kernel/cpu/perfctr-watchdog.c
--- linux-2.6.32/arch/x86/kernel/cpu/perfctr-watchdog.c 2009-12-03 12:38:32.000000000 +0100
+++ linux-2.6.32.x86-amd-fam11-nmi/arch/x86/kernel/cpu/perfctr-watchdog.c 2009-12-03 12:47:59.000000000 +0100
@@ -712,7 +712,7 @@ static void probe_nmi_watchdog(void)
switch (boot_cpu_data.x86_vendor) {
case X86_VENDOR_AMD:
if (boot_cpu_data.x86 != 6 && boot_cpu_data.x86 != 15 &&
- boot_cpu_data.x86 != 16)
+ boot_cpu_data.x86 != 16 && boot_cpu_data.x86 != 17)
return;
wd_ops = &k7_wd_ops;
break;


2009-12-03 15:29:55

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 2.6.32] x86: enable lapic nmi watchdog on AMD Family 11h


* Mikael Pettersson <[email protected]> wrote:

> The x86 lapic nmi watchdog does not recognize AMD Family 11h,
> resulting in:
>
> NMI watchdog: CPU not supported
>
> As far as I can see from available documentation (the BKDM), family
> 11h looks identical to family 10h as far as the PMU is concerned.
>
> Extending the check to accept family 11h results in:
>
> Testing NMI watchdog ... OK.
>
> I've been running with this change on a Turion X2 Ultra ZM-82 laptop
> for a couple of weeks now without problems.

Applied, thanks Mikael!

Long term i think we want to use the PMU driver to support the NMI tick,
that way all new CPUs that have PMU support will get NMI watchdog
support too, automatically.

That's a more complex change though and there's no reason not to apply
this simple patch of yours. Btw., do you [or anyone else] have
interest/time to pursue the more complex angle as well? It would be a
nice feature.

Ingo

2009-12-03 15:37:30

by Mikael Pettersson

[permalink] [raw]
Subject: [tip:x86/apic] x86, apic: Enable lapic nmi watchdog on AMD Family 11h

Commit-ID: 7d1849aff6687a135a8da3a75e32a00e3137a5e2
Gitweb: http://git.kernel.org/tip/7d1849aff6687a135a8da3a75e32a00e3137a5e2
Author: Mikael Pettersson <[email protected]>
AuthorDate: Thu, 3 Dec 2009 15:52:44 +0100
Committer: Ingo Molnar <[email protected]>
CommitDate: Thu, 3 Dec 2009 16:25:15 +0100

x86, apic: Enable lapic nmi watchdog on AMD Family 11h

The x86 lapic nmi watchdog does not recognize AMD Family 11h,
resulting in:

NMI watchdog: CPU not supported

As far as I can see from available documentation (the BKDM),
family 11h looks identical to family 10h as far as the PMU
is concerned.

Extending the check to accept family 11h results in:

Testing NMI watchdog ... OK.

I've been running with this change on a Turion X2 Ultra ZM-82
laptop for a couple of weeks now without problems.

Signed-off-by: Mikael Pettersson <[email protected]>
Cc: Andreas Herrmann <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/kernel/cpu/perfctr-watchdog.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c
index fab786f..898df97 100644
--- a/arch/x86/kernel/cpu/perfctr-watchdog.c
+++ b/arch/x86/kernel/cpu/perfctr-watchdog.c
@@ -712,7 +712,7 @@ static void probe_nmi_watchdog(void)
switch (boot_cpu_data.x86_vendor) {
case X86_VENDOR_AMD:
if (boot_cpu_data.x86 != 6 && boot_cpu_data.x86 != 15 &&
- boot_cpu_data.x86 != 16)
+ boot_cpu_data.x86 != 16 && boot_cpu_data.x86 != 17)
return;
wd_ops = &k7_wd_ops;
break;