* [vm86] [1/2] call release_x86_irqs() in release_thread()
@ 2002-12-05 22:28 wli
2002-12-05 22:28 ` [vm86] [2/2] remove handle_irq_zombies() wli
0 siblings, 1 reply; 2+ messages in thread
From: wli @ 2002-12-05 22:28 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, manfred, davej
This fix, originally from Stas Sergeev has been acked by Manfred and
has been lingering around the -dj tree for a while.
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/arch/i386/kernel/process.c linux-2.5/arch/i386/kernel/process.c
--- bk-linus/arch/i386/kernel/process.c 2002-11-21 02:09:30.000000000 +0000
+++ linux-2.5/arch/i386/kernel/process.c 2002-11-21 17:55:02.000000000 +0000
@@ -44,6 +44,7 @@
#include <asm/ldt.h>
#include <asm/processor.h>
#include <asm/i387.h>
+#include <asm/irq.h>
#include <asm/desc.h>
#ifdef CONFIG_MATH_EMULATION
#include <asm/math_emu.h>
@@ -269,6 +270,8 @@ void release_thread(struct task_struct *
BUG();
}
}
+
+ release_x86_irqs(dead_task);
}
/*
diff -urpN --exclude-from=/home/davej/.exclude bk-linus/include/asm-i386/irq.h linux-2.5/include/asm-i386/irq.h
--- bk-linus/include/asm-i386/irq.h 2002-11-21 02:21:50.000000000 +0000
+++ linux-2.5/include/asm-i386/irq.h 2002-11-21 18:03:23.000000000 +0000
@@ -23,6 +23,7 @@ static __inline__ int irq_cannonicalize(
extern void disable_irq(unsigned int);
extern void disable_irq_nosync(unsigned int);
extern void enable_irq(unsigned int);
+extern void release_x86_irqs(struct task_struct *);
#ifdef CONFIG_X86_LOCAL_APIC
#define ARCH_HAS_NMI_WATCHDOG /* See include/linux/nmi.h */
^ permalink raw reply [flat|nested] 2+ messages in thread
* [vm86] [2/2] remove handle_irq_zombies()
2002-12-05 22:28 [vm86] [1/2] call release_x86_irqs() in release_thread() wli
@ 2002-12-05 22:28 ` wli
0 siblings, 0 replies; 2+ messages in thread
From: wli @ 2002-12-05 22:28 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, manfred, davej
This patch, suggested by manfred, removes handle_irq_zombies() and
task_valid(). The procedure of comparing stored task structure
pointers to tasklist elements is incorrect; the task structures
are reused. Reaping the vm86 IRQ's in release_x86_irq() suffices.
===== arch/i386/kernel/vm86.c 1.14 vs edited =====
--- 1.14/arch/i386/kernel/vm86.c Fri Nov 15 14:32:24 2002
+++ edited/arch/i386/kernel/vm86.c Thu Dec 5 11:15:44 2002
@@ -708,23 +708,6 @@
spin_unlock_irqrestore(&irqbits_lock, flags);
}
-static inline int task_valid(struct task_struct *tsk)
-{
- struct task_struct *g, *p;
- int ret = 0;
-
- read_lock(&tasklist_lock);
- do_each_thread(g, p)
- if ((p == tsk) && (p->sig)) {
- ret = 1;
- goto out;
- }
- while_each_thread(g, p);
-out:
- read_unlock(&tasklist_lock);
- return ret;
-}
-
void release_x86_irqs(struct task_struct *task)
{
int i;
@@ -733,17 +716,6 @@
free_vm86_irq(i);
}
-static inline void handle_irq_zombies(void)
-{
- int i;
- for (i=3; i<16; i++) {
- if (vm86_irqs[i].tsk) {
- if (task_valid(vm86_irqs[i].tsk)) continue;
- free_vm86_irq(i);
- }
- }
-}
-
static inline int get_and_reset_irq(int irqnumber)
{
int bit;
@@ -772,7 +744,6 @@
case VM86_REQUEST_IRQ: {
int sig = irqnumber >> 8;
int irq = irqnumber & 255;
- handle_irq_zombies();
if (!capable(CAP_SYS_ADMIN)) return -EPERM;
if (!((1 << sig) & ALLOWED_SIGS)) return -EPERM;
if ( (irq<3) || (irq>15) ) return -EPERM;
@@ -784,7 +755,6 @@
return irq;
}
case VM86_FREE_IRQ: {
- handle_irq_zombies();
if ( (irqnumber<3) || (irqnumber>15) ) return -EPERM;
if (!vm86_irqs[irqnumber].tsk) return 0;
if (vm86_irqs[irqnumber].tsk != current) return -EPERM;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-05 22:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-05 22:28 [vm86] [1/2] call release_x86_irqs() in release_thread() wli
2002-12-05 22:28 ` [vm86] [2/2] remove handle_irq_zombies() wli
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®