Messages in this thread | | | Date | Tue, 18 Nov 2008 06:45:56 -0800 | From | Arjan van de Ven <> | Subject | Re: [x86] do_arch_prctl - bug? |
| |
On Tue, 18 Nov 2008 15:33:32 +0100 Eric Lacombe <goretux@gmail.com> wrote:
> Hello, > > I would like to know why the ARCH_SET_GS action of sys_arch_prctl, > write the MSR MSR_KERNEL_GS_BASE and not the MSR MSR_GS_BASE when the > variable "doit" equals 1? Is that a bug? >
I don't think it is. The trick is that we use "swapgs" on entering/leaving the kernel, and that will "swap" gs with the MSR, so when we return to userspace, GS gets loaded from the MSR_KERNEL_GS_BASE ...
-- Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org
| |