lkml.org 
[lkml]   [1997]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[PATCH3] 2.1.36 (do_nmi) NMI trap revised
On Fri, 9 May 1997, Martin Mares wrote:

> Hi,
>
> > > I'll test it today and let's see if the bits work or not.
> >
> > Yes ... but ... err ... do you have some buggy parity memory ? :)))
>
> No, but I can simply simulate parity errors for example by turning on the
> parity checks on system with no-parity SIMMs.

Okay. I have tested the NMI handler with my Triton PIIX3 chipset.
It seems to work well.
I have enabled parity check in BIOS, then I have booted the machine
telling the BIOS (at bios request after an NMI at address 0x00) to disable
NMI interrupts (I guess writing 1 at bit 7 of 0x70).
Then booted with patch (revised to check local_page for error) with
NMI disabled. After this, I have run an user program to enable memory
parity check and re-enable the NMI interrupts and I have received the
kernel NMI message. The kernel allocated the local page and memset(...)
raised the NMI flag (NMI error).
I have set up the kernel handler to leave NMI interrupts
disabled (hehe ... without this last thing, there was one NMI after the
other forever :))

The only strange thing is that after the test, having NMI interrupts
disabled (and all filesystems except / umounted) I have done a
ctrl-alt-del to reboot and I have had a PANIC (program, not kernel) from
init. Hmmm may be some flaw in the nmi handler ? Or doing this tricks with
NMI leaved the machine in an insane state ?

Boh ... the logic seems to work.
Try this one.
nmi.diff is the kernel diff
nmi.c is the program I have used to raise the NMI interrupt.
Remember to comment out the last "NMI interruts enable" instruction in
do_nmi.

The next step will be to cli/sti the memory test. I have an idea on how to
collect the informations. I think I will use an array of bytes as a bitmap
with every bit meaning a page. Allocating num_physpages >> 8 bytes I can
collect all the relevant informations and printk it after the sti. This
way for 128 Mb of memory we need only 4096 bytes. Of course all this crap
because we can not printk in a cli/sti pair: it is itself in a __cli/__sti
pair so after its sti we are happily allowing interrupts et al eventually
doing spurious NMIs on unchecked memory accesses while we are checking a
known page and fooling us with NMI flag set.

But this evening I have something other to do :))

Ciao,
Riccardo.
-------------
begin 644 nmi.tar.gz
M'XL("'E\<S,"`VYM:2YT87(`[5E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