PERFORCE change 143057 for review
Julian Elischer
julian at FreeBSD.org
Fri Jun 6 22:10:19 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=143057
Change 143057 by julian at julian_trafmon1 on 2008/06/06 22:09:21
what a partial change looks like
Affected files ...
.. //depot/projects/vimage-commit/src/sys/amd64/amd64/dump_machdep.c#2 edit
.. //depot/projects/vimage-commit/src/sys/amd64/amd64/minidump_machdep.c#2 edit
.. //depot/projects/vimage-commit/src/sys/arm/arm/dump_machdep.c#2 edit
.. //depot/projects/vimage-commit/src/sys/compat/linprocfs/linprocfs.c#2 edit
.. //depot/projects/vimage-commit/src/sys/compat/linux/linux_ioctl.c#2 edit
.. //depot/projects/vimage-commit/src/sys/compat/linux/linux_misc.c#2 edit
.. //depot/projects/vimage-commit/src/sys/conf/options#2 edit
.. //depot/projects/vimage-commit/src/sys/contrib/pf/net/pfvar.h#2 edit
.. //depot/projects/vimage-commit/src/sys/ddb/db_textdump.c#2 edit
.. //depot/projects/vimage-commit/src/sys/dev/firewire/firewire.c#2 edit
.. //depot/projects/vimage-commit/src/sys/fs/cd9660/cd9660_rrip.c#2 edit
.. //depot/projects/vimage-commit/src/sys/i386/conf/NOTES#2 edit
.. //depot/projects/vimage-commit/src/sys/i386/i386/dump_machdep.c#2 edit
.. //depot/projects/vimage-commit/src/sys/i386/i386/minidump_machdep.c#2 edit
.. //depot/projects/vimage-commit/src/sys/ia64/ia64/dump_machdep.c#2 edit
.. //depot/projects/vimage-commit/src/sys/kern/kern_jail.c#2 edit
.. //depot/projects/vimage-commit/src/sys/kern/kern_linker.c#2 edit
.. //depot/projects/vimage-commit/src/sys/kern/kern_mib.c#2 edit
.. //depot/projects/vimage-commit/src/sys/kern/kern_synch.c#2 edit
.. //depot/projects/vimage-commit/src/sys/kern/kern_uuid.c#2 edit
.. //depot/projects/vimage-commit/src/sys/kern/kern_xxx.c#2 edit
.. //depot/projects/vimage-commit/src/sys/kern/tty.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if_ethersubr.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if_faith.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if_gif.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if_gif.h#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if_loop.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if_mib.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if_stf.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if_tap.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if_tun.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if_var.h#2 edit
.. //depot/projects/vimage-commit/src/sys/net/if_vlan.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/raw_cb.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/raw_usrreq.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/route.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net/rtsock.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net80211/ieee80211.c#2 edit
.. //depot/projects/vimage-commit/src/sys/net80211/ieee80211_ddb.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netgraph/ng_base.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netgraph/ng_eiface.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netgraph/ng_ether.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netgraph/ng_iface.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/if_ether.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/igmp.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/in.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/in_gif.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/in_mcast.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/in_pcb.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/in_rmx.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip6.h#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_fastfwd.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_fw2.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_fw_nat.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_fw_pfil.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_icmp.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_input.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_ipsec.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_mroute.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_options.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_output.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/raw_ip.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/tcp_hostcache.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/tcp_input.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/tcp_output.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/tcp_reass.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/tcp_sack.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/tcp_subr.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/tcp_syncache.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/tcp_timer.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/tcp_timewait.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/tcp_usrreq.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet/udp_usrreq.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/dest6.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/frag6.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/icmp6.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/in6.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/in6_gif.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/in6_ifattach.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/in6_pcb.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/in6_proto.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/in6_rmx.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/in6_src.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/ip6_forward.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/ip6_input.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/ip6_ipsec.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/ip6_mroute.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/ip6_output.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/mld6.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/nd6.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/nd6.h#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/nd6_nbr.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/nd6_rtr.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/raw_ip6.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/route6.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/scope6.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/sctp6_usrreq.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/udp6_usrreq.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/ipsec.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/ipsec.h#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/ipsec_input.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/ipsec_mbuf.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/ipsec_output.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/key.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/key_debug.h#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/keysock.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/xform_ah.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/xform_esp.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/xform_ipcomp.c#2 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/xform_ipip.c#2 edit
.. //depot/projects/vimage-commit/src/sys/nfsclient/nfs_diskless.c#2 edit
.. //depot/projects/vimage-commit/src/sys/nfsclient/nfs_socket.c#2 edit
.. //depot/projects/vimage-commit/src/sys/nfsclient/nfs_vfsops.c#2 edit
.. //depot/projects/vimage-commit/src/sys/nfsclient/nfs_vnops.c#2 edit
.. //depot/projects/vimage-commit/src/sys/rpc/authunix_prot.c#2 edit
.. //depot/projects/vimage-commit/src/sys/sparc64/sparc64/dump_machdep.c#2 edit
.. //depot/projects/vimage-commit/src/sys/sun4v/sun4v/dump_machdep.c#2 edit
.. //depot/projects/vimage-commit/src/sys/sys/vimage.h#1 add
.. //depot/projects/vimage-commit/src/sys/vm/vm_meter.c#2 edit
Differences ...
==== //depot/projects/vimage-commit/src/sys/amd64/amd64/dump_machdep.c#2 (text+ko) ====
@@ -27,6 +27,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/sys/amd64/amd64/dump_machdep.c,v 1.14 2008/02/15 06:26:25 scottl Exp $");
+#include "opt_vimage.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -34,6 +36,7 @@
#include <sys/sysctl.h>
#include <sys/kernel.h>
#include <sys/kerneldump.h>
+#include <sys/vimage.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/elf.h>
@@ -109,6 +112,7 @@
mkdumpheader(struct kerneldumpheader *kdh, uint32_t archver, uint64_t dumplen,
uint32_t blksz)
{
+ INIT_VPROCG(TD_TO_VPROCG(&thread0)); /* XXX */
bzero(kdh, sizeof(*kdh));
strncpy(kdh->magic, KERNELDUMPMAGIC, sizeof(kdh->magic));
@@ -118,7 +122,7 @@
kdh->dumplength = htod64(dumplen);
kdh->dumptime = htod64(time_second);
kdh->blocksize = htod32(blksz);
- strncpy(kdh->hostname, hostname, sizeof(kdh->hostname));
+ strncpy(kdh->hostname, V_hostname, sizeof(kdh->hostname));
strncpy(kdh->versionstring, version, sizeof(kdh->versionstring));
if (panicstr != NULL)
strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring));
==== //depot/projects/vimage-commit/src/sys/amd64/amd64/minidump_machdep.c#2 (text) ====
@@ -27,6 +27,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/sys/amd64/amd64/minidump_machdep.c,v 1.4 2008/02/15 06:26:25 scottl Exp $");
+#include "opt_vimage.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -34,6 +36,7 @@
#include <sys/kernel.h>
#include <sys/kerneldump.h>
#include <sys/msgbuf.h>
+#include <sys/vimage.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/atomic.h>
@@ -85,6 +88,7 @@
mkdumpheader(struct kerneldumpheader *kdh, uint32_t archver, uint64_t dumplen,
uint32_t blksz)
{
+ INIT_VPROCG(TD_TO_VPROCG(curthread)); /* XXX */
bzero(kdh, sizeof(*kdh));
strncpy(kdh->magic, KERNELDUMPMAGIC, sizeof(kdh->magic));
@@ -94,7 +98,7 @@
kdh->dumplength = htod64(dumplen);
kdh->dumptime = htod64(time_second);
kdh->blocksize = htod32(blksz);
- strncpy(kdh->hostname, hostname, sizeof(kdh->hostname));
+ strncpy(kdh->hostname, V_hostname, sizeof(kdh->hostname));
strncpy(kdh->versionstring, version, sizeof(kdh->versionstring));
if (panicstr != NULL)
strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring));
==== //depot/projects/vimage-commit/src/sys/arm/arm/dump_machdep.c#2 (text+ko) ====
@@ -27,6 +27,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/sys/arm/arm/dump_machdep.c,v 1.3 2008/01/28 19:04:06 ru Exp $");
+#include "opt_vimage.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -34,6 +36,7 @@
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/kerneldump.h>
+#include <sys/vimage.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/elf.h>
@@ -107,6 +110,7 @@
mkdumpheader(struct kerneldumpheader *kdh, uint32_t archver, uint64_t dumplen,
uint32_t blksz)
{
+ INIT_VPROCG(TD_TO_VPROCG(&thread0)); /* XXX */
bzero(kdh, sizeof(*kdh));
strncpy(kdh->magic, KERNELDUMPMAGIC, sizeof(kdh->magic));
@@ -116,7 +120,7 @@
kdh->dumplength = htod64(dumplen);
kdh->dumptime = htod64(time_second);
kdh->blocksize = htod32(blksz);
- strncpy(kdh->hostname, hostname, sizeof(kdh->hostname));
+ strncpy(kdh->hostname, V_hostname, sizeof(kdh->hostname));
strncpy(kdh->versionstring, version, sizeof(kdh->versionstring));
if (panicstr != NULL)
strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring));
==== //depot/projects/vimage-commit/src/sys/compat/linprocfs/linprocfs.c#2 (text+ko) ====
@@ -42,6 +42,9 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.119 2008/03/31 12:01:18 kib Exp $");
+#include "opt_compat.h"
+#include "opt_vimage.h"
+
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/blist.h>
@@ -71,6 +74,7 @@
#include <sys/user.h>
#include <sys/vmmeter.h>
#include <sys/vnode.h>
+#include <sys/vimage.h>
#include <net/if.h>
@@ -88,7 +92,6 @@
#include <machine/md_var.h>
#endif /* __i386__ || __amd64__ */
-#include "opt_compat.h"
#ifdef COMPAT_LINUX32 /* XXX */
#include <machine/../linux32/linux.h>
#else
@@ -508,15 +511,16 @@
static int
linprocfs_doloadavg(PFS_FILL_ARGS)
{
+ INIT_VPROCG(TD_TO_VPROCG(curthread));
sbuf_printf(sb,
"%d.%02d %d.%02d %d.%02d %d/%d %d\n",
- (int)(averunnable.ldavg[0] / averunnable.fscale),
- (int)(averunnable.ldavg[0] * 100 / averunnable.fscale % 100),
- (int)(averunnable.ldavg[1] / averunnable.fscale),
- (int)(averunnable.ldavg[1] * 100 / averunnable.fscale % 100),
- (int)(averunnable.ldavg[2] / averunnable.fscale),
- (int)(averunnable.ldavg[2] * 100 / averunnable.fscale % 100),
+ (int)(V_averunnable.ldavg[0] / V_averunnable.fscale),
+ (int)(V_averunnable.ldavg[0] * 100 / V_averunnable.fscale % 100),
+ (int)(V_averunnable.ldavg[1] / V_averunnable.fscale),
+ (int)(V_averunnable.ldavg[1] * 100 / V_averunnable.fscale % 100),
+ (int)(V_averunnable.ldavg[2] / V_averunnable.fscale),
+ (int)(V_averunnable.ldavg[2] * 100 / V_averunnable.fscale % 100),
1, /* number of running tasks */
nprocs, /* number of tasks */
lastpid /* the last pid */
@@ -999,6 +1003,7 @@
static int
linprocfs_donetdev(PFS_FILL_ARGS)
{
+ INIT_VNET_NET(TD_TO_VNET(curthread));
char ifname[16]; /* XXX LINUX_IFNAMSIZ */
struct ifnet *ifp;
@@ -1008,7 +1013,7 @@
"bytes packets errs drop fifo frame compressed");
IFNET_RLOCK();
- TAILQ_FOREACH(ifp, &ifnet, if_link) {
+ TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
linux_ifname(ifp, ifname, sizeof ifname);
sbuf_printf(sb, "%6.6s:", ifname);
sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu ",
==== //depot/projects/vimage-commit/src/sys/compat/linux/linux_ioctl.c#2 (text+ko) ====
@@ -29,6 +29,9 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.139 2007/11/07 16:42:52 kib Exp $");
+#include "opt_vimage.h"
+#include "opt_compat.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysproto.h>
@@ -56,12 +59,12 @@
#include <sys/sx.h>
#include <sys/tty.h>
#include <sys/uio.h>
+#include <sys/vimage.h>
+
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
-#include "opt_compat.h"
-
#ifdef COMPAT_LINUX32
#include <machine/../linux32/linux.h>
#include <machine/../linux32/linux32_proto.h>
@@ -2037,6 +2040,7 @@
int
linux_ifname(struct ifnet *ifp, char *buffer, size_t buflen)
{
+ INIT_VNET_NET(ifp->if_vnet);
struct ifnet *ifscan;
int ethno;
@@ -2047,7 +2051,7 @@
/* Determine the (relative) unit number for ethernet interfaces */
ethno = 0;
IFNET_RLOCK();
- TAILQ_FOREACH(ifscan, &ifnet, if_link) {
+ TAILQ_FOREACH(ifscan, &V_ifnet, if_link) {
if (ifscan == ifp) {
IFNET_RUNLOCK();
return (snprintf(buffer, buflen, "eth%d", ethno));
@@ -2070,6 +2074,7 @@
static struct ifnet *
ifname_linux_to_bsd(const char *lxname, char *bsdname)
{
+ INIT_VNET_NET(TD_TO_VNET(curthread));
struct ifnet *ifp;
int len, unit;
char *ep;
@@ -2086,7 +2091,7 @@
index = 0;
is_eth = (len == 3 && !strncmp(lxname, "eth", len)) ? 1 : 0;
IFNET_RLOCK();
- TAILQ_FOREACH(ifp, &ifnet, if_link) {
+ TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
/*
* Allow Linux programs to use FreeBSD names. Don't presume
* we never have an interface named "eth", so don't make
@@ -2110,6 +2115,7 @@
static int
linux_ifconf(struct thread *td, struct ifconf *uifc)
{
+ INIT_VNET_NET(TD_TO_VNET(td));
#ifdef COMPAT_LINUX32
struct l_ifconf ifc;
#else
@@ -2130,7 +2136,7 @@
/* handle the 'request buffer size' case */
if (ifc.ifc_buf == PTROUT(NULL)) {
ifc.ifc_len = 0;
- TAILQ_FOREACH(ifp, &ifnet, if_link) {
+ TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
struct sockaddr *sa = ifa->ifa_addr;
if (sa->sa_family == AF_INET)
@@ -2157,7 +2163,7 @@
/* Return all AF_INET addresses of all interfaces */
IFNET_RLOCK(); /* could sleep XXX */
- TAILQ_FOREACH(ifp, &ifnet, if_link) {
+ TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
int addrs = 0;
bzero(&ifr, sizeof(ifr));
==== //depot/projects/vimage-commit/src/sys/compat/linux/linux_misc.c#2 (text+ko) ====
@@ -32,6 +32,7 @@
#include "opt_compat.h"
#include "opt_mac.h"
+#include "opt_vimage.h"
#include <sys/param.h>
#include <sys/blist.h>
@@ -64,6 +65,7 @@
#include <sys/vnode.h>
#include <sys/wait.h>
#include <sys/cpuset.h>
+#include <sys/vimage.h>
#include <security/mac/mac_framework.h>
@@ -124,6 +126,7 @@
int
linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args)
{
+ INIT_VPROCG(TD_TO_VPROCG(td));
struct l_sysinfo sysinfo;
vm_object_t object;
int i, j;
@@ -136,8 +139,8 @@
/* Use the information from the mib to get our load averages */
for (i = 0; i < 3; i++)
- sysinfo.loads[i] = averunnable.ldavg[i] *
- LINUX_SYSINFO_LOADS_SCALE / averunnable.fscale;
+ sysinfo.loads[i] = V_averunnable.ldavg[i] *
+ LINUX_SYSINFO_LOADS_SCALE / V_averunnable.fscale;
sysinfo.totalram = physmem * PAGE_SIZE;
sysinfo.freeram = sysinfo.totalram - cnt.v_wire_count * PAGE_SIZE;
@@ -710,6 +713,7 @@
int
linux_newuname(struct thread *td, struct linux_newuname_args *args)
{
+ INIT_VPROCG(TD_TO_VPROCG(td));
struct l_new_utsname utsname;
char osname[LINUX_MAX_UTSNAME];
char osrelease[LINUX_MAX_UTSNAME];
@@ -761,7 +765,7 @@
#else /* something other than i386 or amd64 - assume we and Linux agree */
strlcpy(utsname.machine, machine, LINUX_MAX_UTSNAME);
#endif /* __i386__ */
- strlcpy(utsname.domainname, domainname, LINUX_MAX_UTSNAME);
+ strlcpy(utsname.domainname, V_domainname, LINUX_MAX_UTSNAME);
return (copyout(&utsname, args->buf, sizeof(utsname)));
}
==== //depot/projects/vimage-commit/src/sys/conf/options#2 (text+ko) ====
@@ -765,3 +765,6 @@
#Disable code to dispatch tcp offloading
TCP_OFFLOAD_DISABLE opt_inet.h
+
+# Virtualize the network stack
+VIMAGE opt_vimage.h
==== //depot/projects/vimage-commit/src/sys/contrib/pf/net/pfvar.h#2 (text+ko) ====
@@ -1855,5 +1855,22 @@
struct pf_os_fingerprint *
pf_osfp_validate(void);
+/*
+ * Stack virtualization support.
+ */
+#ifdef VIMAGE
+struct vnet_pf {
+ struct vnet *parent_vnet;
+
+}
+#endif
+
+/*
+ * Symbol translation macros
+ */
+#define INIT_VNET_PF(vnet) \
+ INIT_FROM_VNET(vnet, VNET_MOD_PF, struct vnet_pf, vnet_pf)
+
+#define VNET_PF(sym) VSYM(vnet_pf, sym)
#endif /* _NET_PFVAR_H_ */
==== //depot/projects/vimage-commit/src/sys/ddb/db_textdump.c#2 (text+ko) ====
@@ -60,6 +60,7 @@
__FBSDID("$FreeBSD: src/sys/ddb/db_textdump.c,v 1.3 2008/01/31 16:22:14 rwatson Exp $");
#include "opt_config.h"
+#include "opt_vimage.h"
#include <sys/param.h>
#include <sys/conf.h>
@@ -68,6 +69,7 @@
#include <sys/msgbuf.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
+#include <sys/vimage.h>
#include <ddb/ddb.h>
#include <ddb/db_lex.h>
@@ -183,6 +185,7 @@
mkdumpheader(struct kerneldumpheader *kdh, uint32_t archver,
uint64_t dumplen, uint32_t blksz)
{
+ INIT_VPROCG(TD_TO_VPROCG(&thread0));
bzero(kdh, sizeof(*kdh));
strncpy(kdh->magic, TEXTDUMPMAGIC, sizeof(kdh->magic));
@@ -192,7 +195,7 @@
kdh->dumplength = htod64(dumplen);
kdh->dumptime = htod64(time_second);
kdh->blocksize = htod32(blksz);
- strncpy(kdh->hostname, hostname, sizeof(kdh->hostname));
+ strncpy(kdh->hostname, V_hostname, sizeof(kdh->hostname));
strncpy(kdh->versionstring, version, sizeof(kdh->versionstring));
if (panicstr != NULL)
strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring));
==== //depot/projects/vimage-commit/src/sys/dev/firewire/firewire.c#2 (text+ko) ====
@@ -35,6 +35,8 @@
*
*/
+#include "opt_vimage.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/types.h>
@@ -45,6 +47,7 @@
#include <sys/conf.h>
#include <sys/sysctl.h>
#include <sys/kthread.h>
+#include <sys/vimage.h>
#include <sys/kdb.h>
@@ -677,6 +680,7 @@
static void
fw_reset_crom(struct firewire_comm *fc)
{
+ INIT_VPROCG(TD_TO_VPROCG(curthread)); /* XXX */
struct crom_src_buf *buf;
struct crom_src *src;
struct crom_chunk *root;
@@ -702,7 +706,7 @@
crom_add_simple_text(src, root, &buf->vendor, "FreeBSD Project");
crom_add_entry(root, CSRKEY_HW, __FreeBSD_version);
#endif
- crom_add_simple_text(src, root, &buf->hw, hostname);
+ crom_add_simple_text(src, root, &buf->hw, V_hostname);
}
/*
==== //depot/projects/vimage-commit/src/sys/fs/cd9660/cd9660_rrip.c#2 (text+ko) ====
@@ -34,6 +34,8 @@
* @(#)cd9660_rrip.c 8.6 (Berkeley) 12/5/94
*/
+#include "opt_vimage.h"
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/sys/fs/cd9660/cd9660_rrip.c,v 1.30 2007/02/11 13:54:25 rodrigc Exp $");
@@ -44,6 +46,7 @@
#include <sys/vnode.h>
#include <sys/mount.h>
#include <sys/kernel.h>
+#include <sys/vimage.h>
#include <fs/cd9660/iso.h>
#include <fs/cd9660/cd9660_node.h>
@@ -113,6 +116,7 @@
ISO_RRIP_SLINK *p;
ISO_RRIP_ANALYZE *ana;
{
+ INIT_VPROCG(TD_TO_VPROCG(curthread));
ISO_RRIP_SLINK_COMPONENT *pcomp;
ISO_RRIP_SLINK_COMPONENT *pcompe;
int len, wlen, cont;
@@ -171,8 +175,8 @@
case ISO_SUSP_CFLAG_HOST:
/* Inserting hostname i.e. "kurt.tools.de" */
- inbuf = hostname;
- wlen = strlen(hostname);
+ inbuf = V_hostname;
+ wlen = strlen(V_hostname);
break;
case ISO_SUSP_CFLAG_CONTINUE:
@@ -222,6 +226,7 @@
ISO_RRIP_ALTNAME *p;
ISO_RRIP_ANALYZE *ana;
{
+ INIT_VPROCG(TD_TO_VPROCG(curthread));
char *inbuf;
int wlen;
int cont;
@@ -243,8 +248,8 @@
case ISO_SUSP_CFLAG_HOST:
/* Inserting hostname i.e. "kurt.tools.de" */
- inbuf = hostname;
- wlen = strlen(hostname);
+ inbuf = V_hostname;
+ wlen = strlen(V_hostname);
break;
case ISO_SUSP_CFLAG_CONTINUE:
==== //depot/projects/vimage-commit/src/sys/i386/conf/NOTES#2 (text+ko) ====
@@ -248,8 +248,14 @@
#
# Not all device drivers support this mode of operation at the time of
# this writing. See polling(4) for more details.
+#
+# VIMAGE adds support for maintaining multiple independent network stack
+# state instances in the kernel. This feature is still in early
+# experimental phase, and needs more thought, testing, and documentation.
+#
options DEVICE_POLLING
+options VIMAGE
# BPF_JITTER adds support for BPF just-in-time compiler.
==== //depot/projects/vimage-commit/src/sys/i386/i386/dump_machdep.c#2 (text+ko) ====
@@ -24,6 +24,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "opt_vimage.h"
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/sys/i386/i386/dump_machdep.c,v 1.14 2008/02/15 06:26:25 scottl Exp $");
@@ -34,6 +36,7 @@
#include <sys/sysctl.h>
#include <sys/kernel.h>
#include <sys/kerneldump.h>
+#include <sys/vimage.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/elf.h>
@@ -109,6 +112,7 @@
mkdumpheader(struct kerneldumpheader *kdh, uint32_t archver, uint64_t dumplen,
uint32_t blksz)
{
+ INIT_VPROCG(TD_TO_VPROCG(&thread0)); /* XXX */
bzero(kdh, sizeof(*kdh));
strncpy(kdh->magic, KERNELDUMPMAGIC, sizeof(kdh->magic));
@@ -118,7 +122,7 @@
kdh->dumplength = htod64(dumplen);
kdh->dumptime = htod64(time_second);
kdh->blocksize = htod32(blksz);
- strncpy(kdh->hostname, hostname, sizeof(kdh->hostname));
+ strncpy(kdh->hostname, V_hostname, sizeof(kdh->hostname));
strncpy(kdh->versionstring, version, sizeof(kdh->versionstring));
if (panicstr != NULL)
strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring));
==== //depot/projects/vimage-commit/src/sys/i386/i386/minidump_machdep.c#2 (text) ====
@@ -24,6 +24,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "opt_vimage.h"
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/sys/i386/i386/minidump_machdep.c,v 1.5 2008/02/15 06:26:25 scottl Exp $");
@@ -34,6 +36,7 @@
#include <sys/kernel.h>
#include <sys/kerneldump.h>
#include <sys/msgbuf.h>
+#include <sys/vimage.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/atomic.h>
@@ -83,6 +86,7 @@
mkdumpheader(struct kerneldumpheader *kdh, uint32_t archver, uint64_t dumplen,
uint32_t blksz)
{
+ INIT_VPROCG(TD_TO_VPROCG(curthread));
bzero(kdh, sizeof(*kdh));
strncpy(kdh->magic, KERNELDUMPMAGIC, sizeof(kdh->magic));
@@ -92,7 +96,7 @@
kdh->dumplength = htod64(dumplen);
kdh->dumptime = htod64(time_second);
kdh->blocksize = htod32(blksz);
- strncpy(kdh->hostname, hostname, sizeof(kdh->hostname));
+ strncpy(kdh->hostname, V_hostname, sizeof(kdh->hostname));
strncpy(kdh->versionstring, version, sizeof(kdh->versionstring));
if (panicstr != NULL)
strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring));
==== //depot/projects/vimage-commit/src/sys/ia64/ia64/dump_machdep.c#2 (text+ko) ====
@@ -27,12 +27,15 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/sys/ia64/ia64/dump_machdep.c,v 1.14 2008/01/28 19:04:07 ru Exp $");
+#include "opt_vimage.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/cons.h>
#include <sys/kernel.h>
#include <sys/kerneldump.h>
+#include <sys/vimage.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/efi.h>
@@ -64,6 +67,7 @@
mkdumpheader(struct kerneldumpheader *kdh, uint32_t archver, uint64_t dumplen,
uint32_t blksz)
{
+ INIT_VPROCG(TD_TO_VPROCG(&thread0)); /* XXX */
bzero(kdh, sizeof(*kdh));
strncpy(kdh->magic, KERNELDUMPMAGIC, sizeof(kdh->magic));
@@ -73,7 +77,7 @@
kdh->dumplength = htod64(dumplen);
kdh->dumptime = htod64(time_second);
kdh->blocksize = htod32(blksz);
- strncpy(kdh->hostname, hostname, sizeof(kdh->hostname));
+ strncpy(kdh->hostname, V_hostname, sizeof(kdh->hostname));
strncpy(kdh->versionstring, version, sizeof(kdh->versionstring));
if (panicstr != NULL)
strncpy(kdh->panicstring, panicstr, sizeof(kdh->panicstring));
==== //depot/projects/vimage-commit/src/sys/kern/kern_jail.c#2 (text+ko) ====
@@ -11,6 +11,7 @@
__FBSDID("$FreeBSD: src/sys/kern/kern_jail.c,v 1.77 2008/04/11 21:31:14 delphij Exp $");
#include "opt_mac.h"
+#include "opt_vimage.h"
#include <sys/param.h>
#include <sys/types.h>
@@ -35,6 +36,8 @@
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
#include <sys/vnode.h>
+#include <sys/vimage.h>
+
#include <net/if.h>
#include <netinet/in.h>
@@ -464,13 +467,14 @@
void
getcredhostname(struct ucred *cred, char *buf, size_t size)
{
+ INIT_VPROCG(cred->cr_vimage->v_procg);
if (jailed(cred)) {
mtx_lock(&cred->cr_prison->pr_mtx);
strlcpy(buf, cred->cr_prison->pr_host, size);
mtx_unlock(&cred->cr_prison->pr_mtx);
} else
- strlcpy(buf, hostname, size);
+ strlcpy(buf, V_hostname, size);
}
/*
==== //depot/projects/vimage-commit/src/sys/kern/kern_linker.c#2 (text+ko) ====
@@ -30,6 +30,7 @@
#include "opt_ddb.h"
#include "opt_hwpmc_hooks.h"
#include "opt_mac.h"
+#include "opt_vimage.h"
#include <sys/param.h>
#include <sys/kernel.h>
@@ -51,6 +52,9 @@
#include <sys/vnode.h>
#include <sys/syscallsubr.h>
#include <sys/sysctl.h>
+#include <sys/vimage.h>
+
+#include <net/vnet.h>
#include <security/mac/mac_framework.h>
==== //depot/projects/vimage-commit/src/sys/kern/kern_mib.c#2 (text+ko) ====
@@ -41,6 +41,7 @@
#include "opt_compat.h"
#include "opt_posix.h"
#include "opt_config.h"
+#include "opt_vimage.h"
#include <sys/param.h>
#include <sys/kernel.h>
@@ -53,6 +54,7 @@
#include <sys/jail.h>
#include <sys/smp.h>
#include <sys/unistd.h>
+#include <sys/vimage.h>
SYSCTL_NODE(, 0, sysctl, CTLFLAG_RW, 0,
"Sysctl internal magic");
@@ -206,11 +208,14 @@
SYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD,
machine_arch, 0, "System architecture");
+#ifndef VIMAGE
char hostname[MAXHOSTNAMELEN];
+#endif
static int
sysctl_hostname(SYSCTL_HANDLER_ARGS)
{
+ INIT_VPROCG(TD_TO_VPROCG(req->td));
struct prison *pr;
char tmphostname[MAXHOSTNAMELEN];
int error;
@@ -242,7 +247,7 @@
}
} else
error = sysctl_handle_string(oidp,
- hostname, sizeof hostname, req);
+ V_hostname, sizeof V_hostname, req);
return (error);
}
@@ -328,9 +333,12 @@
0, 0, sysctl_kern_config, "", "Kernel configuration file");
#endif
+#ifndef VIMAGE
char domainname[MAXHOSTNAMELEN];
-SYSCTL_STRING(_kern, KERN_NISDOMAINNAME, domainname, CTLFLAG_RW,
- &domainname, sizeof(domainname), "Name of the current YP/NIS domain");
+#endif
+SYSCTL_V_STRING(V_PROCG, vprocg, _kern, KERN_NISDOMAINNAME, domainname,
+ CTLFLAG_RW, domainname, MAXHOSTNAMELEN,
+ "Name of the current YP/NIS domain");
u_long hostid;
SYSCTL_ULONG(_kern, KERN_HOSTID, hostid, CTLFLAG_RW, &hostid, 0, "Host ID");
==== //depot/projects/vimage-commit/src/sys/kern/kern_synch.c#2 (text+ko) ====
@@ -39,6 +39,7 @@
#include "opt_ktrace.h"
#include "opt_sched.h"
+#include "opt_vimage.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -62,6 +63,7 @@
#include <sys/uio.h>
#include <sys/ktrace.h>
#endif
+#include <sys/vimage.h>
#include <machine/cpu.h>
@@ -493,12 +495,19 @@
int i, nrun;
struct loadavg *avg;
+ VPROCG_ITERLOOP_BEGIN();
+ INIT_VPROCG(vprocg_iter);
+#ifdef VIMAGE
+ nrun = sched_load(vprocg_iter);
+#else
nrun = sched_load();
- avg = &averunnable;
+#endif
+ avg = &V_averunnable;
for (i = 0; i < 3; i++)
avg->ldavg[i] = (cexp[i] * avg->ldavg[i] +
nrun * FSCALE * (FSCALE - cexp[i])) >> FSHIFT;
+ VPROCG_ITERLOOP_END();
/*
* Schedule the next update to occur after 5 seconds, but add a
==== //depot/projects/vimage-commit/src/sys/kern/kern_uuid.c#2 (text+ko) ====
@@ -27,6 +27,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/sys/kern/kern_uuid.c,v 1.13 2007/04/23 12:53:00 pjd Exp $");
+#include "opt_vimage.h"
+
#include <sys/param.h>
#include <sys/endian.h>
#include <sys/kernel.h>
@@ -37,6 +39,7 @@
#include <sys/sysproto.h>
#include <sys/systm.h>
#include <sys/uuid.h>
+#include <sys/vimage.h>
#include <net/if.h>
#include <net/if_dl.h>
@@ -87,13 +90,14 @@
static void
uuid_node(uint16_t *node)
{
+ INIT_VNET_NET(curvnet);
struct ifnet *ifp;
struct ifaddr *ifa;
struct sockaddr_dl *sdl;
int i;
IFNET_RLOCK();
- TAILQ_FOREACH(ifp, &ifnet, if_link) {
+ TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
/* Walk the address list */
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
sdl = (struct sockaddr_dl*)ifa->ifa_addr;
==== //depot/projects/vimage-commit/src/sys/kern/kern_xxx.c#2 (text+ko) ====
@@ -33,6 +33,7 @@
__FBSDID("$FreeBSD: src/sys/kern/kern_xxx.c,v 1.49 2007/03/05 13:10:57 rwatson Exp $");
#include "opt_compat.h"
+#include "opt_vimage.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -44,6 +45,7 @@
#include <sys/mutex.h>
#include <sys/sysctl.h>
#include <sys/utsname.h>
+#include <sys/vimage.h>
#if defined(COMPAT_43)
@@ -245,14 +247,15 @@
struct thread *td;
struct getdomainname_args *uap;
{
+ INIT_VPROCG(TD_TO_VPROCG(td));
int domainnamelen;
int error;
mtx_lock(&Giant);
- domainnamelen = strlen(domainname) + 1;
+ domainnamelen = strlen(V_domainname) + 1;
if ((u_int)uap->len > domainnamelen)
uap->len = domainnamelen;
- error = copyout(domainname, uap->domainname, uap->len);
+ error = copyout(V_domainname, uap->domainname, uap->len);
mtx_unlock(&Giant);
return (error);
}
@@ -269,19 +272,21 @@
struct thread *td;
struct setdomainname_args *uap;
{
+ INIT_VPROCG(TD_TO_VPROCG(td));
int error, domainnamelen;
error = priv_check(td, PRIV_SETDOMAINNAME);
+printf("setdomainname error=%d\n", error);
if (error)
return (error);
mtx_lock(&Giant);
- if ((u_int)uap->len > sizeof (domainname) - 1) {
+ if ((u_int)uap->len > sizeof (V_domainname) - 1) {
error = EINVAL;
goto done2;
}
domainnamelen = uap->len;
- error = copyin(uap->domainname, domainname, uap->len);
- domainname[domainnamelen] = 0;
+ error = copyin(uap->domainname, V_domainname, uap->len);
+ V_domainname[domainnamelen] = 0;
done2:
mtx_unlock(&Giant);
return (error);
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list