PATCH fixing BUG in 2.1.32, dosemu (wine, wabi?) broken

Hans Lermen (lermen@elserv.ffm.fgan.de)
Tue, 8 Apr 1997 02:22:50 +0200 (MET DST)


Hi,

There is a bug in 2.1.32 which makes soft-INTs invoked by DPMI-clients die
in the kernel instead of passing them to user space. I guess Wine and Wabi
also will suffer from that. This bug should also be present in 2.1.31
as told by Alberto Vignani <alberto.vignani@torino.alpcom.it>, who first
reported this bug and supplied debug info.

Below is a fix for this bug, ... and a correction to avoid name clash (gcc
will otherwise complain about 'show_regs' beeing redefined static).

Hans
<lermen@fgan.de>

---------------------------------------------------------------------------
--- linux-2.1.32-clean/arch/i386/kernel/traps.c Mon Apr 7 16:12:39 1997
+++ linux/arch/i386/kernel/traps.c Tue Apr 8 00:59:17 1997
@@ -114,7 +114,7 @@
#define VMALLOC_OFFSET (8*1024*1024)
#define MODULE_RANGE (8*1024*1024)

-static void show_regs(struct pt_regs *regs)
+static void show_registers(struct pt_regs *regs)
{
int i;
unsigned long esp;
@@ -124,8 +124,6 @@

esp = (unsigned long) &regs->esp;
ss = KERNEL_DS;
- if ((regs->eflags & VM_MASK) || (3 & regs->xcs) == 3)
- return;
if (regs->xcs & 3) {
esp = regs->esp;
ss = regs->xss & 0xffff;
@@ -184,9 +182,11 @@

/*static*/ void die_if_kernel(const char * str, struct pt_regs * regs, long err)
{
+ if ((regs->eflags & VM_MASK) || (3 & regs->xcs) == 3)
+ return;
console_verbose();
printk("%s: %04lx\n", str, err & 0xffff);
- show_regs(regs);
+ show_registers(regs);
do_exit(SIGSEGV);
}

@@ -236,7 +236,7 @@

asmlinkage void do_nmi(struct pt_regs * regs, long error_code)
{
- printk("NMI\n"); show_regs(regs);
+ printk("NMI\n"); show_registers(regs);
#ifdef CONFIG_SMP_NMI_INVAL
smp_flush_tlb_rcv();
#else
---------------------------------------------------------------------------