Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Aug 2008 12:50:04 -0700
From:      "Artem Belevich" <fbsdlist@src.cx>
To:        "Kostik Belousov" <kostikbel@gmail.com>
Cc:        Bernd Walter <ticso@cicely7.cicely.de>, freebsd-current@freebsd.org
Subject:   Re: __tls_get_addr problem with recent current
Message-ID:  <ed91d4a80808301250j1a4802d4o412c6b5e30979079@mail.gmail.com>
In-Reply-To: <20080830183804.GG2038@deviant.kiev.zoral.com.ua>
References:  <ed91d4a80808300946s49ff076dw64b57f8e9058f2d@mail.gmail.com> <20080830183804.GG2038@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Patch seems to have fixed the problem. The build that used to fail
immediatelly has been going on for few minutes now with no crashes so
far.

Thanks a lot for the quick fix!

--Atem
On 8/30/08, Kostik Belousov <kostikbel@gmail.com> wrote:
>  > Interestingly enough, crash always occurs on "mov    %fs:0x0,%rdi" instruction,
>  > yet the same code in the same binaries works fine when binaries are used
>  > without mixing amd64/i386 binaries. Could that be that amd64 might
>  > somehow inherit invalid registers from i386 binaries?
>
> Quite possible, almost sure. Could you, please, check whether the
>  change below would fix it for you ?
>
>  diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S
>  index f34b0cc..9e13ef4 100644
>  --- a/sys/amd64/amd64/cpu_switch.S
>  +++ b/sys/amd64/amd64/cpu_switch.S
>  @@ -265,6 +265,10 @@ load_seg:
>         movl    PCB_DS(%r8),%ds
>         movl    PCB_ES(%r8),%es
>         movl    PCB_FS(%r8),%fs
>  +       movl    $MSR_FSBASE,%ecx
>  +       rdmsr
>  +       shlq    $32,%rdx
>  +       leaq    (%rax,%rdx),%r9
>         jmp     done_load_seg
>         /* Restore userland %gs while preserving kernel gsbase */
>   2:     movq    PCB_GS32P(%r8),%rax
>
>


-- 
--Artem



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ed91d4a80808301250j1a4802d4o412c6b5e30979079>