Date: Thu, 22 Feb 2001 11:11:36 -0800 (PST) From: John Baldwin <jhb@FreeBSD.org> To: Doug Rabson <dfr@nlsystems.com> Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/alpha/alpha swtch.s Message-ID: <XFMail.010222111136.jhb@FreeBSD.org> In-Reply-To: <Pine.BSF.4.33.0102221740320.33213-100000@herring.nlsystems.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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. -- John Baldwin <jhb@FreeBSD.org> -- 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010222111136.jhb>