From owner-cvs-all Thu Feb 22 11:17:22 2001 Delivered-To: cvs-all@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 498D037B491; Thu, 22 Feb 2001 11:17:16 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.2/8.11.2) with ESMTP id f1MJF2l99673; Thu, 22 Feb 2001 11:15:02 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Thu, 22 Feb 2001 11:17:02 -0800 (PST) From: John Baldwin To: John Baldwin Subject: Re: cvs commit: src/sys/alpha/alpha swtch.s Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, Doug Rabson Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 22-Feb-01 John Baldwin wrote: > > On 22-Feb-01 Doug Rabson wrote: >> On Thu, 22 Feb 2001, John Baldwin wrote: >> >>> >>> On 22-Feb-01 Doug Rabson wrote: >>> > >>> > That seems like a good direction to take. >>> >>> Oops, bit too hasty. There is one remaining MD portion in the alpha >>> ast() that the ia64 ast() has inherited, we set the p->p_md.md_tf field >>> to point to the trapframe passed in to ast(). Do you know what it is used >>> for? >> >> Its used in various places to get at the original trapframe which we >> entered the kernel with. This is needed for instance in signal delivery >> and execve handling. The i386 equivalent is p_md.md_regs. >> >> I'm not sure how the i386 code gets away without setting md_regs. Perhaps >> its always set correctly be whatever happened right before the call to >> ast(). > > Well, syscall() and trap() on the alpha already setup p->p_md.md_tf. > It looks like interrupts don't set it in interrupt(), though that > could be easily fixed. syscall() and trap() on i386 setup p->p_md.md_regs. > Hmm, interrupts on i386 do _not_ set p->p_md.md_regs. I wonder if this > can lead to a bug if an ast is pending when we return from an interrupt to > userland. I.e., if a signal is pending, p->p_md.md_regs would be messed up. > ia64 sets p_md.md_tf already in both trap() and syscall() and doesn't have > interrupt handlers yet. I'll try adding setting of p->p_md.md_regs on > the x86 in ast() and see if that fixes some of the weird problems people > have reported with getting smashed stacks when the preemption on interrupt > happens. Aha, ast() was moved out of trap() on the x86 as part of the first SMPng commit, and has been broken all this time. *sigh* I'll go fix it. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message