public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Pisa <pisa@cmp.felk.cvut.cz>
To: Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@osdl.org>,
	trivial@rustcorp.com.au, Pavel Pisa <pisa@cmp.felk.cvut.cz>
Subject: VM86 interrupt emulation breakage and FIXes for 2.6.x kernel series
Date: Thu, 9 Dec 2004 14:59:51 +0100	[thread overview]
Message-ID: <200412091459.51583.pisa@cmp.felk.cvut.cz> (raw)

Hello all,

because there is no maintainer specified for VM86 subsystem, I bother you all.

There is is problem in VM86 emulation code. It returns IRQ_NONE for each
handler invocation. This results in missdetection of interrupt as uncared
and it is disabled after 100000 invocations. Next patch solves this problem.
It still returns IRQ_NONE, if the interrupt servicing by userspace
is lacking/broken or if interrupt is stuck and could freeze kernel.

The original code could not work with level invocated interrupts at all,
it would lead to the contant system freeze if IRQ_HANDLED is returned.
IRQ is didabled now in the handler and reenabled in get_and_reset_irq()
by VM86_GET_AND_RESET_IRQ IOCTL.

The FIX has been tested on 2.6.4 kernel, but I have not noticed any
change solving problem of VM86 IRQ in 2.6 BitKeeper repository
till yesterday.

We are using this VM86 feature for education purposes. Students
can write and debug their code controlling some IRC with IRQ
equipped DC motor from userspace first.
Than code could be moved to RT-Linux threads or Linux driver module.
This will be part of next run of Computer for Control curse
at our department
   http://dce.felk.cvut.cz/por/

I have used this setup even for testing and development of real drivers.
I have macros and simple adaptation code, that low level parts of
real driver code can be run in userspace, attaching interrupts through
VM86, IO/MEM through ioperm and mmap. If somebody is interrested
in this approach, I can send my sources.

Best wishes

                Pavel Pisa
        e-mail: pisa@cmp.felk.cvut.cz
        www:    http://cmp.felk.cvut.cz/~pisa
        work:   http://www.pikron.com


Name: VM86 interrupt emulation FIX for 2.6.x
Status: Trivial
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>

Fixes faulty IRQ_NONE value returning by VM86 irq_handler().
The IRQ source is blocked as well until userspace confirms processing.
This should enable to use VM86 code even for level triggered
interrupt sources.

--- linux-2.6.4/arch/i386/kernel/vm86.c.orig 2004-03-11 03:55:22.000000000 
+0100
+++ linux-2.6.4/arch/i386/kernel/vm86.c 2004-12-08 11:25:08.000000000 +0100
@@ -718,6 +718,10 @@ static irqreturn_t irq_handler(int intno
  if (vm86_irqs[intno].sig)
   send_sig(vm86_irqs[intno].sig, vm86_irqs[intno].tsk, 1);
  /* else user will poll for IRQs */
+ spin_unlock_irqrestore(&irqbits_lock, flags); 
+ /* Next line would be required to handle correctly level activated 
interrupts */
+ disable_irq(intno);
+ return IRQ_HANDLED;
 out:
  spin_unlock_irqrestore(&irqbits_lock, flags); 
  return IRQ_NONE;


             reply	other threads:[~2004-12-09 13:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-09 13:59 Pavel Pisa [this message]
2004-12-09 16:09 ` VM86 interrupt emulation breakage and FIXes for 2.6.x kernel series Linus Torvalds
2004-12-10 21:05 ` Alan Cox
2004-12-10 22:55   ` Linus Torvalds
2004-12-10 23:58     ` Alan Cox
2004-12-11  1:23       ` Linus Torvalds
2004-12-11  0:57         ` Alan Cox
2004-12-11  2:30           ` Pavel Pisa
2004-12-11  4:21           ` Linus Torvalds
2004-12-11 14:19             ` Alan Cox
2004-12-11 18:45               ` Linus Torvalds
2004-12-11 18:46                 ` Alan Cox
2005-04-26  8:49                   ` [PATCH] Linux 2.6.x VM86 interrupt emulation fixes - the second round Pavel Pisa
2004-12-11  2:07     ` VM86 interrupt emulation breakage and FIXes for 2.6.x kernel series Pavel Pisa

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=200412091459.51583.pisa@cmp.felk.cvut.cz \
    --to=pisa@cmp.felk.cvut.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=torvalds@osdl.org \
    --cc=trivial@rustcorp.com.au \
    /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