From owner-freebsd-current@FreeBSD.ORG Tue Sep 25 15:17:13 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B0371065674; Tue, 25 Sep 2012 15:17:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3E7738FC1A; Tue, 25 Sep 2012 15:17:13 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AD68AB990; Tue, 25 Sep 2012 11:17:12 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Tue, 25 Sep 2012 11:07:02 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <5F3C03B6-01D0-42DE-BE9E-323DBDC90C8E@neville-neil.com> <20120921092235.GC66984@gmail.com> <505C9C58.3060006@freebsd.org> In-Reply-To: <505C9C58.3060006@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201209251107.02279.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 25 Sep 2012 11:17:12 -0400 (EDT) Cc: Mikolaj Golub , Anuranjan Shukla , FreeBSD Current Subject: Re: Proposal for change to kernel linker for fixing a VNET and DPCPU problem. 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: Tue, 25 Sep 2012 15:17:13 -0000 On Friday, September 21, 2012 12:56:56 pm Julian Elischer wrote: > On 9/21/12 2:22 AM, Mikolaj Golub wrote: > > On Fri, Sep 07, 2012 at 01:28:16AM -0700, Anuranjan Shukla wrote: > >> Hi George, > >> Thanks for taking a look. Some answers/comments below. > >> > >>>> Building FreeBSD without the network stack (network stack as a module) > >>>> ---------------------------------------------------------------------- > >>>> > >>> This would be interesting for many reasons, and I think it would be a good > >>> contribution. Does the work you've done in this area handle the VNET > >>> stuff that is in the stack as well? That is, how well does the network > >>> stack > >>> as a module play with the vnet architecture? > >> I'll follow up on this one separately. > > FYI, there is at least this issue with virtualized global variables in modules: > > > > http://lists.freebsd.org/pipermail/freebsd-virtualization/2011-July/000737.html > > > > On archs that use link_elf.c (i.e. all except amd64, which uses > > link_elf_obj.c) virtualized global variables in modules can not be > > accessed from another modules, because link_elf on a module load does > > relocation only for VNET variables defined in this module. > > > > As it was pointed by Marko Zec, the same issue is with DPCPU. > > > > The latest patch I have (both for VNET and DPCPU): > > > > http://people.freebsd.org/~trociny/link_elf.c.pcpu_vnet.patch > > > > The fix is to make the linker on a module load recognize "external" > > VNET/DPCPU variables defined in the previously loaded modules and > > relocate them accordingly. For this set_pcpu_list and set_vnet_list > > are used, where the addresses of modules 'set_pcpu' and 'set_vnet' > > linker sets are stored in. > > it makes sense to me, but I really am not a linker person.. > I think it woul be good to get Doug Rabson to weigh in on it, and > maybe john Baldwin.. > > moving to -current as it's not a "net" issue really.. I think the proposed patch is ok. -- John Baldwin