amd64_set_gsbase()

Mihai Donțu mihai.dontu at gmail.com
Mon Oct 8 17:49:02 PDT 2007


On Tuesday 09 October 2007, Jung-uk Kim wrote:
> In long mode, we don't really care about segment registers.  While 
> implementing TLS for Linuxulator, I had to do the following hack, for 
> example:
> 
> http://docs.freebsd.org/cgi/mid.cgi?200703300006.l2U06LA1075891
> 
> Under Linux and Windows, they do preserve segment registers vs. base 
> addresses mapping for backward compatibility, AFAIK with some 
> performance penalty.

Ah! But you are doing your magic _in the kernel_. I don't have this luxury :)
I have to do everything in user space (as a normal user) on an out-of-the-box
FreeBSD (-stable).

I have *one* more question: maybe I don't fully understand the hole BASE thing,
but since the FreeBSD kernel does not preserve %gs and %fs, what is the purpose
of amd64_set_XXbase()?

Thanks,

-- 
Mihai Donțu


More information about the freebsd-emulation mailing list