You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(43) |
Nov
(4) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(78) |
Feb
(97) |
Mar
(29) |
Apr
(2) |
May
(22) |
Jun
(38) |
Jul
(11) |
Aug
(27) |
Sep
(40) |
Oct
(2) |
Nov
(17) |
Dec
(8) |
2002 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(480) |
May
(456) |
Jun
(12) |
Jul
|
Aug
(1) |
Sep
|
Oct
(18) |
Nov
(3) |
Dec
(6) |
2003 |
Jan
|
Feb
(18) |
Mar
(1) |
Apr
|
May
(6) |
Jun
(147) |
Jul
(7) |
Aug
(3) |
Sep
(235) |
Oct
(10) |
Nov
(2) |
Dec
(1) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dave A. <ai...@us...> - 2001-11-13 23:41:21
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv7789 Modified Files: sigcontext.h Log Message: DA: for gdb build Index: sigcontext.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/sigcontext.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- sigcontext.h 2001/07/31 17:33:26 1.2 +++ sigcontext.h 2001/11/13 23:41:15 1.3 @@ -1,9 +1,11 @@ #ifndef _ASM_VAX_SIGCONTEXT_H #define _ASM_VAX_SIGCONTEXT_H -/* FIXME: redo this. atp */ -#include <asm/ptrace.h> +/* FIXME: redo this. atp */ +/* D.A. replace ptrace.h with contents of structure.. + * this is so gdb will compile */ +#include <asm/psl.h> //struct sigcontext_struct { // unsigned long _unused[4]; @@ -23,7 +25,23 @@ */ struct sigcontext { - struct pt_regs regs; /* needs to be first */ + unsigned long int r0; + unsigned long int r1; + unsigned long int r2; + unsigned long int r3; + unsigned long int r4; + unsigned long int r5; + unsigned long int r6; + unsigned long int r7; + unsigned long int r8; + unsigned long int r9; + unsigned long int r10; + unsigned long int r11; /* note: we keep current in r11 */ + unsigned long int ap; + unsigned long int fp; + unsigned long int sp; + unsigned long int pc; + struct psl_fields psl; unsigned long oldmask; unsigned long usp; /* usp before stacking this gunk on it */ }; |
From: Dave A. <ai...@us...> - 2001-11-13 23:34:24
|
Update of /cvsroot/linux-vax/kernel-2.4 In directory usw-pr-cvs1:/tmp/cvs-serv6237 Modified Files: Makefile Log Message: DA: update version Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Makefile 2001/07/31 17:50:26 1.12 +++ Makefile 2001/11/13 23:34:21 1.13 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 2 -EXTRAVERSION = -20010307 +EXTRAVERSION = -20011113 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |
From: Dave A. <ai...@us...> - 2001-11-13 23:31:21
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv5459 Modified Files: ptrace.c Log Message: DA: ptrace fixes for segfault Index: ptrace.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/ptrace.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ptrace.c 2001/11/09 23:48:40 1.4 +++ ptrace.c 2001/11/13 23:31:16 1.5 @@ -28,17 +28,49 @@ #include <asm/system.h> #include <asm/uaccess.h> +#define VAX_MAX_DIST_BETWEEN_PC 20 +/* + * search out does damn regs.. that variable length exception info is evil I + * tell you evil. + */ +static struct pt_regs *ptrace_find_vax_regs(struct task_struct *child) +{ + struct pt_regs *regs_ptr; + unsigned long *pc1, *pc2; + void *stack_top; + + stack_top = ((union task_union *)child)+1; + stack_top -= 4; + + + pc1 = (unsigned long *)stack_top - 2; + pc2 = pc1; + + //printk("pc1 is %8lX at %8lX\n", *pc1, pc1); + /* back step looking for second copy of PC */ + do { + pc2 -= 1; + } while (*pc1!=*pc2 && pc1-pc2<VAX_MAX_DIST_BETWEEN_PC); + + //printk("difference is %d\n", pc1-pc2); + + if (pc1-pc2>=VAX_MAX_DIST_BETWEEN_PC) + return NULL; + + regs_ptr = ((void *)pc2) + 8 - sizeof(struct pt_regs); + + return regs_ptr; +} + static int putreg(struct task_struct *child, unsigned long regno, unsigned long value) { unsigned long retval = ~0UL; - void *stack_top; struct pt_regs *regs_ptr; - - stack_top = ((union task_union *)child)+1; - stack_top -= 4; - regs_ptr = stack_top - 16 - sizeof(struct pt_regs); + regs_ptr = ptrace_find_vax_regs(child); + if (!regs_ptr) + return 0; switch(regno >> 2) { case 0 ... 16: @@ -59,18 +91,12 @@ unsigned long regno) { unsigned long retval = ~0UL; - void *stack_top; struct pt_regs *regs_ptr; - stack_top = ((union task_union *)child)+1; - stack_top -= 4; - - /* get the registers from where we shoved them on the stack at the last - exception for this process.. not sure if this is always correct but - will do for now - 4 longwords back from end of stack is end of regs */ - - regs_ptr = stack_top - 16 - sizeof(struct pt_regs); - + /* call helper function to get registers for the VAX */ + regs_ptr = ptrace_find_vax_regs(child); + if (!regs_ptr) + return 0; switch(regno >> 2) { case 0 ... 16: @@ -81,6 +107,7 @@ retval=0; break; } +// printk("getreg for %d returned %8lX\n", regno>>2, retval); return retval; } |
From: Dave A. <ai...@us...> - 2001-11-12 23:54:51
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/vsbus In directory usw-pr-cvs1:/tmp/cvs-serv22894 Modified Files: vsbus.c Log Message: DA: make ka42 more solid with 1 second sleep Index: vsbus.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/vsbus/vsbus.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- vsbus.c 2001/11/11 22:43:25 1.6 +++ vsbus.c 2001/11/12 23:54:44 1.7 @@ -34,7 +34,7 @@ sys_vs.vs_cpu_ptr->vc_intmsk=0; sys_vs.vs_cpu_ptr->vc_intclr=0xFF; // printk("vsbus: Getting Interrupt Mask\n"); - mdelay(1); + mdelay(1000); sys_vs.vs_mask=sys_vs.vs_cpu_ptr->vc_intreq; /* switch off all interrupts for now */ |
From: Dave A. <ai...@us...> - 2001-11-11 22:43:28
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/vsbus In directory usw-pr-cvs1:/tmp/cvs-serv558 Modified Files: vsbus.c Log Message: DA: vsbus changes for 4000/60... need testing on 3100/m38 Index: vsbus.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/vsbus/vsbus.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- vsbus.c 2001/09/16 15:13:09 1.5 +++ vsbus.c 2001/11/11 22:43:25 1.6 @@ -27,26 +27,27 @@ unsigned long irqs; sys_vs.vs_cpu_ptr=(void *)ioremap(VSA_BASE_REGS, 128); - + sys_vs.vs_mask=sys_vs.vs_cpu_ptr->vc_intreq; + printk("vsbus: interrupt mask %x\n", sys_vs.vs_mask); irqs=probe_irq_on(); sys_vs.vs_cpu_ptr->vc_intmsk=0; sys_vs.vs_cpu_ptr->vc_intclr=0xFF; // printk("vsbus: Getting Interrupt Mask\n"); - udelay(100000); + mdelay(1); sys_vs.vs_mask=sys_vs.vs_cpu_ptr->vc_intreq; - sys_vs.vs_cpu_ptr->vc_intmsk=0; /*~sys_vs.vs_mask;*/ + /* switch off all interrupts for now */ + sys_vs.vs_cpu_ptr->vc_intmsk=0; /*~sys_vs.vs_mask;*/ probe_irq_off(irqs); printk("vsbus: interrupt mask %x\n", sys_vs.vs_mask); - return 0; } int vsbus_enable_int(int bit_nr) { sys_vs.vs_cpu_ptr->vc_intmsk|=1<<bit_nr; - + sys_vs.vs_enabled |= 1<< bit_nr; return 0; } @@ -60,24 +61,26 @@ int vsbus_disable_int(int bit_nr) { sys_vs.vs_cpu_ptr->vc_intmsk&=~(1<<bit_nr); + sys_vs.vs_enabled &= ~(1<<bit_nr); return 0; } int vsbus_probe_irq_on(void) { printk("vsbus: probing set mask ~%2X\n", sys_vs.vs_mask); - sys_vs.vs_cpu_ptr->vc_intmsk = sys_vs.vs_mask; + sys_vs.vs_cpu_ptr->vc_intmsk = 0; //~sys_vs.vs_mask; sys_vs.vs_cpu_ptr->vc_intclr=0xff; return 0; } unsigned char vsbus_probe_irq_report(void) { - unsigned char x, y; - + unsigned char x, y; + x=sys_vs.vs_cpu_ptr->vc_intreq; y = x & ~sys_vs.vs_mask; printk("vsbus: probe returning %2X, %2X\n", x, ffs(y)); + sys_vs.vs_cpu_ptr->vc_intmsk = sys_vs.vs_enabled; return ffs(y)-1; } |
From: Dave A. <ai...@us...> - 2001-11-11 22:42:43
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv32542 Modified Files: dz.c Log Message: DA: dz.c fixes for 4000/60 .. need to test on 3100m38 Index: dz.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/dz.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- dz.c 2001/09/21 20:54:16 1.10 +++ dz.c 2001/11/11 22:42:39 1.11 @@ -1444,10 +1444,11 @@ #ifndef CONFIG_SERIAL_CONSOLE dz_out(info, DZ_CSR, DZ_CLR); while ((tmp = dz_in(info,DZ_CSR)) & DZ_CLR) ; +#ifndef CONFIG_VAX wbflush(); +#endif - /* enable scanning */ - dz_out(info, DZ_CSR, DZ_MSE); + #endif /* order matters here... the trick is that flags @@ -1464,9 +1465,9 @@ i = dz_in(info, DZ_TCR); dz_out(info, DZ_CSR, DZ_MSE|DZ_TIE); dz_out(info, DZ_TCR, 0); - udelay(1000); + mdelay(1); dz_out(info, DZ_TCR, 1); - udelay(10000); + mdelay(10); dz_out(info, DZ_TCR, i); num=vsbus_probe_irq_report(); irq=autoirq_report(0); @@ -1482,13 +1483,13 @@ i = dz_in(info, DZ_TCR); dz_out(info, DZ_CSR, DZ_MSE|DZ_TIE); dz_out(info, DZ_TCR, 0); - udelay(1000); + mdelay(1); dz_out(info, DZ_TCR, 1); - udelay(10000); + mdelay(10); dz_out(info, DZ_TCR, i); vsbus_clear_int(num); vsbus_disable_int(num); - irq=autoirq_report(100); + irq=autoirq_report(0); } #else if (is_ka46()){ @@ -1512,7 +1513,8 @@ if (request_irq (SERIAL, dz_interrupt_rx, SA_INTERRUPT, "DZ", lines[0])) panic ("Unable to register DZ interrupt\n"); #endif - + /* enable scanning */ + dz_out(info, DZ_CSR, DZ_MSE); return 0; } @@ -1544,6 +1546,9 @@ /* Actually transmit the character. */ dz_out (dz_console, DZ_TDR, tmp); + /* spin our wheels */ + while (((dz_in(dz_console,DZ_CSR) & DZ_TRDY) != DZ_TRDY) && loops--) + ; dz_out(dz_console, DZ_TCR, tcr); restore_flags(flags); } @@ -1650,13 +1655,12 @@ dz_console->line = CONSOLE_LINE; /* This line locks up Dave Airlie's VS3100m38 after HALT */ - /* dz_out(dz_console, DZ_CSR, DZ_CLR); */ +#ifndef CONFIG_VAX + dz_out(dz_console, DZ_CSR, DZ_CLR); +#endif while ((tmp = dz_in(dz_console,DZ_CSR)) & DZ_CLR) ; - - /* enable scanning */ - dz_out(dz_console, DZ_CSR, DZ_MSE); /* Set up flags... */ dz_console->cflags = co->cflag; |
From: Dave A. <ai...@us...> - 2001-11-11 21:33:17
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net In directory usw-pr-cvs1:/tmp/cvs-serv8531 Modified Files: vaxlance.c Log Message: DA: move to mdelay rather than udelay Index: vaxlance.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/vaxlance.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- vaxlance.c 2001/09/16 15:13:09 1.17 +++ vaxlance.c 2001/11/11 21:33:14 1.18 @@ -1024,7 +1024,7 @@ writereg(&ll->rap, LE_CSR0); writereg(&ll->rdp, LE_C0_INEA|LE_C0_INIT); writecsr0(ll, LE_C0_INEA|LE_C0_INIT); - udelay(1000); + mdelay(1); num=vsbus_probe_irq_report(); irq=autoirq_report(0); if (num) |
From: Dave A. <ai...@us...> - 2001-11-09 23:48:44
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv15389 Modified Files: interrupt.c interrupt.h ptrace.c Log Message: DA: ptrace singlestep and trace exception support Index: interrupt.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/interrupt.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- interrupt.c 2001/10/28 23:54:18 1.21 +++ interrupt.c 2001/11/09 23:48:40 1.22 @@ -196,6 +196,11 @@ printk("Panic: unable to register breakpoint handler\n"); machine_halt(); } + + if (register_excep_handler(SCB_TPEND,"Trace Pending (tpend_handler)", tpend_handler, 0, 0)) { + printk("Panic: unable to register trace pending handler\n"); + machine_halt(); + } } @@ -256,21 +261,56 @@ /* This is the handler for break points */ void bpt_handler(struct pt_regs *regs, void *unused) { + siginfo_t info; +#if 0 printk("\nbp sending SIGTRAP\n"); + + printk("\nBreakpoint at PC=%08lx at %08lX\n", regs->pc, ®s->pc); + + printk("\nStack dump\n"); + hex_dump((void *)(regs->sp), 256); + show_regs(regs); + show_cpu_regs(); +#endif + if (user_mode(regs)) { + info.si_signo = SIGTRAP; + info.si_errno = 0; + info.si_code = TRAP_BRKPT; + info.si_addr = regs->pc; + force_sig_info(SIGTRAP,&info,current); + return; + } + machine_halt(); + + force_sig(SIGTRAP, current); +} + +/* This is the handler for break points */ +void tpend_handler(struct pt_regs *regs, void *unused) +{ + siginfo_t info; + + regs->psl.t=0; + #if 0 - printk("\nBreakpoint at PC=%08lx\n", regs->pc); + printk("\ntpend sending SIGTRAP\n"); + printk("\nTrace Pending at PC=%08lx at %08lX\n", regs->pc, ®s->pc); printk("\nStack dump\n"); hex_dump((void *)(regs->sp), 256); show_regs(regs); show_cpu_regs(); +#endif if (user_mode(regs)) { - force_sig(SIGTRAP,current); + info.si_signo = SIGTRAP; + info.si_errno = 0; + info.si_code = TRAP_BRKPT; + info.si_addr = regs->pc; + force_sig_info(SIGTRAP,&info,current); return; } machine_halt(); -#endif force_sig(SIGTRAP, current); } @@ -386,9 +426,10 @@ status = 1; /* Force the "do bottom halves" bit */ + action = &vec->action; vec_num = vec->vec_num; - + status |= action->flags; action->handler(vec_num, action->dev_id, regs); @@ -403,7 +444,7 @@ static inline void do_irq(struct pt_regs *regs, struct irqvector *vec) { - int flags; + int flags; int status; int cpu; /* Fake a single-priority-level interrupt system by raising IPL Index: interrupt.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/interrupt.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- interrupt.h 2001/10/28 23:54:18 1.7 +++ interrupt.h 2001/11/09 23:48:40 1.8 @@ -68,3 +68,4 @@ extern void resam_handler(struct pt_regs *regs, void *unused); extern void arith_handler(struct pt_regs *regs, void *excep_info); extern void bpt_handler(struct pt_regs *regs, void *excep_info); +extern void tpend_handler(struct pt_regs *regs, void *excep_info); Index: ptrace.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/ptrace.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ptrace.c 2001/11/08 22:17:16 1.3 +++ ptrace.c 2001/11/09 23:48:40 1.4 @@ -40,7 +40,6 @@ regs_ptr = stack_top - 16 - sizeof(struct pt_regs); - printk("putreg called with regno %d\n", regno>>2); switch(regno >> 2) { case 0 ... 16: // retval = *(((unsigned long *)regs_ptr) + (regno>>2)); @@ -82,7 +81,6 @@ retval=0; break; } - printk("getreg returning %8lX\n", retval); return retval; } @@ -93,7 +91,7 @@ extern void save_fp(void*); lock_kernel(); -#if 1 +#if 0 printk("ptrace(r=%d,pid=%d,addr=%08lx,data=%08lx)\n", (int) request, (int) pid, (unsigned long) addr, (unsigned long) data); @@ -182,7 +180,6 @@ unsigned long tmp; res = -EIO; - printk("Addr is %8lX, sizeof is %8lX\n", addr, sizeof(struct user)); if ((addr & 3) || addr < 0 || addr > sizeof(struct user)-3) break; @@ -204,7 +201,7 @@ goto out; case PTRACE_POKEUSR: { - struct pt_regs *regs; + // struct pt_regs *regs; int res = 0; res = -EIO; if ((addr & 3) || addr < 0 || @@ -250,6 +247,29 @@ wake_up_process(child); break; + case PTRACE_SINGLESTEP: + { + unsigned long tmp; + struct psl_fields *psl; + res = -EIO; + if ((unsigned long) data > _NSIG) + break; + child->ptrace &= ~ PT_TRACESYS; + if ((child->ptrace & PT_DTRACE)==0) + child->ptrace |= PT_DTRACE; + + tmp = getreg(child, PT_PSL<<2); + psl = &tmp; + psl->t=1; + putreg(child, PT_PSL<<2, *(unsigned long *)psl); + // printk("tmp is %8lX, psl is now %8lX\n", tmp, *(unsigned long *)psl); + + + child->exit_code=data; + wake_up_process(child); + res = 0; + break; + } case PTRACE_DETACH: /* detach a process that was attached. */ res = -EIO; if ((unsigned long) data > _NSIG) |
From: Dave A. <ai...@us...> - 2001-11-08 22:17:21
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv8907 Modified Files: ptrace.c Log Message: DA: ptrace getreg/putreg should be more functional if not correct Index: ptrace.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/ptrace.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ptrace.c 2001/11/04 21:58:32 1.2 +++ ptrace.c 2001/11/08 22:17:16 1.3 @@ -31,16 +31,21 @@ static int putreg(struct task_struct *child, unsigned long regno, unsigned long value) { - printk("putreg called with regno %d\n", regno); + unsigned long retval = ~0UL; + void *stack_top; + struct pt_regs *regs_ptr; + + stack_top = ((union task_union *)child)+1; + stack_top -= 4; + + regs_ptr = stack_top - 16 - sizeof(struct pt_regs); + + printk("putreg called with regno %d\n", regno>>2); switch(regno >> 2) { - case 0 ... 13: - *(unsigned long *)((&child->thread.pcb)+4+(regno>>2))=value; - break; - case PT_SP: - child->thread.pcb.usp=value; - break; - case PT_PC: - child->thread.pcb.pc=value; + case 0 ... 16: + // retval = *(((unsigned long *)regs_ptr) + (regno>>2)); + *(((unsigned long *)regs_ptr) + (regno>>2)) = value; + // *(unsigned long *)((&child->thread.pcb)+4+(regno>>2))=value; break; default: printk("putreg for %d failed\n", regno); @@ -55,27 +60,23 @@ unsigned long regno) { unsigned long retval = ~0UL; + void *stack_top; + struct pt_regs *regs_ptr; + + stack_top = ((union task_union *)child)+1; + stack_top -= 4; - /* this code takes the register from the PCB for the process. PC is reg 15 but 14'th after R0 in - the pcb so it is special cased. have to add some stack pointers at some stage */ + /* get the registers from where we shoved them on the stack at the last + exception for this process.. not sure if this is always correct but + will do for now - 4 longwords back from end of stack is end of regs */ + + regs_ptr = stack_top - 16 - sizeof(struct pt_regs); + + switch(regno >> 2) { - case 0 ... 13: - retval = (unsigned long)*(unsigned long *)((&child->thread.pcb)+4+(regno>>2)); - break; - case PT_SP: - retval = child->thread.pcb.usp; - break; - case PT_PC: - { - int i; - struct pt_regs regs; - - // hex_dump((void *)(child->thread.pcb.ksp-0x80), 256); - // printk("ksp:%8lX ap:%8lX fp:%8lX\n", child->thread.pcb.ksp, child->thread.pcb.ap, child->thread.pcb.ksp+0x64); - /* FIXME: explain 0x64 == 100 = 25 * 4 pc is stored 25 longs into stack.... */ - retval = (unsigned long)*(unsigned long *)(child->thread.pcb.ksp + 0x64); + case 0 ... 16: + retval = *(((unsigned long *)regs_ptr) + (regno>>2)); break; - } default: printk("getreg for %d failed\n", regno); retval=0; |
From: Dave A. <ai...@us...> - 2001-11-04 21:58:37
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv29714 Modified Files: ptrace.c Log Message: DA: better ptrace for finding PC .. needs more explains Index: ptrace.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/ptrace.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ptrace.c 2001/10/28 23:54:18 1.1 +++ ptrace.c 2001/11/04 21:58:32 1.2 @@ -8,6 +8,7 @@ * Copyright (C) Linus Torvalds * Copyright (C) 1994, 1995, 1996, 1997, 1998 Ralf Baechle * Copyright (C) 1996 David S. Miller + * Copyright (C) 2001 David Airlie, VAX Porting Project */ #include <linux/kernel.h> #include <linux/sched.h> @@ -63,9 +64,18 @@ break; case PT_SP: retval = child->thread.pcb.usp; + break; case PT_PC: - retval = child->thread.pcb.pc; + { + int i; + struct pt_regs regs; + + // hex_dump((void *)(child->thread.pcb.ksp-0x80), 256); + // printk("ksp:%8lX ap:%8lX fp:%8lX\n", child->thread.pcb.ksp, child->thread.pcb.ap, child->thread.pcb.ksp+0x64); + /* FIXME: explain 0x64 == 100 = 25 * 4 pc is stored 25 longs into stack.... */ + retval = (unsigned long)*(unsigned long *)(child->thread.pcb.ksp + 0x64); break; + } default: printk("getreg for %d failed\n", regno); retval=0; |
From: Dave A. <ai...@us...> - 2001-10-28 23:55:40
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv8501 Modified Files: ptrace.h Log Message: DA: reg defs .. Index: ptrace.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/ptrace.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- ptrace.h 2001/07/31 17:33:26 1.3 +++ ptrace.h 2001/10/28 23:55:36 1.4 @@ -3,6 +3,25 @@ #define _VAX_PTRACE_H #include <asm/psl.h> + +#define PT_R0 0 +#define PT_R1 1 +#define PT_R2 2 +#define PT_R3 3 +#define PT_R4 4 +#define PT_R5 5 +#define PT_R6 6 +#define PT_R7 7 +#define PT_R8 8 +#define PT_R9 9 +#define PT_R10 10 +#define PT_R11 11 +#define PT_AP 12 +#define PT_FP 13 +#define PT_SP 14 +#define PT_PC 15 +#define PT_PSL 16 +#define PT_USP 20 /* this struct defines the way the registers are stored on the stack during a system call. */ |
From: Dave A. <ai...@us...> - 2001-10-28 23:54:21
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv8312 Modified Files: process.c interrupt.c interrupt.h Makefile Added Files: ptrace.c Log Message: DA: add initial ptrace support --- NEW FILE --- /* $Id: ptrace.c,v 1.1 2001/10/28 23:54:18 airlied Exp $ * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1992 Ross Biro * Copyright (C) Linus Torvalds * Copyright (C) 1994, 1995, 1996, 1997, 1998 Ralf Baechle * Copyright (C) 1996 David S. Miller */ #include <linux/kernel.h> #include <linux/sched.h> #include <linux/mm.h> #include <linux/errno.h> #include <linux/ptrace.h> #include <linux/smp.h> #include <linux/smp_lock.h> #include <linux/user.h> #if 0 #include <asm/fp.h> #include <asm/mipsregs.h> #endif #include <asm/pgtable.h> #include <asm/page.h> #include <asm/system.h> #include <asm/uaccess.h> static int putreg(struct task_struct *child, unsigned long regno, unsigned long value) { printk("putreg called with regno %d\n", regno); switch(regno >> 2) { case 0 ... 13: *(unsigned long *)((&child->thread.pcb)+4+(regno>>2))=value; break; case PT_SP: child->thread.pcb.usp=value; break; case PT_PC: child->thread.pcb.pc=value; break; default: printk("putreg for %d failed\n", regno); break; } return 0; } static unsigned long getreg(struct task_struct *child, unsigned long regno) { unsigned long retval = ~0UL; /* this code takes the register from the PCB for the process. PC is reg 15 but 14'th after R0 in the pcb so it is special cased. have to add some stack pointers at some stage */ switch(regno >> 2) { case 0 ... 13: retval = (unsigned long)*(unsigned long *)((&child->thread.pcb)+4+(regno>>2)); break; case PT_SP: retval = child->thread.pcb.usp; case PT_PC: retval = child->thread.pcb.pc; break; default: printk("getreg for %d failed\n", regno); retval=0; break; } printk("getreg returning %8lX\n", retval); return retval; } asmlinkage int sys_ptrace(long request, long pid, long addr, long data) { struct task_struct *child; int res; extern void save_fp(void*); lock_kernel(); #if 1 printk("ptrace(r=%d,pid=%d,addr=%08lx,data=%08lx)\n", (int) request, (int) pid, (unsigned long) addr, (unsigned long) data); #endif if (request == PTRACE_TRACEME) { /* are we already being traced? */ if (current->ptrace & PT_PTRACED) { res = -EPERM; goto out; } /* set the ptrace bit in the process flags. */ current->ptrace |= PT_PTRACED; res = 0; goto out; } res = -ESRCH; read_lock(&tasklist_lock); child = find_task_by_pid(pid); if (child) get_task_struct(child); read_unlock(&tasklist_lock); if (!child) goto out; res = -EPERM; if (pid == 1) /* you may not mess with init */ goto out; if (request == PTRACE_ATTACH) { if (child == current) goto out_tsk; if ((!child->dumpable || (current->uid != child->euid) || (current->uid != child->suid) || (current->uid != child->uid) || (current->gid != child->egid) || (current->gid != child->sgid) || (current->gid != child->gid) || (!cap_issubset(child->cap_permitted, current->cap_permitted)) || (current->gid != child->gid)) && !capable(CAP_SYS_PTRACE)) goto out_tsk; /* the same process cannot be attached many times */ if (child->ptrace & PT_PTRACED) goto out_tsk; child->ptrace |= PT_PTRACED; write_lock_irq(&tasklist_lock); if (child->p_pptr != current) { REMOVE_LINKS(child); child->p_pptr = current; SET_LINKS(child); } write_unlock_irq(&tasklist_lock); send_sig(SIGSTOP, child, 1); res = 0; goto out_tsk; } res = -ESRCH; if (!(child->ptrace & PT_PTRACED)) goto out_tsk; if (child->state != TASK_STOPPED) { if (request != PTRACE_KILL) goto out_tsk; } if (child->p_pptr != current) goto out_tsk; switch (request) { case PTRACE_PEEKTEXT: /* read word at location addr. */ case PTRACE_PEEKDATA: { unsigned long tmp; int copied; copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0); res = -EIO; if (copied != sizeof(tmp)) break; res = put_user(tmp,(unsigned long *) data); goto out; } /* Read the word at location addr in the USER area. */ case PTRACE_PEEKUSR: { unsigned long tmp; res = -EIO; printk("Addr is %8lX, sizeof is %8lX\n", addr, sizeof(struct user)); if ((addr & 3) || addr < 0 || addr > sizeof(struct user)-3) break; tmp=0; if (addr < 16*sizeof(unsigned long)) tmp = getreg(child, addr); res = put_user(tmp, (unsigned long *) data); goto out; } case PTRACE_POKETEXT: /* write the word at location addr. */ case PTRACE_POKEDATA: res = 0; if (access_process_vm(child, addr, &data, sizeof(data), 1) == sizeof(data)) break; res = -EIO; goto out; case PTRACE_POKEUSR: { struct pt_regs *regs; int res = 0; res = -EIO; if ((addr & 3) || addr < 0 || addr > sizeof(struct user) - 3) break; if (addr < 17*sizeof(long)) { res = putreg(child, addr, data); break; } /* We need to be very careful here. We implicitly want to modify a portion of the task_struct, and we have to be selective about what portions we allow someone to modify. */ break; } case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ case PTRACE_CONT: { /* restart after signal. */ res = -EIO; if ((unsigned long) data > _NSIG) break; if (request == PTRACE_SYSCALL) child->ptrace |= PT_TRACESYS; else child->ptrace &= ~PT_TRACESYS; child->exit_code = data; wake_up_process(child); res = 0; break; } /* * make the child exit. Best I can do is send it a sigkill. * perhaps it should be put in the status that it wants to * exit. */ case PTRACE_KILL: res = 0; if (child->state != TASK_ZOMBIE) /* already dead */ break; child->exit_code = SIGKILL; wake_up_process(child); break; case PTRACE_DETACH: /* detach a process that was attached. */ res = -EIO; if ((unsigned long) data > _NSIG) break; child->ptrace &= ~(PT_PTRACED|PT_TRACESYS); child->exit_code = data; write_lock_irq(&tasklist_lock); REMOVE_LINKS(child); child->p_pptr = child->p_opptr; SET_LINKS(child); write_unlock_irq(&tasklist_lock); wake_up_process(child); res = 0; break; default: res = -EIO; goto out; } out_tsk: free_task_struct(child); out: unlock_kernel(); return res; } asmlinkage void syscall_trace(void) { if ((current->ptrace & (PT_PTRACED|PT_TRACESYS)) != (PT_PTRACED|PT_TRACESYS)) return; current->exit_code = SIGTRAP; current->state = TASK_STOPPED; notify_parent(current, SIGCHLD); schedule(); /* * this isn't the same as continuing with a signal, but it will do * for normal use. strace only continues with a signal if the * stopping signal is not SIGTRAP. -brl */ if (current->exit_code) { send_sig(current->exit_code, current, 1); current->exit_code = 0; } } Index: process.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/process.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- process.c 2001/09/22 19:44:18 1.14 +++ process.c 2001/10/28 23:54:18 1.15 @@ -122,7 +122,6 @@ // printk("copy_thread: pid %d, task 0x%08lx, kstack_top 0x%8lx, usp 0x%08lx, ksp 0x%08lx\n", // p->pid, (unsigned long)p, stack_top, usp, child_stack); - child_regs = &child_stack->regs; *child_regs = *regs; @@ -217,11 +216,6 @@ int sys_vfork(struct pt_regs *regs) { return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->sp, regs, 0); -} - -int sys_ptrace(long request, long pid, long addr, long data) -{ - return -ENOSYS; } /* Index: interrupt.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/interrupt.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- interrupt.c 2001/09/16 15:23:20 1.20 +++ interrupt.c 2001/10/28 23:54:18 1.21 @@ -192,6 +192,10 @@ printk("Panic: unable to register arithmetic fault handler\n"); machine_halt(); } + if (register_excep_handler(SCB_BPT,"Breakpoint fault (bpt_handler)", bpt_handler, 0, 0)) { + printk("Panic: unable to register breakpoint handler\n"); + machine_halt(); + } } @@ -249,6 +253,26 @@ machine_halt(); } +/* This is the handler for break points */ +void bpt_handler(struct pt_regs *regs, void *unused) +{ + printk("\nbp sending SIGTRAP\n"); +#if 0 + printk("\nBreakpoint at PC=%08lx\n", regs->pc); + + printk("\nStack dump\n"); + hex_dump((void *)(regs->sp), 256); + show_regs(regs); + show_cpu_regs(); + + if (user_mode(regs)) { + force_sig(SIGTRAP,current); + return; + } + machine_halt(); +#endif + force_sig(SIGTRAP, current); +} /* This is the handler for reserved addressing mode exceptions. Eventually this will have to check if the fault was from user @@ -300,8 +324,7 @@ }; void arith_handler(struct pt_regs *regs, void *excep_info) -{ - int code = *(unsigned int *)(excep_info); +{ int code = *(unsigned int *)(excep_info); printk("Arithmetic Fault at PC=%8lx, %s, (code=%x)\n",regs->pc,arith_faults[code],code); /* FIXME: need to code up the info for user handler */ if (user_mode(regs)) { Index: interrupt.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/interrupt.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- interrupt.h 2001/09/06 23:39:42 1.6 +++ interrupt.h 2001/10/28 23:54:18 1.7 @@ -67,3 +67,4 @@ extern void syscall_handler(struct pt_regs *regs, void *excep_info); extern void resam_handler(struct pt_regs *regs, void *unused); extern void arith_handler(struct pt_regs *regs, void *excep_info); +extern void bpt_handler(struct pt_regs *regs, void *excep_info); Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Makefile 2001/03/04 23:44:42 1.7 +++ Makefile 2001/10/28 23:54:18 1.8 @@ -13,7 +13,7 @@ O_TARGET := kernel.o -obj-y := process.o setup.o regdump.o interrupt.o entry.o time.o \ +obj-y := ptrace.o process.o setup.o regdump.o interrupt.o entry.o time.o \ syscall.o signal.o semaphore.o vax_dev_init.o\ init_task.o reboot.o cpu_generic.o \ cpu_ka630.o cpu_ka640.o cpu_ka650.o cpu_ka660.o \ |
From: Dave A. <ai...@us...> - 2001-09-22 19:44:23
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv6723/arch/vax/kernel Modified Files: process.c Log Message: DA: setup AP with current SP .. needed for dynamic loader Index: process.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/process.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- process.c 2001/09/11 19:23:38 1.13 +++ process.c 2001/09/22 19:44:18 1.14 @@ -260,6 +260,7 @@ set_fs(USER_DS); regs->pc = new_pc; regs->sp = new_sp; + regs->ap = new_sp; regs->psl.prevmode = PSL_MODE_USER; regs->psl.accmode = PSL_MODE_USER; /* write the sp into the user stack pointer register */ |
From: Dave A. <ai...@us...> - 2001-09-21 20:54:21
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv14245 Modified Files: dz.c Log Message: DA: hopefully correct fix for dz rx/tx ints Index: dz.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/dz.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- dz.c 2001/09/21 18:04:53 1.9 +++ dz.c 2001/09/21 20:54:16 1.10 @@ -1472,8 +1472,8 @@ irq=autoirq_report(0); if (num) { - dz_vsbus_tx_int=num; - dz_vsbus_rx_int=num+1; + dz_vsbus_rx_int=num; + dz_vsbus_tx_int=num+1; } autoirq_setup(0); |
From: Andy P. <at...@us...> - 2001-09-21 18:04:56
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char In directory usw-pr-cvs1:/tmp/cvs-serv21685 Modified Files: dz.c Log Message: Swap the tx/dx interrupt numbers (hardwired section only) to make things work proper like. Index: dz.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/dz.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- dz.c 2001/09/16 15:13:09 1.8 +++ dz.c 2001/09/21 18:04:53 1.9 @@ -1492,12 +1492,12 @@ } #else if (is_ka46()){ - dz_vsbus_tx_int=4; - dz_vsbus_rx_int=5; + dz_vsbus_tx_int=5; + dz_vsbus_rx_int=4; irq=149; } else { - dz_vsbus_tx_int=6; - dz_vsbus_rx_int=7; + dz_vsbus_tx_int=7; + dz_vsbus_rx_int=6; irq=177; } #endif |
From: Andy P. <at...@us...> - 2001-09-19 13:54:23
|
Update of /cvsroot/linux-vax/kernel/Documentation/vax In directory usw-pr-cvs1:/tmp/cvs-serv26794 Modified Files: memory.txt Added Files: task-memory.txt Log Message: Update documentation to reflect new memory layout for tasks --- NEW FILE --- $Id: task-memory.txt,v 1.1 2001/09/19 13:54:19 atp Exp $ atp Sept 2001 For more details on the memory layout and details of the process page tables, see the memory.txt file in this directory. If you see this message in your system logs, then this file is for you; VAXMM: process 81292000 exceeded TASK_WSMAX (64MB) addr 4000000 VAXMM pte_alloc: sending SIGSEGV to process 81292000 VM: killing process as vax-dec-linux-gcc: Internal compiler error: program as got fatal signal 9 Due to the constraints of the VAX MMU, we need to decide at compile time how much virtual address space to allocate to user processes. The number of processes and the amount of memory is limited by a set of #defines in the file. include/asm-vax/mm/task.h This allows us to size the number of tasks and the amount of virtual address space each one is allowed. Those defines are; TASK_WSMAX This is the "process address space" in P0. This is normal memory. If you run out of RAM, then this is the one to pay attention to. In VMS terms this is like WSMAX. TASK_WSMAX is the sum of TASK_TXTMAX and TASK_MMAPMAX TASK_TXTMAX This is largest program that can be run. The default value is about 6Mb. (Bear in mind that the program size on disk may not reflect its size in memory, as it may have lots of debugging information and other stuff that wont be loaded as a running program. TASK_MMAPMAX This is the memory used for the mmap() system call, and hence to the malloc library routine. This is the amount of address space available for allocation by a running program. The default value is about 58Mb. If you see a warning about WSMAX being exceeded, whilst running a program, this is the one to increase. TASK_STKMAX The amount of address space in the P1 region. This is the amount of stack memory allocated to the process. The default value is 4 Mb. TASK_MAXUPRC The maximum number of user processes allowed to run at any one time. This is like BALSETCNT on VMS. The default value is 64. TASK_WSMAX = TASK_TXTMAX + TASK_MMAPMAX Decide if you want to run bigger programs (increase TXTMAX) or let the programs have more memory (MMAPMAX), or more programs (MAXUPRC). However, don't set the sizes too much larger than you need, as you will lose more RAM to the system page table (and thats unavailable for user processes) the bigger these variables are. Index: memory.txt =================================================================== RCS file: /cvsroot/linux-vax/kernel/Documentation/vax/memory.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- memory.txt 2000/04/16 22:07:18 1.2 +++ memory.txt 2001/09/19 13:54:19 1.3 @@ -1,4 +1,283 @@ $Id$ +ATP 20010910 + +Note: + +This is more a discussion document about the memory map on the vax +architecture. For discussion of VAX memory management, and the compromises +made by this port, and how that affects most people see the file +task-memory.txt in this directory. + +0) Terminology + + PAGE_OFFSET is set to be 0x80000000. So Physical Memory address 0 is + mapped to Virtual address PAGE_OFFSET. This is the start of the + VAX S0 segment, and limits the physical memory to 1024Mb. But, hey, + find me a VAX with more than 1024Mb RAM. + + PAGE_SIZE. A page is 4096 bytes long. + PAGELET_SIZE. A pagelet is 512 bytes long. + + See include/asm-vax/mm/pagelet*.h + + The Hardware page size on a VAX is 512 bytes. Hardware pages + are called pagelets. + + The pagelet layer, implemented in asm-vax/mm/ and arch/vax/mm + (pgalloc.c mostly), groups pages into logical pages of 4096 bytes. + + The rule here is; Any data structure likely to be seen by + arch-independent code uses pages. Any arch-specific code may use + pagelets, but its highly discouraged. There is one exception to + this, which is the S0 part of the process pgd (page directory). + The Linux arch independent code never goes near the S0 page table, + as its unaware that it exists (thankfully). We keep the S0 base + and length pair in pagelets. The P0 and P1 sections base and + length registers are kept in pages, for consistency, and converted + on the fly, when the registers in the PCB (process control block) + are updated. The S0 section is only ever touched at boot, and becomes + frozen by the time processes start. Its only ever touched by + vax arch code. + + A page table entry (pte, type pte_t ) maps a page. Each pte + is in fact a structure (struct pagecluster_t) that describes the + underlying pagelet ptes for that page (hwpte, hwpte_t). + + Why do we have a pagelet layer? Well, its a long story, but it + makes life a lot easier elsewhere. + +1) Memory map. + + The memory map has stabilised a little. Here is what it looks like + sept 2001. I feel that RPB shoud live in a well known place too. + + Virtual Length Description + 80000000 1 page bootmap (mem_map) + 80001000 1Mb-1page Free + 80100000 kern_size Kernel code data and bss sections + SPT_BASE SPT_SIZE Pagelet (512 bytes) aligned start of + system page table. + Length depends on physical memory, plus + other variables - see below. + iomap_base IOMAP_SIZE i/o remapping area. A set of ptes in the + system page table we can use for remapping + device io ports. e.g. microvax prom + registers, ethernet card CSR regs. The + start of this is page aligned (4096 bytes) + vmallocmap_base + VMALLOC_SIZE vmalloc() area. + TASKPTE_START see below TASKPTE area. Stores P0 and P1 page tables + for user processes. Sized at compile time. + See below. + + TASKPTE_END max_pfn*4096 Free (May contain VMB bitmaps on the last page) + +2) System page table. + + The system page table as far as TASKPTE_START is initialised in boot/head.S + the early boot assembly code. The initialisation of iomap and vmalloc should + probably move to mm/init.c. paging_init() in mm/init.c initialises the + remainder, which at present is the task pte area. Once paging_init() has + returned, there are no further alterations to the system page table. + + The following are equivalent. + S0 base register: SPT_BASE, swapper_pg_dir[2].br, pg0. + S0 length register: SPT_LEN, swapper_pg_dir[2].lr + + SPT_SIZE is the size in bytes of the SPT. + + The system page table must be pagelet aligned. + +3) TASKPTE areas. + + An area must be set aside in system space to hold process page tables. + This is the TASKPTE area. This is sized at kernel compile time (currently) + using the variabled defined in include/asm-vax/mm/task.h The task pte area + is composed of TASK_MAXUPRC "slots". Each slot is laid out like this + + name size description + p0pmd 2 pages Fake P0 page mid level directory + p1pmd 2 pages Fake P1 page mid level directory + p0pte set by TASK_WSMAX P0 page table + p1pte set by TASK_STKMAX P1 page table + + Slots are aligned to 8192 bytes. + The page mid level directories are needed because the linux MM code + needs to keep track of which ptes are allocated across the entire + address space. Its easier to fake a page midlevel directory each entry + of which is a 4 byte longword pointing at the relevant part of the + page table. + The TASK_WSMAX define limits how much virtual address space is allocated + to the process P0 region. This is composed of two sections, the text + section and the data section. The amount of address space allocated to + each is defined by TASK_TXTMAX and TASK_MMAPMAX. TASK_STKMAX limits + the amount of P1 space available. + + The need to restrict the virtual address spaces is imposed by the VAX + MM hardware. Each process has potentially 1Gb P0 and 1Gb P1 space + available to it. However, the allocation is not sparse, like it is + on CPUs with a tree structured MMU. If a process allocates a page + 200MB into its P0 space, then we must increase the P0 length register + to include the pte that describes this page at 200MB. That makes all the + intervening addresses in the page table from 0 to 200MB be + part of the P0 page table too. (The PTEs may be invalid, or the + addresses that they would occupy be used by something else, but + they are there as far as the MMU is concerned). + + Once we have mapped all of the intervening space, we can set the page + table base and length registers to the right values to point at the + base of the page table, and the length in ptes, up to 200MB. + + In contrast on an alpha or i386 for example, one only needs to allocate + a single page (plus one more for the pmd if on an alpha) and enter + it into the correct slot in the pgd. + + Additionally, The base and length registers for a P0 page table + point at a region that must be contiguous in S0 space. This makes + expansion hard, as there is a very specific S0 virtual address needed to + map any given address in a P0 pagetable. If that address is already + occupied by something else then either you cannot expand, or you + must move the other user of that virtual address. Thats not + feasible. + + The obvious solution here is to map a P0 or P1 process page table + in its entirety, from 0 to 1024Mb, into S0 space. This avoids + the expansion problem. We just reserve a chunk of S0 address space + for as many P0 and P1 page tables as we need. Each is located in + a specific range of S0 virtual address space. We can then map in + actual physical pages to hold the P0 page table ptes for addresses + on an as needed basis. They just need to be mapped to specific + S0 addresses. + + The problem with that, is that the S0 page table, which manages the + S0 address space, is located in _physical_ memory. The same problems + as above are in place, with the exception that specific physical + addresses are needed. So if we reserve a chunk of virtual address + space, then we are effectively allocating S0 ptes (sptes) that + map that space. One spte maps one page of S0 address space. + If we reserve enough S0 space for the page tables for one process's + P0 and P1 address space (2048MB), then we are reserving + 2048*1024*1024 / 4096 = 524288 pages of P0/1 space + = 524288 P0/1 ptes. + Each pte is 32 bytes in size. So the amount of S0 space we + need to reserve to hold this page table is. + 524288 * 32 = 16 Mb. + 16Mb of S0 space is; + 16 * 1024 * 1024 / 4096 = 4096 pages of S0 space + = 4096 S0 ptes. + Each pte is 32 bytes in size. So the the amount of + physical memory we need to allocate to the S0 page table is; + 4096*32 = 128 kb. + + If we allow 64 processes, then we are tying up; + 64 * 128 = 8Mb + So we have lost a 8 Mb of contiguous physical memory. + + And this is just RAM to hold the S0 page table. This does not + include the allocated pages which hold the P0 page table. + (Admittedly these can be any page returned by __get_free_page(), + so there is no need for contiguity.) + + Most processes have small memory requirements, so this 8 Mb is + mostly unused. Most VAXes have a small amount of RAM. For + later model 3100 series between 8 and 16 Mb is not an + unusual amount of RAM. Earlier systems will typically have + less. We cannot afford to waste this much RAM, so we take the + step of limiting the virtual address spaces to more practical + values. At the time of writing the values were set like this; + + TASK_TXTMAX 6Mb Maximum program size + TASK_MMAPMAX 58Mb Maxumum amount of address space + available for allocation. + TASK_STKMAX 4Mb Maximum stack size + TASK_MAXUPRC 64 Maximum number of processes + + Which allows large programs like gcc to run with some headroom. + + The space taken up by the process page tables with these + values is; + 68 * 1024 * 1024 / 4096 = 17408 P0/1 pages + = 17408 P0/1 ptes + 17408 * 32 = 544 kb S0 space + 544 *1024 / 4096 = 136 S0 pages + = 136 S0 ptes. + 136 * 32 = 4352 bytes of RAM. + for 64 processes, this is = 272 Kb. + + Which is not that much. The S0 page table needs to be allocated + in a block of contiguous physical memory, so we allocate it + in its entirety right at the start of the boot process. + + I suppose it is theoretically possible to shift pages around + and expand the S0 page table, on a running system, but I think + it would be nigh on impossible to backtrace the users of a + given physical page. One could swap out all the pages needed, + but doing that whilst in the middle of modifying the system + page table is prone to error to say the least. That just + leaves the problem of shuffling things around in the S0 + virtual address space to expand the process page tables. + + However, all the systems I know of on the VAX fix the process + virtual address space in this way, or similarly, taking the + lead from VMS. + + The actual pages allocated to hold the process page tables + are done on demand, so only as much physical memory as is + actually needed to hold the process PTEs is used. The PMD + keeps track of which pages in the process page table are allocated + (Because our PGD holds the base and length registers, amongst + other things). + + Room for Improvement + -------------------- + + We waste space with the pgd. + + We can use the TASK_xxxx macros to set default values. New values + can be supplied as a kernel command line argument, so that we only + need to reboot, not recompile to alter the page table sizes. + + We can condense the pmd down into a smaller number of pages, + but this requires smarter pmd_xxx routines to emulate the missing + bits of the process pmds, when linux scans the pmds. + + We need to eliminate the PGD_SPECIAL botch. + + PGD/PMD/PTE. + ------------ + + In Linux, the pgd is the highest level division of virtual address + space. For the VAX the mapping is clear, A process has 4 main + sections in the 32 bit address space. P0, P1, S0 and S1, each of which + is 1024Mb in size. + + P0 0x00000000 - 0x3fffffff "Process space" + P1 0x40000000 - 0x7fffffff "Process stack space" + S0 0x80000000 - 0xbfffffff "System Space" + S1 0xc0000000 - 0xffffffff "Unreachable/Reserved" + + Each one of these has a pgd entry in a page table. Each pgd_t is + a structure defined in include/asm-vax/mm/pagelet.h, which includes + the base and length registers for that segment. + + Each page is 4096 bytes in size. Each pte is 32 bytes in size. + So each page allocated to a page table holds + 4096/32 = 128 ptes. + + Each page of ptes in a page table therefore maps; + 128*4096 = 512 kb of address space. + + So, in order to map the whole of one segment (one pgd_t) we need + 1024*1024/512 = 2048 pages of ptes in the page table. + + To keep track of which pages are allocated, we need to keep a + PMD. Each pmd_t is a longword (4 bytes) so we need + 2048 * 4 / 4096 = 2 pages per PMD. + + These are located at the start of the task slot. + + -- atp Sept. 2001. + KPH 20000416 |
From: Andy P. <at...@us...> - 2001-09-16 15:29:02
|
Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax In directory usw-pr-cvs1:/tmp/cvs-serv3107 Modified Files: ka46.h Log Message: Definition of KA46_DMAMAP address Index: ka46.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/ka46.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ka46.h 2001/01/17 16:18:52 1.1 +++ ka46.h 2001/09/16 15:28:59 1.2 @@ -21,6 +21,7 @@ #define KA46_CCR 0x23000000 #define KA46_TAGST 0x2d000000 #define KA46_TAGSZ 32768 +#define KA46_DMAMAP 0x20080008 /* IPR bits definitions */ #define PCSTS_FLUSH 4 |
From: Andy P. <at...@us...> - 2001-09-16 15:24:34
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv2243 Modified Files: setup.c Log Message: New place for kernel command line, not hardwired anymore Index: setup.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/setup.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- setup.c 2001/09/14 20:30:21 1.16 +++ setup.c 2001/09/16 15:24:31 1.17 @@ -23,6 +23,7 @@ #define COMMAND_LINE_SIZE 256 +extern char *kernel_cmd_line; /* kernel command line from head.S */ static char command_line[COMMAND_LINE_SIZE]; char saved_command_line[COMMAND_LINE_SIZE]; @@ -64,16 +65,16 @@ unsigned long region_len; /* - * Locate the command line. - Don't have one yet... - * atp -- have a temporary one. - * Shouldn't we use strcpy here? + * save the command line from the boot block, before it gets + * stomped on. */ -// memcpy(command_line, "root=/dev/sda1 rw debug\0",24); - memcpy(command_line, "root=/dev/nfs nfsroot=/tftpboot/vaxroot rw debug\0",55); + memcpy(command_line, kernel_cmd_line,(COMMAND_LINE_SIZE-1)); *cmdline_p = command_line; /* Save unparsed command line copy for /proc/cmdline */ - memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); + memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE-1); saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; + printk("kernel_cmd_line %8p\n%s\n",kernel_cmd_line,kernel_cmd_line); + /* Get the SID */ vax_cpu.sid = __mfpr(PR_SID); @@ -160,7 +161,6 @@ setup_smp(); #endif - pte_ERROR( *(pte_t *)0x80291d80); } |
From: Andy P. <at...@us...> - 2001-09-16 15:23:23
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel In directory usw-pr-cvs1:/tmp/cvs-serv1918 Modified Files: interrupt.c Log Message: Add a stub for init_irq_proc. Called by sysctl. Index: interrupt.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/kernel/interrupt.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- interrupt.c 2001/09/14 23:55:03 1.19 +++ interrupt.c 2001/09/16 15:23:20 1.20 @@ -772,3 +772,8 @@ } return len; } + +/* empty for now. See arch/i386/kernel/irq.c for what this should do */ +void init_irq_proc(void) +{ +} |
From: Andy P. <at...@us...> - 2001-09-16 15:19:30
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/boot/tools In directory usw-pr-cvs1:/tmp/cvs-serv1072/tools Added Files: setcmdline.c Log Message: Put the kernel command line in first part of head.S Add a small tool called from makefile to set the command line --- NEW FILE --- /* write a command line into a header block */ /* atp Sept 2001 */ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <string.h> #include <stdio.h> #define COMMAND_LINE_SIZE 256 #define COMMAND_LINE_OFFSET 0x204 int main (int argc, char *argv[]) { int kern_fd; char buffer[COMMAND_LINE_SIZE]; if (called_as(argv[0],"showcmdline")) { if (argc < 2) { printf ("usage: showcmdline kernel_image\n"); exit(1); } }else { if (argc < 3) { printf ("usage: setcmdline kernel_image \"command line\"\n"); exit(1); } } if ((kern_fd=open(argv[1], O_RDWR))<0) { perror(argv[1]); exit(1); } memset(buffer,0,COMMAND_LINE_SIZE); if (called_as(argv[0],"setcmdline")) { if (strlen(argv[2])>=COMMAND_LINE_SIZE) { printf("Warning: Command Line truncated to %d bytes!\n",COMMAND_LINE_SIZE-1); } strncpy(buffer,argv[2],(COMMAND_LINE_SIZE-1)); lseek(kern_fd,COMMAND_LINE_OFFSET,SEEK_SET); printf("\n\nSetting kernel command line to:\n\t%s\n\n",buffer); write(kern_fd,buffer,strlen(buffer)); } else { lseek(kern_fd,COMMAND_LINE_OFFSET,SEEK_SET); read(kern_fd,buffer,(COMMAND_LINE_SIZE-1)); printf("\nKernel command line is:\n\t%s\n",buffer); } close(kern_fd); } int called_as(char *str1, char *str2) { char *tmp; tmp = strrchr(str1,'/'); if (tmp==NULL) tmp=str1; else tmp++; // printf("%s %s, %s\n",str1,str2,tmp); return (!strncmp(tmp,str2,strlen(str2))); } |
From: Andy P. <at...@us...> - 2001-09-16 15:19:30
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax/boot In directory usw-pr-cvs1:/tmp/cvs-serv1072 Modified Files: head.S Log Message: Put the kernel command line in first part of head.S Add a small tool called from makefile to set the command line Index: head.S =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/boot/head.S,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- head.S 2001/09/14 20:30:21 1.13 +++ head.S 2001/09/16 15:19:27 1.14 @@ -19,19 +19,22 @@ _stext: .globl start start: - nop # relocation code, and stack setup required -# movzbl $0x41,r2 # want to see something early while i debug scsi boot. -# jsb 0x20040058 - nop - nop - nop + jmp codestart # Word displacement. +.globl bootparam +bootparam: + .fill 256,1,0 # The boot parameter block. Presently just the + # command line. +codestart: # disable memory mapping mtpr $0, $PR_MAPEN mtpr $31, $PR_IPL -# save r11, ap and scbb +# save r11, ap and scbb and location of command line movl ap, boot_ap movl r11, boot_r11 mfpr $PR_SCBB, boot_scb + movab bootparam, r5 + addl2 $PAGE_OFFSET,r5 # we will only access this when mapen=1 + movl r5,kernel_cmd_line # put the sp somewhere safe, over our bootblock in fact moval start, r5 subl2 $0x200, r5 @@ -61,6 +64,10 @@ jsb crlf movab msg_cpu_type, r10 jsb printstr + jsb crlf + moval kernel_cmd_line, r10 + movl (r10),r10 + jsb printint movl mv, r10 calls $0, *MV_CPU_TYPE_STR(r10) @@ -402,4 +409,10 @@ .section .data.init .globl fake_pcb fake_pcb: .fill 24,4,0x00000000 + +# and a pointer to our initial command line +.globl kernel_cmd_line +kernel_cmd_line: + .int 0x00000000 + |
From: Andy P. <at...@us...> - 2001-09-16 15:18:15
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/vax In directory usw-pr-cvs1:/tmp/cvs-serv707 Modified Files: Makefile Log Message: New build method for kernel command line. Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/arch/vax/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- Makefile 2001/07/31 17:28:26 1.9 +++ Makefile 2001/09/16 15:18:12 1.10 @@ -47,6 +47,9 @@ LIBS := $(ARCHLIBS) $(LIBS) MKBOOTBLK := $(TOPDIR)/arch/vax/boot/tools/mkbootblk +DEFAULT_CMDLINE := "root=/dev/nfs nfsroot=/tftpboot/vaxroot rw debug" +SETCMDLINE := $(TOPDIR)/arch/vax/boot/tools/setcmdline +SHOWCMDLINE := $(TOPDIR)/arch/vax/boot/tools/showcmdline # And these are some extra dependencies for vmlinux vmlinux: $(HEAD) $(ARCHLIBS) @@ -54,40 +57,59 @@ SUBDIRS := $(SUBDIRS) arch/vax/kernel arch/vax/mm arch/vax/lib arch/vax/boot CORE_FILES := arch/vax/kernel/kernel.o arch/vax/mm/mm.o $(CORE_FILES) -all: mopboot diskboot + +all: mopboot archonly: mopbootx diskbootx # This target should re-compile anything that's changed -mopboot: vmlinux +mopboot: vmlinux $(SETCMDLINE) $(OBJCOPY) vmlinux -O binary vmlinux.bin dd if=/dev/zero of=header.bin bs=512 count=1 mv -f header.bin vmlinux.SYS cat vmlinux.bin >> vmlinux.SYS - + $(SETCMDLINE) vmlinux.SYS $(DEFAULT_CMDLINE) + # this is helpful for low level debuggery listfile: rm -f vmlinux.lst $(OBJDUMP) -D vmlinux > vmlinux.lst # This target will only re-compile stuff that's changed in arch/vax -mopbootx: linkonly +mopbootx: linkonly $(SETCMDLINE) $(OBJCOPY) vmlinux -O binary vmlinux.bin dd if=/dev/zero of=header.bin bs=512 count=1 mv -f header.bin vmlinux.SYS cat vmlinux.bin >> vmlinux.SYS + $(SETCMDLINE) vmlinux.SYS $(DEFAULT_CMDLINE) # This will make a disk-bootable image. dd this directly to a # disk and then tell your VAX to boot from this disk -diskboot: vmlinux $(MKBOOTBLK) +# +# NOTE: +# If you want to keep a partition table on the disk, and use +# a boot loader to load the kernel from a file system, then +# use the vmlinux.SYS and something like asbl. Dont forget to +# set the command line to something useful like "root=/dev/sda1" +# +diskboot: vmlinux $(MKBOOTBLK) $(SETCMDLINE) $(OBJCOPY) vmlinux -O binary vmlinux.bin $(MKBOOTBLK) vmlinux.bin > vmlinux.dsk cat vmlinux.bin >> vmlinux.dsk + @echo " " + @echo " Dont forget to set the kernel command line with" + @echo " " $(SETCMDLINE) + @echo " " + # ... and this one only rebuilds stuff in arch/vax -diskbootx: linkonly $(MKBOOTBLK) +diskbootx: linkonly $(MKBOOTBLK) $(SETCMDLINE) $(OBJCOPY) vmlinux -O binary vmlinux.bin $(MKBOOTBLK) vmlinux.bin > vmlinux.dsk cat vmlinux.bin >> vmlinux.dsk + @echo " " + @echo " Dont forget to set the kernel command line with" + @echo " " $(SETCMDLINE) + @echo " " # This is copied from the top-level Makefile linkonly: dummy @@ -111,6 +133,12 @@ $(MKBOOTBLK): $(MKBOOTBLK).c gcc -o $@ $< + +$(SHOWCMDLINE): $(SETCMDLINE) + +$(SETCMDLINE): $(SETCMDLINE).c + gcc -o $@ $< + ln -f $(SETCMDLINE) $(SHOWCMDLINE) #libboot: # (cd ${TOPDIR}/arch/vax/boot; make all ) |
From: Andy P. <at...@us...> - 2001-09-16 15:17:39
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/scsi In directory usw-pr-cvs1:/tmp/cvs-serv602/scsi Modified Files: vax-5380.h Log Message: Drop the scsi debugging level Index: vax-5380.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/scsi/vax-5380.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- vax-5380.h 2001/02/22 00:00:36 1.2 +++ vax-5380.h 2001/09/16 15:17:36 1.3 @@ -31,6 +31,9 @@ /* * $Log$ + * Revision 1.3 2001/09/16 15:17:36 atp + * Drop the scsi debugging level + * * Revision 1.2 2001/02/22 00:00:36 kenn * VS3100m76 SCSI sort of, kind of, seems to work... * @@ -53,7 +56,7 @@ #define VDEBUG_INIT 0x1 #define VDEBUG_TRANSFER 0x2 -#define NDEBUG NDEBUG_INTR +#undef NDEBUG #define NCR_TIMEOUT 500000 #ifndef ASM |
From: Andy P. <at...@us...> - 2001-09-16 15:13:14
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net In directory usw-pr-cvs1:/tmp/cvs-serv32063/net Modified Files: vaxlance.c Log Message: Slightly better irq handling. is_ka46 now can be used to switch on the fly between system dependent behaviour, so we can use the same kernel config on two machines. Index: vaxlance.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/vaxlance.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- vaxlance.c 2001/09/05 10:16:40 1.16 +++ vaxlance.c 2001/09/16 15:13:09 1.17 @@ -1031,7 +1031,7 @@ lp->vsbus_int=num; } #else - lp->vsbus_int=1; + if (is_ka46()) lp->vsbus_int=1; else lp->vsbus_int=5; #endif #endif @@ -1064,7 +1064,7 @@ vsbus_clear_int(lp->vsbus_int); #else - dev->irq=254; + if (is_ka46()) dev->irq=254; else dev->irq=0x94; #endif if (dev->irq) printk(" probed IRQ %d, vsbus %d\n", dev->irq, lp->vsbus_int); |
From: Andy P. <at...@us...> - 2001-09-16 15:13:14
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/vsbus In directory usw-pr-cvs1:/tmp/cvs-serv32063/vsbus Modified Files: vsbus.c Log Message: Slightly better irq handling. is_ka46 now can be used to switch on the fly between system dependent behaviour, so we can use the same kernel config on two machines. Index: vsbus.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/vsbus/vsbus.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- vsbus.c 2001/06/17 11:43:45 1.4 +++ vsbus.c 2001/09/16 15:13:09 1.5 @@ -12,6 +12,10 @@ #include <linux/interrupt.h> #include <linux/bitops.h> +#include <asm/mv.h> +#include <asm/ka43.h> +extern struct vax_mv mv_ka46; + struct vsbus { struct vs_cpu *vs_cpu_ptr; unsigned char vs_mask; @@ -76,3 +80,5 @@ printk("vsbus: probe returning %2X, %2X\n", x, ffs(y)); return ffs(y)-1; } + +int is_ka46(void) { return (mv==&mv_ka46); } |