All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H . J . Lu" <hjl@lucon.org>
To: Dominic Sweetman <dom@algor.co.uk>
Cc: "Kevin D. Kissell" <kevink@mips.com>,
	Ulrich Drepper <drepper@redhat.com>,
	GNU libc hacker <libc-hacker@sources.redhat.com>,
	linux-mips@oss.sgi.com
Subject: Re: thread-ready ABIs
Date: Sat, 19 Jan 2002 11:42:04 -0800	[thread overview]
Message-ID: <20020119114204.A13939@lucon.org> (raw)
In-Reply-To: <15433.26184.411289.161787@gladsmuir.algor.co.uk>; from dom@algor.co.uk on Sat, Jan 19, 2002 at 12:27:52PM +0000

On Sat, Jan 19, 2002 at 12:27:52PM +0000, Dominic Sweetman wrote:
> 
> H . J . Lu (hjl@lucon.org) writes:
> 
> > > It would, in principle, be possible to save/restore k0
> > > or k1 (but not both) if no other clever solution can be found.  
> > > There are other VM OSes that manage to do so for MIPS, 
> > > for other outside-the-old-ABI reasons.  It does, of course,
> > > add some instructions and some memory traffic to the 
> > > low-level exception handling , and we would have to look 
> > > at whether we would want to make such a feature standard 
> > > or specific to a "thread-ready" kernel build.
> > 
> > I like the read-only k0 idea. We just need to make a system call to
> > tell kernel what value to put in k0 before returning to the user space.
> > It shouldn't be too hard to implement. I will try it next week.
> 
> You could, I guess, wire a TLB entry to map the thread register into
> the highest virtual memory region of the machine (the top of 'kseg2'),
> which is accessible in a single instruction as a negative offset from
> $0.  The kernel can write it through kseg0 or 64-bit equivalent, if
> you're a bit careful about cache aliases.

But it has to be a per thread value.

> 
> Reading something out of the cache is pretty cheap: would that be
> close enough to a 'register' to do the job?  There's no change to
> critical routines, that way.
> 

This is a patch against 2.4.16. Will this restore k1 to a known per
thread value?


