Received: by oss.sgi.com id ; Mon, 13 Dec 1999 12:39:23 -0800 Received: from mailext12.compaq.com ([207.18.199.188]:31650 "HELO mailext12.compaq.com") by oss.sgi.com with SMTP id ; Mon, 13 Dec 1999 12:39:03 -0800 Received: by mailext12.compaq.com (Postfix, from userid 12345) id DEA57578ED; Mon, 13 Dec 1999 14:37:54 -0600 (CST) Received: from mailint02.im.hou.compaq.com (mailint02.compaq.com [207.18.199.35]) by mailext12.compaq.com (Postfix) with ESMTP id D9C3754601; Mon, 13 Dec 1999 14:37:54 -0600 (CST) Received: by mailint02.im.hou.compaq.com (Postfix, from userid 12345) id CAF21BC4CA; Mon, 13 Dec 1999 14:37:47 -0600 (CST) Received: from cxo3ns.cxo.dec.com (cxo3ns.cxo.dec.com [16.63.0.10]) by mailint02.im.hou.compaq.com (Postfix) with SMTP id 43BCFB2A43; Mon, 13 Dec 1999 14:37:47 -0600 (CST) Received: from brownfur.cxo.dec.com by cxo3ns.cxo.dec.com; (5.65v4.0/1.1.8.2/11Apr96-1001AM) id AA04482; Mon, 13 Dec 1999 13:37:53 -0700 Received: from dhcp192-89.cxo.dec.com by brownfur.cxo.dec.com (5.65v4.0/1.1.10.5/17Feb98-0753AM) id AA03900; Mon, 13 Dec 1999 13:37:52 -0700 Content-Length: 2626 Message-Id: X-Mailer: XFMail 1.4.4 on Linux X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Mime-Version: 1.0 In-Reply-To: Date: Wed, 15 Dec 1999 08:38:08 -0700 (MST) Reply-To: Brian Hall From: Brian Hall To: Matt Robinson Subject: Re: Volunteer to work with Alpha port of lkcd Cc: lkcd@oss.sgi.com Sender: owner-lkcd@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;lkcd-outgoing OK, I am actively working on this now (the Linux Alpha machines I have access to have had problems; I've put the kernel tree on an NFS mount so I can continue to work). Do I have to do the inline assembly to save the PC and RA registers, or can I simply stuff them into the dump header structure? BTW, I notice lots of 32 bit fields in the header, those will all have to be 64 bit for Alpha, won't they? Certainly at least the registers will; I think having others in the structure 32 bit may cause alignment problems on the Alpha. So, can I just make the dh_esp and dh_eip uint64_t, remove the inline asm and the call to __dump_save_panic_regs, and just do: /* This is __dump_execute */ dump_header.dh_esp = regs->pc; /* from arch/alpha/kernel/traps.c, r26 appears to be ra */ dump_header.dh_eip = regs->r26; /* dump out the header */ Also, what do you mean by putting a hook in die_if_kernel()? Do you mean to call the kernel dump routine - dump_execute() ? On 01-Dec-1999 Matt Robinson wrote: > The first thing to do is to take the kernel code in > arch/i386/kernel/vmdump.c and copy it to arch/alpha/kernel, modify > the makefile, and then modify the calls for saving the pt_regs. > > The code for saving the registers is mostly correct, except for: > > if (regs) { > memcpy((void *)&(dump_header.dh_regs), (const void *)regs, > sizeof(struct pt_regs)); >> if (!user_mode(regs)) { >> dump_header.dh_regs.esp = (unsigned long) (regs + 1); >> } > } > > Those lines aren't necessarily needed -- they are I386 specific. We > have to adjust the esp based on the processor mode. > > Also, the code for: > > /* save the dump specific esp/eip */ > __asm__ __volatile__(" > pushl %%eax\n > movl %%esp, %%eax\n > movl %%eax, %0\n > popl %%eax\n" > : "=g" (dump_header.dh_esp) > ); > __asm__ __volatile__("pushl %eax\n"); > __dump_save_panic_regs(); > __asm__ __volatile__("popl %eax\n"); > > All of this is set up just to save the stack pointer and program > counter for this box, as the pt_regs on I386 boxes don't necessarily > point to the right location. We want to be able to walk back from > the exception where that is possible. > > In looking at the Alpha stuff, I think you can start by saving the PC > and RA values (not sure which $XX they represent), and also put a hook > into die_if_kernel() in traps.c. -- Brian Hall Linux Consultant