public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: Nathan Walp <faceprint@faceprint.com>
Cc: Hans Grobler <grobh@sun.ac.za>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>
Subject: Re: Oops in 2.4.0-ac5
Date: Thu, 11 Jan 2001 09:29:07 +1100	[thread overview]
Message-ID: <3360.979165747@ocs3.ocs-net> (raw)
In-Reply-To: Your message of "Wed, 10 Jan 2001 15:23:14 CDT." <3A5CC4B2.74B911BD@faceprint.com>

On Wed, 10 Jan 2001 15:23:14 -0500, 
Nathan Walp <faceprint@faceprint.com> wrote:
>Here it is... I opted to cut out the 1200-odd warnings, which from the
>look of them were all because i'm running it under 2.4.0-ac4 (which
>boots fine).

ksymoops defaults to using /proc entries from the current system.  This
is fine for most people but you have to override the default when
decoding an oops from another kernel.

  ksymoops -KL -m /boot/System.map-2.4.0-ac5

ignores the running ksyms and lsmod files, removing your warnings.

>>>EIP; c01129ba <setup_apic_nmi_watchdog+a/90>   <=====
>Trace; c0100191 <L6+0/2>
>Code;  c01129ba <setup_apic_nmi_watchdog+a/90>
>00000000 <_EIP>:
>Code;  c01129ba <setup_apic_nmi_watchdog+a/90>   <=====
>   0:   0f 30                     wrmsr     <=====
>Code;  c01129bc <setup_apic_nmi_watchdog+c/90>

This is why my original NMI for UP code in kdb uses wrmsr_eio() instead
of wrmsr.  wrmsr_eio() catches errors where the APIC does not support
the msr and returns EIO instead of oopsing and taking the kernel with
it.  I could never persuade Ingo to use wrmsr_eio() and check the
return code, maybe this will change his mind.  Extract from kdb v1.7.

/*
 * {rd,wr}msr_eio by HPA, moved from arch/i386/msr.c to here.
 * Keith Owens.
 */

/* Note: "err" is handled in a funny way below.  Otherwise one version
   of gcc or another breaks. */

extern inline int wrmsr_eio(u32 reg, u32 eax, u32 edx)
{
  int err;

  asm volatile(
	      "1:      wrmsr\n"
	      "2:\n"
	      ".section .fixup,\"ax\"\n"
	      "3:      movl %4,%0\n"
	      "        jmp 2b\n"
	      ".previous\n"
	      ".section __ex_table,\"a\"\n"
	      "        .align 4\n"
	      "        .long 1b,3b\n"
	      ".previous"
	      : "=&bDS" (err)
	      : "a" (eax), "d" (edx), "c" (reg), "i" (-EIO), "0" (0));

  return err;
}

.....

/*
 * Activate or deactivate NMI watchdog via a local APIC.
 */

int setup_apic_nmi_watchdog(int value)
{
       int ret, eax;

       if (!test_bit(X86_FEATURE_APIC, &boot_cpu_data.x86_capability))
	       return(-EIO);
       if (nmi_watchdog_source && nmi_watchdog_source != 1)
	       return(0);      /* Not using local APIC */
       /* Disable performance counters 0, 1 for all NMI changes */
       nmi_watchdog = proc_nmi_watchdog = nmi_watchdog_source = 0;
       if ((ret = wrmsr_eio(EVNTSEL0, 0, 0)) ||
	   (ret = wrmsr_eio(EVNTSEL1, 0, 0)) ||
	   (ret = wrmsr_eio(PERFCTR0, 0, 0)) ||
	   (ret = wrmsr_eio(PERFCTR1, 0, 0)))
	       goto exit;
       if (!value)
	       return(0);
       /* Must set before activation to catch first NMI */
       nmi_watchdog = proc_nmi_watchdog = nmi_watchdog_source = 1;
       eax = 1 << 20           /* Interrupt on overflow */
	   | 1 << 17           /* OS mode */
	   | 1 << 16           /* User mode */
	   | 0x79;             /* Event, cpu clocks not halted */
       if ((ret = wrmsr_eio(EVNTSEL1, eax, 0))
	|| (ret = set_nmi_counter_local()))
	       goto exit;
       apic_write_around(APIC_LVTPC, APIC_DM_NMI);
       eax = 1 << 22;          /* Enable performance counters, only using ctr1 */
       ret = wrmsr_eio(EVNTSEL0, eax, 0);
exit:
       if (ret)
	       nmi_watchdog = proc_nmi_watchdog = nmi_watchdog_source = 0;
       else
	       printk(KERN_INFO "Activated NMI via local APIC\n");
       return(ret);
}



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  parent reply	other threads:[~2001-01-10 22:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-10 20:00 Oops in 2.4.0-ac5 Nathan Walp
2001-01-10 20:17 ` Hans Grobler
2001-01-10 20:23   ` Nathan Walp
2001-01-10 20:48     ` Hans Grobler
2001-01-10 21:00       ` Nathan Walp
2001-01-10 22:29     ` Keith Owens [this message]
2001-01-10 22:37       ` Alan Cox
2001-01-10 22:41         ` Ingo Molnar
2001-01-11 11:15           ` David Woodhouse
2001-01-11 11:41             ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2001-01-11 12:56 Mikael Pettersson

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=3360.979165747@ocs3.ocs-net \
    --to=kaos@ocs.com.au \
    --cc=faceprint@faceprint.com \
    --cc=grobh@sun.ac.za \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /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