H.J.
--- include/asm-mips/stackframe.h.thread	Wed Dec 12 12:34:53 2001
+++ include/asm-mips/stackframe.h	Sat Jan 19 11:36:38 2002
@@ -191,6 +191,7 @@ __asm__ (                               
 		lw	$2,  PT_R2(sp)
 
 #define RESTORE_SP_AND_RET                               \
+		lw	$27, PT_R27(sp);                 \
 		.set	push;				 \
 		.set	noreorder;			 \
 		lw	k0, PT_EPC(sp);                  \
@@ -229,6 +230,7 @@ __asm__ (                               
 		lw	$2,  PT_R2(sp)
 
 #define RESTORE_SP_AND_RET                               \
+		lw	$27, PT_R27(sp);                 \
 		lw	sp,  PT_R29(sp);                 \
 		.set	mips3;				 \
 		eret;					 \
@@ -237,6 +239,7 @@ __asm__ (                               
 #endif
 
 #define RESTORE_SP                                       \
+		lw	$27, PT_R27(sp);                 \
 		lw	sp,  PT_R29(sp);                 \
 
 #define RESTORE_ALL                                      \

  reply	other threads:[~2002-01-19 20:42 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m3elkoa5dw.fsf@myware.mynet>
2002-01-18 18:19 ` thread-ready ABIs H . J . Lu
2002-01-18 18:31   ` Ulrich Drepper
2002-01-18 19:08     ` H . J . Lu
2002-01-18 19:20       ` Ulrich Drepper
2002-01-19 12:14         ` Dominic Sweetman
2002-01-19 12:14           ` Dominic Sweetman
2002-01-20  0:14     ` Ralf Baechle
2002-01-18 20:03   ` Maciej W. Rozycki
2002-01-18 20:20     ` Ulrich Drepper
2002-01-18 20:50       ` Maciej W. Rozycki
2002-01-18 21:02         ` Ulrich Drepper
2002-01-18 21:35           ` Maciej W. Rozycki
2002-01-18 21:44             ` Ulrich Drepper
2002-01-18 22:17               ` Maciej W. Rozycki
2002-01-18 21:23   ` Daniel Jacobowitz
2002-01-19  0:35   ` Kevin D. Kissell
2002-01-19  0:35     ` Kevin D. Kissell
2002-01-19  4:11     ` H . J . Lu
2002-01-19 12:27       ` Dominic Sweetman
2002-01-19 19:42         ` H . J . Lu [this message]
2002-01-21 13:27           ` Maciej W. Rozycki
2002-01-19 22:21         ` Kevin D. Kissell
2002-01-19 22:21           ` Kevin D. Kissell
2002-01-20 10:38       ` Machida Hiroyuki
2002-01-20 11:58         ` Kevin D. Kissell
2002-01-20 11:58           ` Kevin D. Kissell
2002-01-20 13:16           ` Machida Hiroyuki
2002-01-22  6:27             ` patches for test-and-set without ll/sc (Re: thread-ready ABIs) Machida Hiroyuki
2002-01-22  6:37               ` Ulrich Drepper
2002-01-22  6:46                 ` Machida Hiroyuki
2002-01-22  6:56                   ` Ulrich Drepper
2002-01-24  9:56                 ` Andreas Jaeger
2002-01-24  9:56                   ` Andreas Jaeger
2002-01-20 19:19           ` thread-ready ABIs H . J . Lu
2002-01-21  9:39             ` Kevin D. Kissell
2002-01-21  9:39               ` Kevin D. Kissell
2002-01-21 13:56               ` Maciej W. Rozycki
2002-01-21 18:24                 ` H . J . Lu
2002-01-21 18:36                   ` Ulrich Drepper
2002-01-21 18:52                     ` H . J . Lu
2002-01-21 18:58                       ` H . J . Lu
2002-01-21 18:59                       ` Daniel Jacobowitz
2002-01-21 19:05                         ` H . J . Lu
2002-01-21 19:09                           ` Daniel Jacobowitz
2002-01-21 19:18                             ` H . J . Lu
2002-01-21 21:04                         ` Kevin D. Kissell
2002-01-21 21:04                           ` Kevin D. Kissell
2002-01-21 19:30                       ` Geoff Keating
2002-01-21 21:07                       ` Ulrich Drepper
2002-01-21 13:43             ` Maciej W. Rozycki
2002-01-20  0:24     ` Ralf Baechle
2002-01-21 23:22       ` Ulrich Drepper
2002-01-21 23:57         ` Kevin D. Kissell
2002-01-21 23:57           ` Kevin D. Kissell
2002-01-22  0:16           ` Ulrich Drepper
2002-01-22  0:16             ` Ulrich Drepper
2002-01-22  9:37             ` Dominic Sweetman
2002-01-22  9:37               ` Dominic Sweetman
2002-01-22 17:41               ` Ulrich Drepper
2002-01-22 17:41                 ` Ulrich Drepper
2002-01-22  9:59           ` Dominic Sweetman
2002-01-22  9:59             ` Dominic Sweetman
2002-01-22 12:18             ` Kevin D. Kissell
2002-01-22 12:18               ` Kevin D. Kissell
2002-01-22 15:21               ` Daniel Jacobowitz
2002-01-22 15:44                 ` Dominic Sweetman
2002-01-22 21:44                   ` Tommy S. Christensen
2002-01-22 21:53                     ` Kevin D. Kissell
2002-01-22 21:53                       ` Kevin D. Kissell
2002-01-22 23:13                       ` Kevin D. Kissell
2002-01-22 23:13                         ` Kevin D. Kissell
2002-01-23  1:12                     ` Jason Gunthorpe
2002-01-22 16:05                 ` Kevin D. Kissell
2002-01-22 16:05                   ` Kevin D. Kissell
2002-01-22 16:34                   ` Daniel Jacobowitz
2002-01-22 17:08                     ` Kevin D. Kissell
2002-01-22 17:08                       ` Kevin D. Kissell
2002-01-22 17:13                       ` Daniel Jacobowitz
2002-01-22 17:34                         ` Kevin D. Kissell
2002-01-22 17:34                           ` Kevin D. Kissell
2002-01-22 17:37                           ` Daniel Jacobowitz
2002-01-22 17:47                             ` Kevin D. Kissell
2002-01-22 17:47                               ` Kevin D. Kissell
2002-01-22 17:57                               ` Daniel Jacobowitz
2002-01-22 18:18                                 ` Kevin D. Kissell
2002-01-22 18:18                                   ` Kevin D. Kissell
2002-01-27 20:24                         ` Alan Cox
2002-01-27 20:24                           ` Alan Cox
2002-01-28  8:50                           ` Kevin D. Kissell
2002-01-28  8:50                             ` Kevin D. Kissell
2002-01-22  1:39   ` Richard Henderson
2002-01-18 21:24 Justin Carlson
2002-01-18 21:31 ` Ulrich Drepper
2002-01-18 21:42 ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020119114204.A13939@lucon.org \
    --to=hjl@lucon.org \
    --cc=dom@algor.co.uk \
    --cc=drepper@redhat.com \
    --cc=kevink@mips.com \
    --cc=libc-hacker@sources.redhat.com \
    --cc=linux-mips@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.