Single address space in Long mode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Single address space in Long mode

Post by Combuster »

No, it works with multiple CPUs, multiple address spaces and multithreading.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Single address space in Long mode

Post by jal »

Combuster wrote:
jal wrote:but that means the scheduler must update the MSR when switching tasks.
Not necessarily. You can just have it contain a pointer to a valid temporary stack, then update ESP manually. (instead of finding out the value for ESP, then bothering the slow WRMSR with it)
Indeed. Thanks for pointing it out.


JAL
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Single address space in Long mode

Post by Owen »

The convention with syscall/sysret is to use the SWAPGS instruction and hang a "processor control block" off of the kernel's GS.

For this reason, I'm looking forward to clang & llvm maturing, because they have support for declaring a pointer off the GS segment, and therefore better optimized code.
Post Reply