From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Sun, 20 Jul 2014 18:35:29 +0200 From: cinap_lenrek@felloff.net To: 9fans@9fans.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] extern register Topicbox-Message-UUID: 07d7a2d8-ead9-11e9-9d60-3106f5b1d025 it doenst matter to runtime what data segment selectors have been loaded in the segment registers in long mode. we initially load them with null seletors and then never touch them again. but the processor *does* check the selectors index when you load a selector into a segment register! the reason i removed the saving and restoring is that i can stop worrying about bad data selectors when devproc or noted sets the ureg of a process. we had todo this on 386 because otherwise the process would #GP when trying to restore the bad selectors. now without restoring the segment registers, it cant #GP and nothing needs to be checked. for GS/FS theres new GS_BASE and FS_BASE msr register that the kernel can set to change GS and FS segment offsets affetcing the offset used by GS and FS segment prefixes. but the kernel would need to switch these msrs in and out for each process and provide a interface for userspace to set ther base. you will need this for something like linuxemu. -- cinap