Skip to contentSkip to conversation

updatd kernel diff (relative to 2.4.0-test1)

Linux-ia64 David Mosberger 1 participant 1 message Jun 22, 2000

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

Here is an updated kernel diff.

IMPORTANT NOTICE

- Per request from Jes, the "stat" structure was changed to make it match with glibc-2.2. This provides for a more efficient implementation of stat and friends. However, the new format makes the stat, lstat, and fstat system calls incompatible with current binaries. Thus, rather than replacing the existing syscalls, we added new versions of them. The old versions continue to be available (for the time being) as old_stat, old_fstat, and old_lstat.

WARNING: If you plan on re-compiling glibc-2.1 with this kernel you MUST update syscalls.list first by applying this patch (WARNING^2: I didn't test this glibc patch, but you get the idea...).

unix/sysv/linux/ia64/syscalls.list renamed from unix/sysv/linux/ia64/syscalls.list~ +3 -3
@@ -72,11 +72,11 @@
 s_getdents	getdents getdents	3	__syscall_getdents	getdents
 
 # System calls with wrappers.
-sys_fstat	fxstat	fstat		2	__syscall_fstat
-sys_lstat	lxstat	lstat		2	__syscall_lstat
+sys_fstat	fxstat	old_fstat	2	__syscall_fstat
+sys_lstat	lxstat	old_lstat	2	__syscall_lstat
 sys_mknod	xmknod	mknod		3	__syscall_mknod
 sys_readv	readv	readv		3	__syscall_readv
-sys_stat	xstat	stat		2	__syscall_stat
+sys_stat	xstat	old_stat	2	__syscall_stat
 sys_writev	writev	writev		3	__syscall_writev
 s_getpagesize	getpagesize getpagesize	0	__syscall_getpagesize
 s_poll		poll	poll		3	__syscall_poll

OK, having said that, what else's new since last patch:

- Completed unwind functionality. I don't think things are final yet, but the last missing piece, core-dump support, hs been added now, so the new unwind support should now be functionally complete. On a kernel panic, you should now get a call trace in addition to the register dump. That's the theory at least, as I haven't been able to test it out yet. There are still some unwind related bugs in the toolchain, so I'd recommend not to turn on CONFIG_IA64_NEW_UNWIND unless you're willing to live dangerously...

- Make the Alt DTLB handler work again for speculative faults (they always get NaT'ted now).

- Most of Asit's patch: updates for IA-32 emulation, send_sig_info -> force_sig_info fixes, and the SMP ptc.g workaround fix.

- Goutham's PCI DMA fix.

- Fix Rules.make so the integer division routines don't get recompile all the time.

- Add missing #include <linux/init.h> to hpsim_irq.c. This should make things build for the HP simulator again.

- mmap() is now supposed to return EINVAL when attempting to map into or across the address space hole in the middle of the region (also untested so far).

I tested this patch (with kdb patch applied) on a 4-way Lion, 1-way Big Sur and the HP simulator. Some known problems:

- "make -j" seems to reliably lock up the kernel (the system doesn't freeze, you can still get into kdb, but the processes don't seem to be making forward progress anymore)

- there are still occasionaly random user-level deaths (usually in the compiler); anyone who finds a half-way reproducible test case:
please let me know (I'm currently working with the gcc test case that Richard found, but a simpler test-case would be very helpful)

As usual, the patch can be found at:

ftp://ftp.kernel.org/pub/linux/kernel/ports/ia64

Look for file linux-2.4.0-test1-ia64-000621.diff*

Enjoy,

	--david
Rules.make +5 -2
diff -urN linux-davidm/Rules.make linux-2.4.0-test1-lia/Rules.make
@@ -291,9 +291,12 @@
 	))
 
 # A kludge: .S files don't get flag dependencies (yet),
-#   because that will involve changing a lot of Makefiles.
+#   because that will involve changing a lot of Makefiles.  Also
+#   suppress object files explicitly listed in $(IGNORE_FLAGS_OBJS).
+#   This allows handling of assembly files that get translated into
+#   multiple object files (see arch/ia64/lib/idiv.S, for example).
 FILES_FLAGS_CHANGED := $(strip \
-    $(filter-out $(patsubst %.S, %.o, $(wildcard *.S)), \
+    $(filter-out $(patsubst %.S, %.o, $(wildcard *.S) $(IGNORE_FLAGS_OBJS)), \
     $(FILES_FLAGS_CHANGED)))
 
 ifneq ($(FILES_FLAGS_CHANGED),)
arch/ia64/hp/hpsim_irq.c +1 -0
diff -urN linux-davidm/arch/ia64/hp/hpsim_irq.c linux-2.4.0-test1-lia/arch/ia64/hp/hpsim_irq.c
@@ -5,6 +5,7 @@
  * Copyright (C) 1998-2000 David Mosberger-Tang <[email protected]>
  */
 
+#include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/irq.h>
arch/ia64/ia32/binfmt_elf32.c +11 -3
diff -urN linux-davidm/arch/ia64/ia32/binfmt_elf32.c linux-2.4.0-test1-lia/arch/ia64/ia32/binfmt_elf32.c
@@ -2,6 +2,8 @@
  * IA-32 ELF support.
  *
  * Copyright (C) 1999 Arun Sharma <[email protected]>
+ *
+ * 06/16/00	A. Mallick	initialize csd/ssd/tssd/cflg for ia32_load_state
  */
 #include <linux/config.h>
 #include <linux/posix_types.h>
@@ -84,6 +86,15 @@
 
 	current->thread.map_base = 0x40000000;
 
+ 
+	/* setup ia32 state for ia32_load_state */
+
+	current->thread.eflag = IA32_EFLAG;
+	current->thread.csd = IA64_SEG_DESCRIPTOR(0L, 0xFFFFFL, 0xBL, 1L, 3L, 1L, 1L, 1L);
+	current->thread.ssd = IA64_SEG_DESCRIPTOR(0L, 0xFFFFFL, 0x3L, 1L, 3L, 1L, 1L, 1L);
+	current->thread.tssd = IA64_SEG_DESCRIPTOR(IA32_PAGE_OFFSET + PAGE_SIZE, 0x1FFFL, 0xBL,
+						   1L, 3L, 1L, 1L, 1L);
+
 	/* CS descriptor */
 	__asm__("mov ar.csd = %0" : /* no outputs */
 		: "r" IA64_SEG_DESCRIPTOR(0L, 0xFFFFFL, 0xBL, 1L,
@@ -96,9 +107,6 @@
 	__asm__("mov ar.eflag = %0" : /* no outputs */ : "r" (IA32_EFLAG));
 
 	/* Control registers */
-	__asm__("mov ar.cflg = %0"
-		: /* no outputs */
-		: "r" (((ulong) IA32_CR4 << 32) | IA32_CR0));
 	__asm__("mov ar.fsr = %0"
 		: /* no outputs */
 		: "r" ((ulong)IA32_FSR_DEFAULT));
arch/ia64/ia32/ia32_entry.S +2 -2
diff -urN linux-davidm/arch/ia64/ia32/ia32_entry.S linux-2.4.0-test1-lia/arch/ia64/ia32/ia32_entry.S
@@ -41,7 +41,7 @@
 	.previous
 
 GLOBAL_ENTRY(ia32_ret_from_syscall)
-	PT_REGS_UNWIND_INFO
+	PT_REGS_UNWIND_INFO(0)
 
 	cmp.ge p6,p7=r8,r0                      // syscall executed successfully?
 	adds r2=IA64_PT_REGS_R8_OFFSET+16,sp    // r2 = &pt_regs.r8
@@ -61,7 +61,7 @@
 	//	b6  = syscall entry point
 	//
 GLOBAL_ENTRY(ia32_trace_syscall)
-	PT_REGS_UNWIND_INFO
+	PT_REGS_UNWIND_INFO(0)
 	br.call.sptk.few rp=invoke_syscall_trace // give parent a chance to catch syscall args
 .Lret4:	br.call.sptk.few rp¶			// do the syscall
 .Lret5:	cmp.lt p6,p0=r8,r0			// syscall failed?
arch/ia64/ia32/ia32_signal.c +23 -9
diff -urN linux-davidm/arch/ia64/ia32/ia32_signal.c linux-2.4.0-test1-lia/arch/ia64/ia32/ia32_signal.c
@@ -104,6 +104,7 @@
                 struct pt_regs *regs, unsigned long mask)
 {
        int  err = 0;
+       unsigned long flag;
 
        err |= __put_user((regs->r16 >> 32) & 0xffff , (unsigned int *)&sc->fs);
        err |= __put_user((regs->r16 >> 48) & 0xffff , (unsigned int *)&sc->gs);
@@ -124,9 +125,11 @@
 #endif
        err |= __put_user(regs->cr_iip, &sc->eip);
        err |= __put_user(regs->r17 & 0xffff, (unsigned int *)&sc->cs);
-#if 0
-       err |= __put_user(regs->eflags, &sc->eflags);
-#endif
+       /*
+	*  `eflags' is in an ar register for this context
+	*/
+       asm volatile ("mov %0=ar.eflag ;;" : "=r"(flag));
+       err |= __put_user((unsigned int)flag, &sc->eflags);
        
        err |= __put_user(regs->r12, &sc->esp_at_signal);
        err |= __put_user((regs->r17 >> 16) & 0xffff, (unsigned int *)&sc->ss);
@@ -190,15 +193,26 @@
        COPY(cr_iip, eip);
        COPY_SEG_STRICT(cs);
        COPY_SEG_STRICT(ss);
-#if 0
        {
-               unsigned int tmpflags;
-               err |= __get_user(tmpflags, &sc->eflags);
-               /* XXX: Change this to ar.eflags */
-               regs->eflags = (regs->eflags & ~0x40DD5) | (tmpflags & 0x40DD5);
-               regs->orig_eax = -1;            /* disable syscall checks */
+		unsigned int tmpflags;
+		unsigned long flag;
+
+		/*
+		 *  IA32 `eflags' is not part of `pt_regs', it's
+		 *  in an ar register which is part of the thread
+		 *  context.  Fortunately, we are executing in the
+		 *  IA32 process's context.
+		 */
+		err |= __get_user(tmpflags, &sc->eflags);
+		asm volatile ("mov %0=ar.eflag ;;" : "=r"(flag));
+		flag &= ~0x40DD5;
+		flag |= (tmpflags & 0x40DD5);
+		asm volatile ("mov ar.eflag=%0 ;;" :: "r"(flag));
+
+		regs->r1 = -1;	/* disable syscall checks, r1 is orig_eax */
        }
 
+#if 0
        {
                struct _fpstate * buf;
                err |= __get_user(buf, &sc->fpstate);
arch/ia64/ia32/ia32_support.c +23 -6
diff -urN linux-davidm/arch/ia64/ia32/ia32_support.c linux-2.4.0-test1-lia/arch/ia64/ia32/ia32_support.c
@@ -1,6 +1,9 @@
 /*
  * IA32 helper functions
+ *
+ * 06/16/00	A. Mallick	added csd/ssd/tssd for ia32 thread context
  */
+
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
@@ -19,38 +22,52 @@
 void
 ia32_save_state (struct thread_struct *thread)
 {
-	unsigned long eflag, fsr, fcr, fir, fdr;
+	unsigned long eflag, fsr, fcr, fir, fdr, csd, ssd, tssd;
 
 	asm ("mov %0=ar.eflag;"
 	     "mov %1=ar.fsr;"
 	     "mov %2=ar.fcr;"
 	     "mov %3=ar.fir;"
-	     "mov %4=ar.fdr"
-	     : "=r"(eflag), "=r"(fsr), "=r"(fcr), "=r"(fir), "=r"(fdr));
+	     "mov %4=ar.fdr;"
+	     "mov %5=ar.csd;"
+	     "mov %6=ar.ssd;"
+	     "mov %7=ar.k1"
+	     : "=r"(eflag), "=r"(fsr), "=r"(fcr), "=r"(fir), "=r"(fdr),
+	       "=r"(csd), "=r"(ssd), "=r"(tssd));
 	thread->eflag = eflag;
 	thread->fsr = fsr;
 	thread->fcr = fcr;
 	thread->fir = fir;
 	thread->fdr = fdr;
+	thread->csd = csd;
+	thread->ssd = ssd;
+	thread->tssd = tssd;
 }
 
 void
 ia32_load_state (struct thread_struct *thread)
 {
-	unsigned long eflag, fsr, fcr, fir, fdr;
+	unsigned long eflag, fsr, fcr, fir, fdr, csd, ssd, tssd;
 
 	eflag = thread->eflag;
 	fsr = thread->fsr;
 	fcr = thread->fcr;
 	fir = thread->fir;
 	fdr = thread->fdr;
+	csd = thread->csd;
+	ssd = thread->ssd;
+	tssd = thread->tssd;
 
 	asm volatile ("mov ar.eflag=%0;"
 		      "mov ar.fsr=%1;"
 		      "mov ar.fcr=%2;"
 		      "mov ar.fir=%3;"
-		      "mov ar.fdr=%4"
-		      :: "r"(eflag), "r"(fsr), "r"(fcr), "r"(fir), "r"(fdr));
+		      "mov ar.fdr=%4;"
+		      "mov ar.csd=%5;"
+		      "mov ar.ssd=%6;"
+		      "mov ar.k1=%7"
+		      :: "r"(eflag), "r"(fsr), "r"(fcr), "r"(fir), "r"(fdr),
+		         "r"(csd), "r"(ssd), "r"(tssd));
 }
 
 /*
arch/ia64/ia32/ia32_traps.c +80 -3

119 lines not on this page · raw message

arch/ia64/kernel/efi.c +11 -0
diff -urN linux-davidm/arch/ia64/kernel/efi.c linux-2.4.0-test1-lia/arch/ia64/kernel/efi.c
@@ -14,6 +14,9 @@
  * in a future version.  --drummond 1999-07-20
  *
  * Implemented EFI runtime services and virtual mode calls.  --davidm
+ *
+ * Goutham Rao: <[email protected]>
+ * 	Skip non-WB memory and ignore empty memory ranges.
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -170,6 +173,14 @@
 				printk("Warning: ignoring %luMB of memory above 1GB!\n",
 				       md->num_pages >> 8);
 				md->type = EFI_UNUSABLE_MEMORY;
+				continue;
+			}
+
+			if (!(md->attribute & EFI_MEMORY_WB))
+				continue;
+			if (md->num_pages = 0) {
+				printk("efi_memmap_walk: ignoring empty region at 0x%lx",
+				       md->phys_addr);
 				continue;
 			}
 
arch/ia64/kernel/entry.S +68 -19

184 lines not on this page · raw message

arch/ia64/kernel/entry.h +33 -29

77 lines not on this page · raw message

arch/ia64/kernel/head.S +1 -1
diff -urN linux-davidm/arch/ia64/kernel/head.S linux-2.4.0-test1-lia/arch/ia64/kernel/head.S
@@ -60,7 +60,7 @@
 	UNW(.prologue)
 	UNW(.save rp, r4)		// terminate unwind chain with a NULL rp
 	UNW(mov r4=r0)
-	.body
+	UNW(.body)
 	// set IVT entry point---can't access I/O ports without it
 	movl r3=ia64_ivt
 	;;
arch/ia64/kernel/irq.c +8 -6
diff -urN linux-davidm/arch/ia64/kernel/irq.c linux-2.4.0-test1-lia/arch/ia64/kernel/irq.c
@@ -201,10 +201,14 @@
 		printk(" %d",local_bh_count(i));
 
 	printk(" ]\nStack dumps:");
-#ifdef __ia64__
-	printk(" ]\nStack dumps: <unimplemented on IA-64---please fix me>");
-	/* for now we don't have stack dumping support... */
-#elif __i386__
+#if defined(__ia64__)
+	/*
+	 * We can't unwind the stack of another CPU without access to
+	 * the registers of that CPU.  And sending an IPI when we're
+	 * in a potentially wedged state doesn't sound like a smart
+	 * idea.
+	 */
+#elif defined(__i386__)
 	for(i=0;i< smp_num_cpus;i++) {
 		unsigned long esp;
 		if(i=cpu)
@@ -227,9 +231,7 @@
 	You lose...
 #endif
 	printk("\nCPU %d:",cpu);
-#ifdef __i386__
 	show_stack(NULL);
-#endif
 	printk("\n");
 }
 	
arch/ia64/kernel/ivt.S +1 -0
diff -urN linux-davidm/arch/ia64/kernel/ivt.S linux-2.4.0-test1-lia/arch/ia64/kernel/ivt.S
@@ -339,6 +339,7 @@
 	shr.u r18=r16,57	// move address bit 61 to bit 4
 	dep r16=0,r16,IA64_MAX_PHYS_BITS,(64-IA64_MAX_PHYS_BITS) // clear ed & reserved bits
 	;;
+	dep r21=-1,r21,IA64_PSR_ED_BIT,1
 	andcm r18=0x10,r18	// bit 4=~address-bit(61)
 	dep r16=r17,r16,0,12	// insert PTE control bits into r16
 	;;
arch/ia64/kernel/pal.S +52 -52

149 lines not on this page · raw message

arch/ia64/kernel/pci-dma.c +2 -2
diff -urN linux-davidm/arch/ia64/kernel/pci-dma.c linux-2.4.0-test1-lia/arch/ia64/kernel/pci-dma.c
@@ -23,8 +23,8 @@
 	void *ret;
 	int gfp = GFP_ATOMIC;
 
-	if (!hwdev || hwdev->dma_mask != 0xffffffff)
-		gfp |= GFP_DMA;
+	if (!hwdev || hwdev->dma_mask = 0xffffffff)
+		gfp |= GFP_DMA;	/* XXX fix me: should change this to GFP_32BIT or ZONE_32BIT */
 	ret = (void *)__get_free_pages(gfp, get_order(size));
 
 	if (ret) {
arch/ia64/kernel/pci.c +2 -2
diff -urN linux-davidm/arch/ia64/kernel/pci.c linux-2.4.0-test1-lia/arch/ia64/kernel/pci.c
@@ -133,7 +133,7 @@
  * Initialization. Uses the SAL interface
  */
 
-#define PCI_BUSSES_TO_SCAN 255
+#define PCI_BUSES_TO_SCAN 255
 
 void __init 
 pcibios_init(void)
@@ -147,7 +147,7 @@
 	}
 
 	printk("PCI: Probing PCI hardware\n");
-	for (i = 0; i < PCI_BUSSES_TO_SCAN; i++) 
+	for (i = 0; i < PCI_BUSES_TO_SCAN; i++) 
 		pci_scan_bus(i, ops, NULL);
 	platform_pci_fixup();
 	return;
arch/ia64/kernel/process.c +140 -13

219 lines not on this page · raw message

arch/ia64/kernel/ptrace.c +16 -29

102 lines not on this page · raw message

arch/ia64/kernel/setup.c +8 -0
diff -urN linux-davidm/arch/ia64/kernel/setup.c linux-2.4.0-test1-lia/arch/ia64/kernel/setup.c
@@ -28,6 +28,7 @@
 #include <linux/console.h>
 
 #include <asm/acpi-ext.h>
+#include <asm/ia32.h>
 #include <asm/page.h>
 #include <asm/machvec.h>
 #include <asm/processor.h>
@@ -361,6 +362,13 @@
 
 	ia64_rid_init();
 	ia64_tlb_init();
+
+#ifdef	CONFIG_IA32_SUPPORT
+	/* initialize global ia32 state - CR0 and CR4 */
+	__asm__("mov ar.cflg = %0"
+		: /* no outputs */
+		: "r" (((ulong) IA32_CR4 << 32) | IA32_CR0));
+#endif
 
 #ifdef CONFIG_SMP
 	normal_xtp();
arch/ia64/kernel/sys_ia64.c +148 -7

182 lines not on this page · raw message

arch/ia64/kernel/traps.c +3 -3
diff -urN linux-davidm/arch/ia64/kernel/traps.c linux-2.4.0-test1-lia/arch/ia64/kernel/traps.c
@@ -172,7 +172,7 @@
 	siginfo.si_signo = sig;
 	siginfo.si_errno = 0;
 	siginfo.si_code = code;
-	send_sig_info(sig, &siginfo, current);
+	force_sig_info(sig, &siginfo, current);
 }
 
 /*
@@ -337,7 +337,7 @@
 				siginfo.si_code = FPE_FLTDIV;
 			}
 			siginfo.si_isr = isr;
-			send_sig_info(SIGFPE, &siginfo, current);
+			force_sig_info(SIGFPE, &siginfo, current);
 		}
 	} else {
 		if (exception = -1) {
@@ -357,7 +357,7 @@
 				siginfo.si_code = FPE_FLTRES;
 			}
 			siginfo.si_isr = isr;
-			send_sig_info(SIGFPE, &siginfo, current);
+			force_sig_info(SIGFPE, &siginfo, current);
 		}
 	}
 	return 0;
arch/ia64/kernel/unaligned.c +6 -30
diff -urN linux-davidm/arch/ia64/kernel/unaligned.c linux-2.4.0-test1-lia/arch/ia64/kernel/unaligned.c
@@ -460,32 +460,15 @@
 	 * enabled.
 	 *
 	 * The registers [32-127] are ususally saved in the tss. When get here,
-	 * they are NECESSARY live because they are only saved explicitely.
+	 * they are NECESSARILY live because they are only saved explicitely.
 	 * We have 3 ways of updating the values: force a save of the range
 	 * in tss, use a gigantic switch/case statement or generate code on the
 	 * fly to store to the right register.
 	 * For now, we are using the (slow) save/restore way.
 	 */
  	if (regnum >= IA64_FIRST_ROTATING_FR) {
-		/*
-		 * force a save of [32-127] to tss
-		 * we use the __() form to avoid fiddling with the dfh bit
-		 */
-		__ia64_save_fpu(&current->thread.fph[0]);
-
+		ia64_sync_fph(current);
 		current->thread.fph[IA64_FPH_OFFS(regnum)] = *fpval;
-
-		__ia64_load_fpu(&current->thread.fph[0]);
-
-		/*
-	 	 * mark the high partition as being used now
-		 *
-		 * This is REQUIRED because the disabled_fph_fault() does
-		 * not set it, it's relying on the faulting instruction to
-		 * do it. In our case the faulty instruction never gets executed
-		 * completely, so we need to toggle the bit.
-	 	 */
-		regs->cr_ipsr |= IA64_PSR_MFH;
 	} else {
 		/*
 		 * pt_regs or switch_stack ?
@@ -544,15 +527,8 @@
 	 * See discussion in setfpreg() for reasons and other ways of doing this.
 	 */
  	if (regnum >= IA64_FIRST_ROTATING_FR) {
-	
-		/*
-		 * force a save of [32-127] to tss
-		 * we use the__ia64_save_fpu() form to avoid fiddling with
-		 * the dfh bit.
-		 */
-		__ia64_save_fpu(&current->thread.fph[0]);
-
-		*fpval =  current->thread.fph[IA64_FPH_OFFS(regnum)];
+		ia64_sync_fph(current);
+		*fpval = current->thread.fph[IA64_FPH_OFFS(regnum)];
 	} else {
 		/*
 		 * f0 = 0.0, f1= 1.0. Those registers are constant and are thus
@@ -1425,7 +1401,7 @@
 		si.si_errno = 0;
 		si.si_code = BUS_ADRALN;
 		si.si_addr = (void *) ifa;
-		send_sig_info(SIGBUS, &si, current);
+		force_sig_info(SIGBUS, &si, current);
 		return;
 	}
 
@@ -1436,7 +1412,7 @@
 		si.si_errno = 0;
 		si.si_code = BUS_ADRALN;
 		si.si_addr = (void *) ifa;
-		send_sig_info(SIGBUS, &si, current);
+		force_sig_info(SIGBUS, &si, current);
 		return;
 	}
 
arch/ia64/kernel/unwind.c +117 -30

287 lines not on this page · raw message

arch/ia64/lib/Makefile +3 -0
diff -urN linux-davidm/arch/ia64/lib/Makefile linux-2.4.0-test1-lia/arch/ia64/lib/Makefile
@@ -16,6 +16,9 @@
 
 LX_OBJS = io.o
 
+IGNORE_FLAGS_OBJS = __divdi3.o __divsi3.o __udivdi3.o __udivsi3.o \
+		    __moddi3.o __modsi3.o __umoddi3.o __umodsi3.o
+
 include $(TOPDIR)/Rules.make
 
 __divdi3.o: idiv.S
arch/ia64/mm/init.c +1 -1
diff -urN linux-davidm/arch/ia64/mm/init.c linux-2.4.0-test1-lia/arch/ia64/mm/init.c
@@ -346,7 +346,7 @@
 
 	memset(zones_size, 0, sizeof(zones_size));
 
-	max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS);
+	max_dma = (PAGE_ALIGN(MAX_DMA_ADDRESS) >> PAGE_SHIFT);
 	if (max_low_pfn < max_dma)
 		zones_size[ZONE_DMA] = max_low_pfn;
 	else {
arch/ia64/mm/tlb.c +2 -1
diff -urN linux-davidm/arch/ia64/mm/tlb.c linux-2.4.0-test1-lia/arch/ia64/mm/tlb.c
@@ -73,6 +73,7 @@
 		local_irq_enable();
 	}
 
+	spin_lock(&ptcg_lock);
 	flush_rid = ia64_get_rr(start);
 	ia64_srlz_d();
 	flush_start = start;
@@ -205,10 +206,10 @@
 	}
 	start &= ~((1UL << nbits) - 1);
 
-	spin_lock(&ptcg_lock);
 #if defined(CONFIG_SMP) && !defined(CONFIG_ITANIUM_PTCG)
 	flush_tlb_no_ptcg(start, end, nbits);
 #else
+	spin_lock(&ptcg_lock);
 	do {
 # ifdef CONFIG_SMP
 		/*
arch/ia64/tools/print_offsets.c +3 -0
diff -urN linux-davidm/arch/ia64/tools/print_offsets.c linux-2.4.0-test1-lia/arch/ia64/tools/print_offsets.c
@@ -45,6 +45,9 @@
     { "IA64_PT_REGS_SIZE",		sizeof (struct pt_regs) },
     { "IA64_SWITCH_STACK_SIZE",		sizeof (struct switch_stack) },
     { "IA64_SIGINFO_SIZE",		sizeof (struct siginfo) },
+#ifdef CONFIG_IA64_NEW_UNWIND
+    { "UNW_FRAME_INFO_SIZE",		sizeof (struct unw_frame_info) },
+#endif
     { "", 0 },			/* spacer */
     { "IA64_TASK_FLAGS_OFFSET",		offsetof (struct task_struct, flags) },
     { "IA64_TASK_SIGPENDING_OFFSET",	offsetof (struct task_struct, sigpending) },
drivers/char/simserial.c +0 -7
diff -urN linux-davidm/drivers/char/simserial.c linux-2.4.0-test1-lia/drivers/char/simserial.c
@@ -30,10 +30,6 @@
 #include <linux/serial.h>
 #include <linux/serialP.h>
 
-#ifdef CONFIG_KDB
-# include <linux/kdb.h>
-#endif
-
 #include <asm/irq.h>
 #include <asm/uaccess.h>
 
@@ -158,9 +154,6 @@
 			} else if ( seen_esc = 2 ) {
 				if ( ch = 'P' ) show_state();		/* F1 key */
 				if ( ch = 'Q' ) show_buffers();	/* F2 key */
-#ifdef CONFIG_KDB
-				if ( ch = 'S' ) KDB_ENTER();		/* F4 key */
-#endif
 				seen_esc = 0;
 				continue;
 			}
include/asm-ia64/dma.h +1 -1
diff -urN linux-davidm/include/asm-ia64/dma.h linux-2.4.0-test1-lia/include/asm-ia64/dma.h
@@ -21,7 +21,7 @@
 #define dma_inb		inb
 
 #define MAX_DMA_CHANNELS	8
-#define MAX_DMA_ADDRESS		(~0UL)		/* no limits on DMAing, for now */
+#define MAX_DMA_ADDRESS		0xffffffffUL
 
 extern spinlock_t  dma_spin_lock;
 
include/asm-ia64/ia32.h +11 -5
diff -urN linux-davidm/include/asm-ia64/ia32.h linux-2.4.0-test1-lia/include/asm-ia64/ia32.h
@@ -112,10 +112,16 @@
        sigset32_t sa_mask;     /* A 32 bit mask */
 };
 
+typedef struct sigaltstack_ia32 {
+	unsigned int	ss_sp;
+	int		ss_flags;
+	unsigned int	ss_size;
+} stack_ia32_t;
+
 struct ucontext_ia32 {
-	unsigned long	  uc_flags;
-	struct ucontext_ia32  *uc_link;
-	stack_t		  uc_stack;
+	unsigned int	  uc_flags;
+	unsigned int 	  uc_link;
+	stack_ia32_t	  uc_stack;
 	struct sigcontext_ia32 uc_mcontext;
 	sigset_t	  uc_sigmask;	/* mask last for extensibility */
 };
@@ -343,8 +349,8 @@
  *  IA32 floating point control registers starting values
  */
 
-#define IA32_FSR_DEFAULT	0x55550000	/* set all tag bits */
-#define IA32_FCR_DEFAULT	0x33f		/* single precision, all masks */
+#define IA32_FSR_DEFAULT	0x55550000		/* set all tag bits */
+#define IA32_FCR_DEFAULT	0x17800000037fULL	/* extended precision, all masks */
 
 #define IA32_PTRACE_GETREGS	12
 #define IA32_PTRACE_SETREGS	13
include/asm-ia64/page.h +6 -0
diff -urN linux-davidm/include/asm-ia64/page.h linux-2.4.0-test1-lia/include/asm-ia64/page.h
@@ -127,6 +127,12 @@
 #define __pa(x)		({ia64_va _v; _v.l = (long) (x); _v.f.reg = 0; _v.l;})
 #define __va(x)		({ia64_va _v; _v.l = (long) (x); _v.f.reg = -1; _v.p;})
 
+#define REGION_NUMBER(x)	({ia64_va _v; _v.l = (long) (x); _v.f.reg;})
+#define REGION_OFFSET(x)	({ia64_va _v; _v.l = (long) (x); _v.f.off;})
+
+#define REGION_SIZE		REGION_NUMBER(1)
+#define REGION_KERNEL	7
+
 #define BUG() do { printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); *(int *)0=0; } while (0)
 #define PAGE_BUG(page) do { BUG(); } while (0)
 
include/asm-ia64/pal.h +1 -1
diff -urN linux-davidm/include/asm-ia64/pal.h linux-2.4.0-test1-lia/include/asm-ia64/pal.h
@@ -951,7 +951,7 @@
 /* Return information about processor's optional power management capabilities. */
 extern inline s64 
 ia64_pal_halt_info (pal_power_mgmt_info_u_t *power_buf) 
-{	
+{
 	struct ia64_pal_retval iprv;
 	PAL_CALL_STK(iprv, PAL_HALT_INFO, (unsigned long) power_buf, 0, 0);
 	return iprv.status; 
include/asm-ia64/processor.h +5 -1
diff -urN linux-davidm/include/asm-ia64/processor.h linux-2.4.0-test1-lia/include/asm-ia64/processor.h
@@ -10,6 +10,7 @@
  *
  * 11/24/98	S.Eranian	added ia64_set_iva()
  * 12/03/99	D. Mosberger	implement thread_saved_pc() via kernel unwind API
+ * 06/16/00	A. Mallick	added csd/ssd/tssd for ia32 support
  */
 
 #include <linux/config.h>
@@ -291,10 +292,13 @@
 	__u64 fcr;			/* IA32 floating pt control reg */
 	__u64 fir;			/* IA32 fp except. instr. reg */
 	__u64 fdr;			/* IA32 fp except. data reg */
+	__u64 csd;			/* IA32 code selector descriptor */
+	__u64 ssd;			/* IA32 stack selector descriptor */
+	__u64 tssd;			/* IA32 TSS descriptor */
 	union {
 		__u64 sigmask;		/* aligned mask for sigsuspend scall */
 	} un;
-# define INIT_THREAD_IA32	, 0, 0, 0, 0, 0, {0}
+# define INIT_THREAD_IA32	, 0, 0, 0x17800000037fULL, 0, 0, 0, 0, 0, {0}
 #else
 # define INIT_THREAD_IA32
 #endif /* CONFIG_IA32_SUPPORT */
include/asm-ia64/ptrace.h +3 -2
diff -urN linux-davidm/include/asm-ia64/ptrace.h linux-2.4.0-test1-lia/include/asm-ia64/ptrace.h
@@ -136,8 +136,8 @@
 	unsigned long r30;		/* scratch */
 	unsigned long r31;		/* scratch */
 
-	unsigned long ar_ccv;		/* compare/exchange value  */
-	unsigned long ar_fpsr;		/* floating point status*/
+	unsigned long ar_ccv;		/* compare/exchange value (scratch) */
+	unsigned long ar_fpsr;		/* floating point status (preserved) */
 
 	unsigned long b0;		/* return pointer (bp) */
 	unsigned long b7;		/* scratch */
@@ -219,6 +219,7 @@
   extern void show_regs (struct pt_regs *);
   extern long ia64_peek (struct pt_regs *, struct task_struct *, unsigned long addr, long *val);
   extern long ia64_poke (struct pt_regs *, struct task_struct *, unsigned long addr, long val);
+  extern void ia64_sync_fph (struct task_struct *t);
 
 #ifdef CONFIG_IA64_NEW_UNWIND
   /* get nat bits for scratch registers such that bit N=1 iff scratch register rN is a NaT */
include/asm-ia64/stat.h +21 -0
diff -urN linux-davidm/include/asm-ia64/stat.h linux-2.4.0-test1-lia/include/asm-ia64/stat.h
@@ -7,6 +7,27 @@
  */
 
 struct stat {
+	unsigned long	st_dev;
+	unsigned long	st_ino;
+	unsigned long	st_nlink;
+	unsigned int	st_mode;
+	unsigned int	st_uid;
+	unsigned int	st_gid;
+	unsigned int	__pad0;
+	unsigned long	st_rdev;
+	unsigned long	st_size;
+	unsigned long	st_atime;
+	unsigned long	__reserved0;	/* reserved for atime.nanoseconds */
+	unsigned long	st_mtime;
+	unsigned long	__reserved1;	/* reserved for mtime.nanoseconds */
+	unsigned long	st_ctime;
+	unsigned long	__reserved2;	/* reserved for ctime.nanoseconds */
+	unsigned long	st_blksize;
+	long		st_blocks;
+	unsigned long	__unused[3];
+};
+
+struct ia64_oldstat {
 	unsigned int	st_dev;
 	unsigned int	st_ino;
 	unsigned int	st_mode;
include/asm-ia64/unistd.h +6 -3
diff -urN linux-davidm/include/asm-ia64/unistd.h linux-2.4.0-test1-lia/include/asm-ia64/unistd.h
@@ -109,9 +109,9 @@
 #define __NR_syslog			1117
 #define __NR_setitimer			1118
 #define __NR_getitimer			1119
-#define __NR_stat			1120
-#define __NR_lstat			1121
-#define __NR_fstat			1122
+#define __NR_old_stat			1120
+#define __NR_old_lstat			1121
+#define __NR_old_fstat			1122
 #define __NR_vhangup			1123
 #define __NR_lchown			1124
 #define __NR_vm86			1125
@@ -199,6 +199,9 @@
 #define __NR_sys_pivot_root		1207
 #define __NR_mincore			1208
 #define __NR_madvise			1209
+#define __NR_stat			1210
+#define __NR_lstat			1211
+#define __NR_fstat			1212
 
 #if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
 
include/asm-ia64/unwind.h +17 -0
diff -urN linux-davidm/include/asm-ia64/unwind.h linux-2.4.0-test1-lia/include/asm-ia64/unwind.h
@@ -23,6 +23,7 @@
 	UNW_AR_RNAT,
 	UNW_AR_UNAT,
 	UNW_AR_LC,
+	UNW_AR_EC,
 	UNW_AR_FPSR,
 	UNW_AR_RSC,
 	UNW_AR_CCV
@@ -58,6 +59,7 @@
 	unsigned long pr_val;		/* current predicates */
 	unsigned long *cfm;
 
+	struct task_struct *task;
 	struct switch_stack *sw;
 
 	/* preserved state: */
@@ -101,6 +103,9 @@
  */
 extern void unw_init_from_blocked_task (struct unw_frame_info *info, struct task_struct *t);
 
+extern void unw_init_frame_info (struct unw_frame_info *info, struct task_struct *t,
+				 struct switch_stack *sw);
+
 /*
  * Prepare to unwind the current task.  For this to work, the kernel
  * stack identified by REGS must look like this:
@@ -118,10 +123,22 @@
 extern void unw_init_from_current (struct unw_frame_info *info, struct pt_regs *regs);
 
 /*
+ * Prepare to unwind the currently running thread.
+ */
+extern void unw_init_running (void (*callback)(struct unw_frame_info *info, void *arg), void *arg);
+
+/*
  * Unwind to previous to frame.  Returns 0 if successful, negative
  * number in case of an error.
  */
 extern int unw_unwind (struct unw_frame_info *info);
+
+/*
+ * Unwind until the return pointer is in user-land (or until an error
+ * occurs).  Returns 0 if successful, negative number in case of
+ * error.
+ */
+extern int unw_unwind_to_user (struct unw_frame_info *info);
 
 #define unw_get_ip(info,vp)	({*(vp) = (info)->ip; 0;})
 #define unw_get_sp(info,vp)	({*(vp) = (unsigned long) (info)->sp; 0;})