bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/5] add setting gs/fsbase


From: Sergey Bugaev
Subject: Re: [PATCH 5/5] add setting gs/fsbase
Date: Sat, 6 May 2023 13:12:36 +0300

Hello,

On Tue, Apr 25, 2023 at 1:59 PM Samuel Thibault <samuel.thibault@gnu.org> wrote:
> Sergey Bugaev, le mar. 25 avril 2023 13:25:02 +0300, a ecrit:
> > @@ -733,6 +734,10 @@ boolean_t thread_invoke(
> >
> >                     counter(c_thread_invoke_hits++);
> >                     (void) spl0();
> > +#ifdef __x86_64__
> > +                   wrmsr(MSR_REG_FSBASE, new_thread->pcb->iss.fsbase);
> > +                   wrmsr(MSR_REG_GSBASE, new_thread->pcb->iss.gsbase);
> > +#endif
>
> I guess it could belong to switch_ktss?

I'm now hitting this same issue with the fast RPC codepath:

#0  stack_handoff (old=old@entry=0xffffffff90ecd828,
new=new@entry=0xffffffff90ecd620) at ../i386/i386/pcb.c:301
#1  0xffffffff8104f6c4 in thread_handoff
(old=old@entry=0xffffffff90ecd828,
continuation=continuation@entry=0xffffffff81046f30
<mach_msg_continue>,
    new=new@entry=0xffffffff90ecd620) at ../kern/ipc_sched.c:239
#2  0xffffffff810485b4 in mach_msg_trap (msg=0xbfffeca0,
option=<optimized out>, send_size=1096, rcv_size=<optimized out>,
rcv_name=3, time_out=<optimized out>,
    notify=<optimized out>) at ../ipc/mach_msg.c:830
#3  0xffffffff81011eb2 in syscall64 () at ../x86_64/locore.S:1430

This is ld.so in the exec server task trying to dir_lookup
("/hurd/exec") -- it then crashes ext2fs when it tries to access the
TCB. But before that, ext2fs starts up, spawns all those
libports/libpager worker threads (which now start up correctly),
resumes exec, and ld.so begins starting up, which means the SHARED /
IS_IN (rtld) build is not super broken either \o/

Indeed it looks like switch_ktss is a better place for setting
fsgs_base, I'm going to try that next.

Sergey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]