Problems with the demo CD and qemu

Adam Lackorzynski adam at
Mon Feb 21 22:27:40 CET 2005

On Fri Feb 18, 2005 at 11:24:07 +0100, Cedric Roux wrote:
> (I just tried a boot without CONFIG_HANDLE_SEGMENTS, it crashed,
> I did not try to know why.)

Probably because Linux tries to use it and the kernel rejects it.

> It would be nice to have some infos about this issue, though,
> just to understand what's exactly going on. Do you, Adam, or
> someone else, have pointers or info about it? A second question

Well, it's hard to stay calm when talking about this issue, also, you'll
find some nice rants out there. But I'll try.
Once upon a time someone decided that fast access to a thread local
storage (TLS) for user programs is necessary. As x86 doesn't have many
registers a segment is used to point to the TLS. It's %gs. L4 uses %gs
to point to the UTCB. In Linux, this is implemented by using 3 GDT
entries for each thread which are reloaded for every threadswitch. glibc
still supports the old method with LDT entries, but that didn't work
quite well last time I tried. I guess nobody's using it and it's buggy
somehow but I don't really know. Fiasco can play the LDT game which can
also be useful for other things. But fortunately TLS usage can be
disabled either by rm'ing the tls dirs or using LD_ASSUME_KERNEL, so we
can live with it.

Standard pointers:

> is: is the CONFIG_HANDLE_SEGMENTS mandatory and why? More generally,
> what option in the fiasco configuration are mandatory and what
> are optionnal, and what's the best configuration (having speed
> constraints in mind)?

The option is mandatory right now, I'll need some support outside of
L4Linux to make it optional. For performance stuff, Fiasco outputs the
options on startup you should enable/disable, just try this.

Adam                 adam at

More information about the l4-hackers mailing list