public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Luca Barbieri <ldb@ldb.ods.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Linux-Kernel ML <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [patch] tls-2.5.30-A1
Date: 08 Aug 2002 01:21:48 +0200	[thread overview]
Message-ID: <1028762508.1992.309.camel@ldb> (raw)
In-Reply-To: <Pine.LNX.4.44.0208080050300.7410-100000@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 2234 bytes --]

> your patch looks good to me - as long as we want to keep those 2 TLS
> entries and nothing more. (which i believe we want.) If even more TLS
> entries are to be made possible then a cleaner TLS enumeration interface
> has to be used like Christoph mentioned - although i dont think we really
> want that, 3 or more entries would be a stretch i think.
I think that 2 are enough.
Flat 32-bit programs set ds=es=ss=__USER_DS and cs=__USER_CS so they
only have fs and gs left.
16-bit programs and other odd ones can use the LDT support.

As for the interface I would suggest replacing the current one with a
single interface for LDT and GDT modifications that would provide the
following parameters:

unsigned table
- LDT
- GDTAVAIL: GDT starting from first TLS
- GDTABS: GDT starting from 0
- AUTO: starts with the 2 TLS entries and proceeds with LDT

unsigned operation
- set: copy to kernel space (enlarge table if necessary). If root, don't
check validity for speed, otherwise check to ensure the user is not e.g.
putting call gates to CPL 0 code.
- set1: like set, but passes a single entry directly in the num and ptr
parameters
- get: copy from kernel space
- free: free memory and lower limits. If entry = 0 and num = ~0,
completely frees table.
- map: only for LDT and for root, allows to directly point to a user
memory range 
- movekern: when support for per-task GDT is implemented, this would
allow to change the entries used for kernel entries. This would be
implemented with per-CPU IDTs and maybe dynamically generated code.
Useful for virtualization programs.

unsigned entry
- first entry affected. ~0 for first unused entry.

unsigned num
- number of entries affected

void* ptr
- pointer to read/write entries from

(table and operations may be merged)

Return value: first entry changed

e.g. libpthread would use table = AUTO, operation = set1, entry = ~0.

For the LDT things would be implemented as usual. For the GDT the
initial implementation would just modify TLS entries.
In future, support for dynamically allocated per-task GDTs could be
added.

I would implement this by adding ops to sys_modify_ldt.

BTW, tls_desc1/tls_desc2 would IMHO be better as gdt_desc[2].

I don't plan to implement this myself.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2002-08-07 23:18 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-07 18:10 [patch] tls-2.5.30-A1 Ingo Molnar
2002-08-07 18:33 ` Linus Torvalds
2002-08-07 18:43   ` Stephen Rothwell
2002-08-07 18:57     ` Linus Torvalds
2002-08-07 19:40       ` Alexandre Julliard
2002-08-07 19:31   ` Ingo Molnar
2002-08-07 19:49     ` Alexandre Julliard
2002-08-07 22:01   ` Alan Cox
2002-08-07 22:36   ` Luca Barbieri
2002-08-07 22:54     ` Ingo Molnar
2002-08-07 23:21       ` Luca Barbieri [this message]
2002-08-07 23:35         ` DMA Problems with Intel 845 Chipset and Northwood CPU Mark Cuss
2002-08-08  0:58           ` John L. Korpi
2002-08-08 16:12             ` Mark Cuss
2002-08-11 21:46   ` [patch] tls-2.5.31-C3 Ingo Molnar
2002-08-12  7:34     ` Stephen Rothwell
2002-08-12 10:07       ` Ingo Molnar
2002-08-12  8:23         ` Stephen Rothwell
2002-08-12 10:08           ` Alan Cox
2002-08-12 10:49             ` Ingo Molnar
2002-08-12 10:34               ` Alan Cox
2002-08-12 12:17                 ` Ingo Molnar
2002-08-12 11:47                   ` Alan Cox
2002-08-12 12:55                     ` Ingo Molnar
2002-08-12 12:29                       ` Alan Cox
2002-08-12 10:35               ` Alan Cox
2002-08-12 13:10             ` Kasper Dupont
2002-08-12 15:20             ` Ingo Molnar
2002-08-12 14:46         ` Stephen Rothwell
2002-08-12 12:18     ` Luca Barbieri
2002-08-12 15:12       ` Ingo Molnar
2002-08-12 13:43         ` Luca Barbieri
2002-08-12 15:57           ` Ingo Molnar
2002-08-12 14:17             ` Luca Barbieri
2002-08-12 15:53     ` [patch] tls-2.5.31-D3 Ingo Molnar
2002-08-12 16:13       ` [patch] tls-2.5.31-D4 Ingo Molnar
2002-08-12 14:32         ` Luca Barbieri
2002-08-12 17:06         ` [patch] tls-2.5.31-D5 Ingo Molnar
2002-08-12 15:21           ` Jakub Jelinek
2002-08-12 17:41             ` Ingo Molnar
2002-08-12 15:54               ` Luca Barbieri
2002-08-12 18:03               ` [patch] tls-2.5.31-D9 Ingo Molnar
2002-08-13  1:50               ` [patch] tls-2.5.31-D5 Alexandre Julliard
2002-08-12 17:24           ` [patch] tls-2.5.31-D7 Ingo Molnar
2002-08-12 15:45             ` Christoph Hellwig
2002-08-07 19:02 ` [patch] tls-2.5.30-A1 Christoph Hellwig
2002-08-08 12:25 ` Jamie Lokier

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=1028762508.1992.309.camel@ldb \
    --to=ldb@ldb.ods.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox