From owner-freebsd-current@FreeBSD.ORG Sat Aug 30 19:50:06 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DCE8106566C for ; Sat, 30 Aug 2008 19:50:06 +0000 (UTC) (envelope-from artemb@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by mx1.freebsd.org (Postfix) with ESMTP id 2D7038FC1C for ; Sat, 30 Aug 2008 19:50:05 +0000 (UTC) (envelope-from artemb@gmail.com) Received: by ey-out-2122.google.com with SMTP id 6so508330eyi.7 for ; Sat, 30 Aug 2008 12:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=3mA0B1oZfPoIzF0jZx6Ddi8UIwkuufVlXrMM/QLz/Ng=; b=egXitVdYDfGlXnAfgmfjTBwfieqOjB6LraxbSMohmUUkqwL10G6F5/8G6r1Cz52+gM cptrzWUH6QNOaffW0tUCA0dl791oOtsTb4DkTO752dviDluX3yfeRSrWO7xTT5544/jg c5iqGbTaV7U+JVEQs3ghiFhUUoL71r0L+FKfU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=rbMcMtJD5lX+u0BV4beLzOKgWo4yh4fTDRfKWHM5DNrRcYSrmQmyqZmI12J4HRK1y8 sTZH23t5gLiJmLSMQJPzqmnWIy1KIKTb9HD4ainayMuLVRBM437v6V1WcDEPP8mJ7+gz vRM8TOJOadZu2KFm8TF9JjzpWJ7Rk+ud3HE3M= Received: by 10.210.127.13 with SMTP id z13mr3701426ebc.106.1220125804927; Sat, 30 Aug 2008 12:50:04 -0700 (PDT) Received: by 10.210.128.7 with HTTP; Sat, 30 Aug 2008 12:50:04 -0700 (PDT) Message-ID: Date: Sat, 30 Aug 2008 12:50:04 -0700 From: "Artem Belevich" Sender: artemb@gmail.com To: "Kostik Belousov" In-Reply-To: <20080830183804.GG2038@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080830183804.GG2038@deviant.kiev.zoral.com.ua> X-Google-Sender-Auth: 5e217af3dea0bf65 Cc: Bernd Walter , freebsd-current@freebsd.org Subject: Re: __tls_get_addr problem with recent current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Aug 2008 19:50:06 -0000 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 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