From owner-freebsd-virtualization@FreeBSD.ORG Fri Sep 19 17:55:06 2008 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B8421065687 for ; Fri, 19 Sep 2008 17:55:06 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outA.internet-mail-service.net (outa.internet-mail-service.net [216.240.47.224]) by mx1.freebsd.org (Postfix) with ESMTP id 3789D8FC12 for ; Fri, 19 Sep 2008 17:55:06 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id B7C522416; Fri, 19 Sep 2008 10:55:05 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 57D292D6024; Fri, 19 Sep 2008 10:55:05 -0700 (PDT) Message-ID: <48D3E778.3020305@elischer.org> Date: Fri, 19 Sep 2008 10:55:04 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Marko Zec References: <200809191743.m8JHhZj8009388@repoman.freebsd.org> In-Reply-To: <200809191743.m8JHhZj8009388@repoman.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Perforce Change Reviews , FreeBSD virtualization mailing list Subject: vimage and curvnet. X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Sep 2008 17:55:06 -0000 Marko Zec wrote: > http://perforce.freebsd.org/chv.cgi?CH=150125 > > Change 150125 by zec@zec_tpx32 on 2008/09/19 17:43:14 > > curvnet is never set on entry to sysctl handlers, thus > set the vnet context via TD_TO_VNET(curthread), because > all threads must have a cred->vimage->vnet context set. it seems to me that vnet is an important enough variable that we could put it in the pcpu structure and have the scheduler set it up on context switches when vimage is compiled in. thus it would always be directly available. i.e. %gs:CURVNET_OFFSET or whatever the syntax is on x86 and the equivalent on other architectures. > > Affected files ... > > .. //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#14 edit > > Differences ... > > ==== //depot/projects/vimage-commit2/src/sys/netinet/tcp_subr.c#14 (text+ko) ==== > > @@ -119,7 +119,7 @@ > static int > sysctl_net_inet_tcp_mss_check(SYSCTL_HANDLER_ARGS) > { > - INIT_VNET_INET(curvnet); > + INIT_VNET_INET(TD_TO_VNET(curthread)); > int error, new; > > new = V_tcp_mssdflt; > @@ -141,7 +141,7 @@ > static int > sysctl_net_inet_tcp_mss_v6_check(SYSCTL_HANDLER_ARGS) > { > - INIT_VNET_INET6(curvnet); > + INIT_VNET_INET6(TD_TO_VNET(curthread)); > int error, new; > > new = V_tcp_v6mssdflt;