From owner-freebsd-emulation@FreeBSD.ORG Tue Oct 9 00:49:02 2007 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BD8916A419 for ; Tue, 9 Oct 2007 00:49:02 +0000 (UTC) (envelope-from mihai.dontu@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.184]) by mx1.freebsd.org (Postfix) with ESMTP id D323213C4BA for ; Tue, 9 Oct 2007 00:49:01 +0000 (UTC) (envelope-from mihai.dontu@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so1112650nfb for ; Mon, 08 Oct 2007 17:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:organization:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; bh=ZvzvvTYVEGroxDmyzr99TZIKglp8BlDhBjq58r4MEr4=; b=lA+aKUlE2kReL7QZhi+uokJm4PfvKn6EcPjaPJk3gZbjTfHZ1xY7wKBEXpIqmToV6t0kJqnpCocHyEEIiCk+JV1OezJaRs+fEoimKSJwZSeF7GMyZHc/QwyPbOns1586BbF3icgRe7NJdC6XO6T4ca3aFAGsb+8LojaifI9VT/Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:organization:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=Hbwdp2huknyqGtloqAt7FGvtiPrr8Mqo+yPeIcdjj6KBGV91hNgQPoBh3Q1qGsrbu9jZk+XF7j7MTKVAH7XKDCcAO/pv/HyB55inwycy5AuUnpkCqaER/JOsFPP2klxiZjm2XLSABQ8nVicgB31SkUSOI0aTwvgWWULyYqJIMH0= Received: by 10.86.51.2 with SMTP id y2mr5539144fgy.1191890939932; Mon, 08 Oct 2007 17:48:59 -0700 (PDT) Received: from ?192.168.0.3? ( [77.81.70.38]) by mx.google.com with ESMTPS id 28sm7246968fkx.2007.10.08.17.48.58 (version=SSLv3 cipher=OTHER); Mon, 08 Oct 2007 17:48:58 -0700 (PDT) From: Mihai =?utf-8?q?Don=C8=9Bu?= Organization: Home To: Jung-uk Kim Date: Tue, 9 Oct 2007 03:48:51 +0300 User-Agent: KMail/1.9.7 References: <200710082135.58099.mihai.dontu@gmail.com> <200710090100.58577.mihai.dontu@gmail.com> <200710081841.35968.jkim@FreeBSD.org> In-Reply-To: <200710081841.35968.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200710090348.52036.mihai.dontu@gmail.com> Cc: freebsd-emulation@freebsd.org, freebsd-questions@freebsd.org Subject: Re: amd64_set_gsbase() X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Oct 2007 00:49:02 -0000 On Tuesday 09 October 2007, Jung-uk Kim wrote: > In long mode, we don't really care about segment registers. While > implementing TLS for Linuxulator, I had to do the following hack, for > example: > > http://docs.freebsd.org/cgi/mid.cgi?200703300006.l2U06LA1075891 > > Under Linux and Windows, they do preserve segment registers vs. base > addresses mapping for backward compatibility, AFAIK with some > performance penalty. Ah! But you are doing your magic _in the kernel_. I don't have this luxury :) I have to do everything in user space (as a normal user) on an out-of-the-box FreeBSD (-stable). I have *one* more question: maybe I don't fully understand the hole BASE thing, but since the FreeBSD kernel does not preserve %gs and %fs, what is the purpose of amd64_set_XXbase()? Thanks, -- Mihai Donțu