History log of /netbsd-current/sys/rump/librump/rumpkern/emul.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.201 15-Oct-2023 riastradh

rump: Sprinkle sys/syncobj.h here too.


# 1.200 28-Sep-2023 manu

Fix root search in RAID 1 sets

We use the wedge information given by bootstrap, where the kernel was
found. This requires src/sys/arch/i386/stand/i386/lib/biosdisk.c 1.59
to work in all cases.


# 1.199 22-Apr-2023 riastradh

rumpkern: Provide stub pnbuf_cache weak alias.

Needed only by sys_module.c handle_modctl_load, which won't work if
there's no rumpvfs linked in anyway.


# 1.198 22-Apr-2023 riastradh

rumpkern: Provide fs_filtops weak alias.

We should introduce a link set for sys_kfilters, but this works
around the problem for now -- librump's dependency on librumpvfs
symbols.


# 1.197 26-Feb-2023 skrll

nkmempages should be size_t


Revision tags: netbsd-10-base bouyer-sunxi-drm-base thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.196 30-Apr-2020 riastradh

Rewrite entropy subsystem.

Primary goals:

1. Use cryptography primitives designed and vetted by cryptographers.
2. Be honest about entropy estimation.
3. Propagate full entropy as soon as possible.
4. Simplify the APIs.
5. Reduce overhead of rnd_add_data and cprng_strong.
6. Reduce side channels of HWRNG data and human input sources.
7. Improve visibility of operation with sysctl and event counters.

Caveat: rngtest is no longer used generically for RND_TYPE_RNG
rndsources. Hardware RNG devices should have hardware-specific
health tests. For example, checking for two repeated 256-bit outputs
works to detect AMD's 2019 RDRAND bug. Not all hardware RNGs are
necessarily designed to produce exactly uniform output.

ENTROPY POOL

- A Keccak sponge, with test vectors, replaces the old LFSR/SHA-1
kludge as the cryptographic primitive.

- `Entropy depletion' is available for testing purposes with a sysctl
knob kern.entropy.depletion; otherwise it is disabled, and once the
system reaches full entropy it is assumed to stay there as far as
modern cryptography is concerned.

- No `entropy estimation' based on sample values. Such `entropy
estimation' is a contradiction in terms, dishonest to users, and a
potential source of side channels. It is the responsibility of the
driver author to study the entropy of the process that generates
the samples.

- Per-CPU gathering pools avoid contention on a global queue.

- Entropy is occasionally consolidated into global pool -- as soon as
it's ready, if we've never reached full entropy, and with a rate
limit afterward. Operators can force consolidation now by running
sysctl -w kern.entropy.consolidate=1.

- rndsink(9) API has been replaced by an epoch counter which changes
whenever entropy is consolidated into the global pool.
. Usage: Cache entropy_epoch() when you seed. If entropy_epoch()
has changed when you're about to use whatever you seeded, reseed.
. Epoch is never zero, so initialize cache to 0 if you want to reseed
on first use.
. Epoch is -1 iff we have never reached full entropy -- in other
words, the old rnd_initial_entropy is (entropy_epoch() != -1) --
but it is better if you check for changes rather than for -1, so
that if the system estimated its own entropy incorrectly, entropy
consolidation has the opportunity to prevent future compromise.

- Sysctls and event counters provide operator visibility into what's
happening:
. kern.entropy.needed - bits of entropy short of full entropy
. kern.entropy.pending - bits known to be pending in per-CPU pools,
can be consolidated with sysctl -w kern.entropy.consolidate=1
. kern.entropy.epoch - number of times consolidation has happened,
never 0, and -1 iff we have never reached full entropy

CPRNG_STRONG

- A cprng_strong instance is now a collection of per-CPU NIST
Hash_DRBGs. There are only two in the system: user_cprng for
/dev/urandom and sysctl kern.?random, and kern_cprng for kernel
users which may need to operate in interrupt context up to IPL_VM.

(Calling cprng_strong in interrupt context does not strike me as a
particularly good idea, so I added an event counter to see whether
anything actually does.)

- Event counters provide operator visibility into when reseeding
happens.

INTEL RDRAND/RDSEED, VIA C3 RNG (CPU_RNG)

- Unwired for now; will be rewired in a subsequent commit.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.195 02-Jan-2020 thorpej

- Eliminate the global "boottime" variable, which was being accessed
without any synchronization against changes by e.g. clock_settime().
- Replace with new getbinboottime() / getnanoboottime() / getmicroboottime()
functions (naming mirrors that of other time access functions in kern_tc.c).
It returns the (maybe-converted) value of timebasebin, which also tracks
our estimate of when the system was booted (i.e. the legacy "boottime" was
redundant).

XXX There needs to be a lockless synchronization mechanism for reading
timebasebin, but this is a problem in kern_tc.c that pre-existed these
"boottime" changes. At least now the problem is centralized in one location.


# 1.194 02-Jan-2020 martin

Add shutting_down variable for rump.


# 1.193 16-Dec-2019 ad

- Extend the per-CPU counters matt@ did to include all of the hot counters
in UVM, excluding uvmexp.free, which needs special treatment and will be
done with a separate commit. Cuts system time for a build by 20-25% on
a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).


Revision tags: phil-wifi-20191119
# 1.192 26-Sep-2019 bad

Provide a weak alias for vnode_to_path to be used unless librumpvfs is present.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609
# 1.191 02-Jun-2019 kre

Apply a patch from hannken@ which adds a weak alias for rump_getcwd_common()
allowing -lrump to be used without -lrumpvfs.

This is an alternate fix to the earluer one which added -lrumvfs to
many rump based tests (and the rump server) which might be undone soon.

This also fixes the sun2 build.


Revision tags: isaki-audio2-base
# 1.190 09-Mar-2019 hannken

Rumpkernel has its own thread deallocation. Add missing fstrans_lwp_dtor()
to lwproc_freelwp().

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.189 05-Dec-2018 christos

no more need for get_expose_address() here.


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020
# 1.188 06-Oct-2018 christos

add get_expose_address()


# 1.187 05-Oct-2018 hannken

Bring back three state file system suspension:

NORMAL -> SUSPENDING -> SUSPENDED

and add operation fstrans_start_lazy() that only blocks while SUSPENDED.

Change vndthread() support operation handle_with_rdwr() to bracket
its file system operations by fstrans_start_lazy() and fstrans_done().

PR kern/53624 (dom0 freeze on domU exit)


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.186 10-Aug-2018 pgoyette

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

branches: 1.185.2; 1.185.4;
Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.200 28-Sep-2023 manu

Fix root search in RAID 1 sets

We use the wedge information given by bootstrap, where the kernel was
found. This requires src/sys/arch/i386/stand/i386/lib/biosdisk.c 1.59
to work in all cases.


# 1.199 22-Apr-2023 riastradh

rumpkern: Provide stub pnbuf_cache weak alias.

Needed only by sys_module.c handle_modctl_load, which won't work if
there's no rumpvfs linked in anyway.


# 1.198 22-Apr-2023 riastradh

rumpkern: Provide fs_filtops weak alias.

We should introduce a link set for sys_kfilters, but this works
around the problem for now -- librump's dependency on librumpvfs
symbols.


# 1.197 26-Feb-2023 skrll

nkmempages should be size_t


Revision tags: netbsd-10-base bouyer-sunxi-drm-base thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.196 30-Apr-2020 riastradh

Rewrite entropy subsystem.

Primary goals:

1. Use cryptography primitives designed and vetted by cryptographers.
2. Be honest about entropy estimation.
3. Propagate full entropy as soon as possible.
4. Simplify the APIs.
5. Reduce overhead of rnd_add_data and cprng_strong.
6. Reduce side channels of HWRNG data and human input sources.
7. Improve visibility of operation with sysctl and event counters.

Caveat: rngtest is no longer used generically for RND_TYPE_RNG
rndsources. Hardware RNG devices should have hardware-specific
health tests. For example, checking for two repeated 256-bit outputs
works to detect AMD's 2019 RDRAND bug. Not all hardware RNGs are
necessarily designed to produce exactly uniform output.

ENTROPY POOL

- A Keccak sponge, with test vectors, replaces the old LFSR/SHA-1
kludge as the cryptographic primitive.

- `Entropy depletion' is available for testing purposes with a sysctl
knob kern.entropy.depletion; otherwise it is disabled, and once the
system reaches full entropy it is assumed to stay there as far as
modern cryptography is concerned.

- No `entropy estimation' based on sample values. Such `entropy
estimation' is a contradiction in terms, dishonest to users, and a
potential source of side channels. It is the responsibility of the
driver author to study the entropy of the process that generates
the samples.

- Per-CPU gathering pools avoid contention on a global queue.

- Entropy is occasionally consolidated into global pool -- as soon as
it's ready, if we've never reached full entropy, and with a rate
limit afterward. Operators can force consolidation now by running
sysctl -w kern.entropy.consolidate=1.

- rndsink(9) API has been replaced by an epoch counter which changes
whenever entropy is consolidated into the global pool.
. Usage: Cache entropy_epoch() when you seed. If entropy_epoch()
has changed when you're about to use whatever you seeded, reseed.
. Epoch is never zero, so initialize cache to 0 if you want to reseed
on first use.
. Epoch is -1 iff we have never reached full entropy -- in other
words, the old rnd_initial_entropy is (entropy_epoch() != -1) --
but it is better if you check for changes rather than for -1, so
that if the system estimated its own entropy incorrectly, entropy
consolidation has the opportunity to prevent future compromise.

- Sysctls and event counters provide operator visibility into what's
happening:
. kern.entropy.needed - bits of entropy short of full entropy
. kern.entropy.pending - bits known to be pending in per-CPU pools,
can be consolidated with sysctl -w kern.entropy.consolidate=1
. kern.entropy.epoch - number of times consolidation has happened,
never 0, and -1 iff we have never reached full entropy

CPRNG_STRONG

- A cprng_strong instance is now a collection of per-CPU NIST
Hash_DRBGs. There are only two in the system: user_cprng for
/dev/urandom and sysctl kern.?random, and kern_cprng for kernel
users which may need to operate in interrupt context up to IPL_VM.

(Calling cprng_strong in interrupt context does not strike me as a
particularly good idea, so I added an event counter to see whether
anything actually does.)

- Event counters provide operator visibility into when reseeding
happens.

INTEL RDRAND/RDSEED, VIA C3 RNG (CPU_RNG)

- Unwired for now; will be rewired in a subsequent commit.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.195 02-Jan-2020 thorpej

- Eliminate the global "boottime" variable, which was being accessed
without any synchronization against changes by e.g. clock_settime().
- Replace with new getbinboottime() / getnanoboottime() / getmicroboottime()
functions (naming mirrors that of other time access functions in kern_tc.c).
It returns the (maybe-converted) value of timebasebin, which also tracks
our estimate of when the system was booted (i.e. the legacy "boottime" was
redundant).

XXX There needs to be a lockless synchronization mechanism for reading
timebasebin, but this is a problem in kern_tc.c that pre-existed these
"boottime" changes. At least now the problem is centralized in one location.


# 1.194 02-Jan-2020 martin

Add shutting_down variable for rump.


# 1.193 16-Dec-2019 ad

- Extend the per-CPU counters matt@ did to include all of the hot counters
in UVM, excluding uvmexp.free, which needs special treatment and will be
done with a separate commit. Cuts system time for a build by 20-25% on
a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).


Revision tags: phil-wifi-20191119
# 1.192 26-Sep-2019 bad

Provide a weak alias for vnode_to_path to be used unless librumpvfs is present.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609
# 1.191 02-Jun-2019 kre

Apply a patch from hannken@ which adds a weak alias for rump_getcwd_common()
allowing -lrump to be used without -lrumpvfs.

This is an alternate fix to the earluer one which added -lrumvfs to
many rump based tests (and the rump server) which might be undone soon.

This also fixes the sun2 build.


Revision tags: isaki-audio2-base
# 1.190 09-Mar-2019 hannken

Rumpkernel has its own thread deallocation. Add missing fstrans_lwp_dtor()
to lwproc_freelwp().

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.189 05-Dec-2018 christos

no more need for get_expose_address() here.


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020
# 1.188 06-Oct-2018 christos

add get_expose_address()


# 1.187 05-Oct-2018 hannken

Bring back three state file system suspension:

NORMAL -> SUSPENDING -> SUSPENDED

and add operation fstrans_start_lazy() that only blocks while SUSPENDED.

Change vndthread() support operation handle_with_rdwr() to bracket
its file system operations by fstrans_start_lazy() and fstrans_done().

PR kern/53624 (dom0 freeze on domU exit)


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.186 10-Aug-2018 pgoyette

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

branches: 1.185.2; 1.185.4;
Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.199 22-Apr-2023 riastradh

rumpkern: Provide stub pnbuf_cache weak alias.

Needed only by sys_module.c handle_modctl_load, which won't work if
there's no rumpvfs linked in anyway.


# 1.198 22-Apr-2023 riastradh

rumpkern: Provide fs_filtops weak alias.

We should introduce a link set for sys_kfilters, but this works
around the problem for now -- librump's dependency on librumpvfs
symbols.


# 1.197 26-Feb-2023 skrll

nkmempages should be size_t


Revision tags: netbsd-10-base bouyer-sunxi-drm-base thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.196 30-Apr-2020 riastradh

Rewrite entropy subsystem.

Primary goals:

1. Use cryptography primitives designed and vetted by cryptographers.
2. Be honest about entropy estimation.
3. Propagate full entropy as soon as possible.
4. Simplify the APIs.
5. Reduce overhead of rnd_add_data and cprng_strong.
6. Reduce side channels of HWRNG data and human input sources.
7. Improve visibility of operation with sysctl and event counters.

Caveat: rngtest is no longer used generically for RND_TYPE_RNG
rndsources. Hardware RNG devices should have hardware-specific
health tests. For example, checking for two repeated 256-bit outputs
works to detect AMD's 2019 RDRAND bug. Not all hardware RNGs are
necessarily designed to produce exactly uniform output.

ENTROPY POOL

- A Keccak sponge, with test vectors, replaces the old LFSR/SHA-1
kludge as the cryptographic primitive.

- `Entropy depletion' is available for testing purposes with a sysctl
knob kern.entropy.depletion; otherwise it is disabled, and once the
system reaches full entropy it is assumed to stay there as far as
modern cryptography is concerned.

- No `entropy estimation' based on sample values. Such `entropy
estimation' is a contradiction in terms, dishonest to users, and a
potential source of side channels. It is the responsibility of the
driver author to study the entropy of the process that generates
the samples.

- Per-CPU gathering pools avoid contention on a global queue.

- Entropy is occasionally consolidated into global pool -- as soon as
it's ready, if we've never reached full entropy, and with a rate
limit afterward. Operators can force consolidation now by running
sysctl -w kern.entropy.consolidate=1.

- rndsink(9) API has been replaced by an epoch counter which changes
whenever entropy is consolidated into the global pool.
. Usage: Cache entropy_epoch() when you seed. If entropy_epoch()
has changed when you're about to use whatever you seeded, reseed.
. Epoch is never zero, so initialize cache to 0 if you want to reseed
on first use.
. Epoch is -1 iff we have never reached full entropy -- in other
words, the old rnd_initial_entropy is (entropy_epoch() != -1) --
but it is better if you check for changes rather than for -1, so
that if the system estimated its own entropy incorrectly, entropy
consolidation has the opportunity to prevent future compromise.

- Sysctls and event counters provide operator visibility into what's
happening:
. kern.entropy.needed - bits of entropy short of full entropy
. kern.entropy.pending - bits known to be pending in per-CPU pools,
can be consolidated with sysctl -w kern.entropy.consolidate=1
. kern.entropy.epoch - number of times consolidation has happened,
never 0, and -1 iff we have never reached full entropy

CPRNG_STRONG

- A cprng_strong instance is now a collection of per-CPU NIST
Hash_DRBGs. There are only two in the system: user_cprng for
/dev/urandom and sysctl kern.?random, and kern_cprng for kernel
users which may need to operate in interrupt context up to IPL_VM.

(Calling cprng_strong in interrupt context does not strike me as a
particularly good idea, so I added an event counter to see whether
anything actually does.)

- Event counters provide operator visibility into when reseeding
happens.

INTEL RDRAND/RDSEED, VIA C3 RNG (CPU_RNG)

- Unwired for now; will be rewired in a subsequent commit.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.195 02-Jan-2020 thorpej

- Eliminate the global "boottime" variable, which was being accessed
without any synchronization against changes by e.g. clock_settime().
- Replace with new getbinboottime() / getnanoboottime() / getmicroboottime()
functions (naming mirrors that of other time access functions in kern_tc.c).
It returns the (maybe-converted) value of timebasebin, which also tracks
our estimate of when the system was booted (i.e. the legacy "boottime" was
redundant).

XXX There needs to be a lockless synchronization mechanism for reading
timebasebin, but this is a problem in kern_tc.c that pre-existed these
"boottime" changes. At least now the problem is centralized in one location.


# 1.194 02-Jan-2020 martin

Add shutting_down variable for rump.


# 1.193 16-Dec-2019 ad

- Extend the per-CPU counters matt@ did to include all of the hot counters
in UVM, excluding uvmexp.free, which needs special treatment and will be
done with a separate commit. Cuts system time for a build by 20-25% on
a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).


Revision tags: phil-wifi-20191119
# 1.192 26-Sep-2019 bad

Provide a weak alias for vnode_to_path to be used unless librumpvfs is present.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609
# 1.191 02-Jun-2019 kre

Apply a patch from hannken@ which adds a weak alias for rump_getcwd_common()
allowing -lrump to be used without -lrumpvfs.

This is an alternate fix to the earluer one which added -lrumvfs to
many rump based tests (and the rump server) which might be undone soon.

This also fixes the sun2 build.


Revision tags: isaki-audio2-base
# 1.190 09-Mar-2019 hannken

Rumpkernel has its own thread deallocation. Add missing fstrans_lwp_dtor()
to lwproc_freelwp().

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.189 05-Dec-2018 christos

no more need for get_expose_address() here.


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020
# 1.188 06-Oct-2018 christos

add get_expose_address()


# 1.187 05-Oct-2018 hannken

Bring back three state file system suspension:

NORMAL -> SUSPENDING -> SUSPENDED

and add operation fstrans_start_lazy() that only blocks while SUSPENDED.

Change vndthread() support operation handle_with_rdwr() to bracket
its file system operations by fstrans_start_lazy() and fstrans_done().

PR kern/53624 (dom0 freeze on domU exit)


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.186 10-Aug-2018 pgoyette

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

branches: 1.185.2; 1.185.4;
Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.197 26-Feb-2023 skrll

nkmempages should be size_t


Revision tags: netbsd-10-base bouyer-sunxi-drm-base thorpej-i2c-spi-conf2-base thorpej-futex2-base thorpej-cfargs2-base cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base thorpej-i2c-spi-conf-base thorpej-cfargs-base thorpej-futex-base
# 1.196 30-Apr-2020 riastradh

Rewrite entropy subsystem.

Primary goals:

1. Use cryptography primitives designed and vetted by cryptographers.
2. Be honest about entropy estimation.
3. Propagate full entropy as soon as possible.
4. Simplify the APIs.
5. Reduce overhead of rnd_add_data and cprng_strong.
6. Reduce side channels of HWRNG data and human input sources.
7. Improve visibility of operation with sysctl and event counters.

Caveat: rngtest is no longer used generically for RND_TYPE_RNG
rndsources. Hardware RNG devices should have hardware-specific
health tests. For example, checking for two repeated 256-bit outputs
works to detect AMD's 2019 RDRAND bug. Not all hardware RNGs are
necessarily designed to produce exactly uniform output.

ENTROPY POOL

- A Keccak sponge, with test vectors, replaces the old LFSR/SHA-1
kludge as the cryptographic primitive.

- `Entropy depletion' is available for testing purposes with a sysctl
knob kern.entropy.depletion; otherwise it is disabled, and once the
system reaches full entropy it is assumed to stay there as far as
modern cryptography is concerned.

- No `entropy estimation' based on sample values. Such `entropy
estimation' is a contradiction in terms, dishonest to users, and a
potential source of side channels. It is the responsibility of the
driver author to study the entropy of the process that generates
the samples.

- Per-CPU gathering pools avoid contention on a global queue.

- Entropy is occasionally consolidated into global pool -- as soon as
it's ready, if we've never reached full entropy, and with a rate
limit afterward. Operators can force consolidation now by running
sysctl -w kern.entropy.consolidate=1.

- rndsink(9) API has been replaced by an epoch counter which changes
whenever entropy is consolidated into the global pool.
. Usage: Cache entropy_epoch() when you seed. If entropy_epoch()
has changed when you're about to use whatever you seeded, reseed.
. Epoch is never zero, so initialize cache to 0 if you want to reseed
on first use.
. Epoch is -1 iff we have never reached full entropy -- in other
words, the old rnd_initial_entropy is (entropy_epoch() != -1) --
but it is better if you check for changes rather than for -1, so
that if the system estimated its own entropy incorrectly, entropy
consolidation has the opportunity to prevent future compromise.

- Sysctls and event counters provide operator visibility into what's
happening:
. kern.entropy.needed - bits of entropy short of full entropy
. kern.entropy.pending - bits known to be pending in per-CPU pools,
can be consolidated with sysctl -w kern.entropy.consolidate=1
. kern.entropy.epoch - number of times consolidation has happened,
never 0, and -1 iff we have never reached full entropy

CPRNG_STRONG

- A cprng_strong instance is now a collection of per-CPU NIST
Hash_DRBGs. There are only two in the system: user_cprng for
/dev/urandom and sysctl kern.?random, and kern_cprng for kernel
users which may need to operate in interrupt context up to IPL_VM.

(Calling cprng_strong in interrupt context does not strike me as a
particularly good idea, so I added an event counter to see whether
anything actually does.)

- Event counters provide operator visibility into when reseeding
happens.

INTEL RDRAND/RDSEED, VIA C3 RNG (CPU_RNG)

- Unwired for now; will be rewired in a subsequent commit.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.195 02-Jan-2020 thorpej

- Eliminate the global "boottime" variable, which was being accessed
without any synchronization against changes by e.g. clock_settime().
- Replace with new getbinboottime() / getnanoboottime() / getmicroboottime()
functions (naming mirrors that of other time access functions in kern_tc.c).
It returns the (maybe-converted) value of timebasebin, which also tracks
our estimate of when the system was booted (i.e. the legacy "boottime" was
redundant).

XXX There needs to be a lockless synchronization mechanism for reading
timebasebin, but this is a problem in kern_tc.c that pre-existed these
"boottime" changes. At least now the problem is centralized in one location.


# 1.194 02-Jan-2020 martin

Add shutting_down variable for rump.


# 1.193 16-Dec-2019 ad

- Extend the per-CPU counters matt@ did to include all of the hot counters
in UVM, excluding uvmexp.free, which needs special treatment and will be
done with a separate commit. Cuts system time for a build by 20-25% on
a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).


Revision tags: phil-wifi-20191119
# 1.192 26-Sep-2019 bad

Provide a weak alias for vnode_to_path to be used unless librumpvfs is present.


Revision tags: netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609
# 1.191 02-Jun-2019 kre

Apply a patch from hannken@ which adds a weak alias for rump_getcwd_common()
allowing -lrump to be used without -lrumpvfs.

This is an alternate fix to the earluer one which added -lrumvfs to
many rump based tests (and the rump server) which might be undone soon.

This also fixes the sun2 build.


Revision tags: isaki-audio2-base
# 1.190 09-Mar-2019 hannken

Rumpkernel has its own thread deallocation. Add missing fstrans_lwp_dtor()
to lwproc_freelwp().

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.189 05-Dec-2018 christos

no more need for get_expose_address() here.


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020
# 1.188 06-Oct-2018 christos

add get_expose_address()


# 1.187 05-Oct-2018 hannken

Bring back three state file system suspension:

NORMAL -> SUSPENDING -> SUSPENDED

and add operation fstrans_start_lazy() that only blocks while SUSPENDED.

Change vndthread() support operation handle_with_rdwr() to bracket
its file system operations by fstrans_start_lazy() and fstrans_done().

PR kern/53624 (dom0 freeze on domU exit)


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.186 10-Aug-2018 pgoyette

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

branches: 1.185.2; 1.185.4;
Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.196 30-Apr-2020 riastradh

Rewrite entropy subsystem.

Primary goals:

1. Use cryptography primitives designed and vetted by cryptographers.
2. Be honest about entropy estimation.
3. Propagate full entropy as soon as possible.
4. Simplify the APIs.
5. Reduce overhead of rnd_add_data and cprng_strong.
6. Reduce side channels of HWRNG data and human input sources.
7. Improve visibility of operation with sysctl and event counters.

Caveat: rngtest is no longer used generically for RND_TYPE_RNG
rndsources. Hardware RNG devices should have hardware-specific
health tests. For example, checking for two repeated 256-bit outputs
works to detect AMD's 2019 RDRAND bug. Not all hardware RNGs are
necessarily designed to produce exactly uniform output.

ENTROPY POOL

- A Keccak sponge, with test vectors, replaces the old LFSR/SHA-1
kludge as the cryptographic primitive.

- `Entropy depletion' is available for testing purposes with a sysctl
knob kern.entropy.depletion; otherwise it is disabled, and once the
system reaches full entropy it is assumed to stay there as far as
modern cryptography is concerned.

- No `entropy estimation' based on sample values. Such `entropy
estimation' is a contradiction in terms, dishonest to users, and a
potential source of side channels. It is the responsibility of the
driver author to study the entropy of the process that generates
the samples.

- Per-CPU gathering pools avoid contention on a global queue.

- Entropy is occasionally consolidated into global pool -- as soon as
it's ready, if we've never reached full entropy, and with a rate
limit afterward. Operators can force consolidation now by running
sysctl -w kern.entropy.consolidate=1.

- rndsink(9) API has been replaced by an epoch counter which changes
whenever entropy is consolidated into the global pool.
. Usage: Cache entropy_epoch() when you seed. If entropy_epoch()
has changed when you're about to use whatever you seeded, reseed.
. Epoch is never zero, so initialize cache to 0 if you want to reseed
on first use.
. Epoch is -1 iff we have never reached full entropy -- in other
words, the old rnd_initial_entropy is (entropy_epoch() != -1) --
but it is better if you check for changes rather than for -1, so
that if the system estimated its own entropy incorrectly, entropy
consolidation has the opportunity to prevent future compromise.

- Sysctls and event counters provide operator visibility into what's
happening:
. kern.entropy.needed - bits of entropy short of full entropy
. kern.entropy.pending - bits known to be pending in per-CPU pools,
can be consolidated with sysctl -w kern.entropy.consolidate=1
. kern.entropy.epoch - number of times consolidation has happened,
never 0, and -1 iff we have never reached full entropy

CPRNG_STRONG

- A cprng_strong instance is now a collection of per-CPU NIST
Hash_DRBGs. There are only two in the system: user_cprng for
/dev/urandom and sysctl kern.?random, and kern_cprng for kernel
users which may need to operate in interrupt context up to IPL_VM.

(Calling cprng_strong in interrupt context does not strike me as a
particularly good idea, so I added an event counter to see whether
anything actually does.)

- Event counters provide operator visibility into when reseeding
happens.

INTEL RDRAND/RDSEED, VIA C3 RNG (CPU_RNG)

- Unwired for now; will be rewired in a subsequent commit.


Revision tags: bouyer-xenpvh-base2 phil-wifi-20200421 bouyer-xenpvh-base1 phil-wifi-20200411 bouyer-xenpvh-base is-mlppp-base phil-wifi-20200406 ad-namecache-base3 ad-namecache-base2 ad-namecache-base1 ad-namecache-base
# 1.195 02-Jan-2020 thorpej

- Eliminate the global "boottime" variable, which was being accessed
without any synchronization against changes by e.g. clock_settime().
- Replace with new getbinboottime() / getnanoboottime() / getmicroboottime()
functions (naming mirrors that of other time access functions in kern_tc.c).
It returns the (maybe-converted) value of timebasebin, which also tracks
our estimate of when the system was booted (i.e. the legacy "boottime" was
redundant).

XXX There needs to be a lockless synchronization mechanism for reading
timebasebin, but this is a problem in kern_tc.c that pre-existed these
"boottime" changes. At least now the problem is centralized in one location.


# 1.194 02-Jan-2020 martin

Add shutting_down variable for rump.


# 1.193 16-Dec-2019 ad

- Extend the per-CPU counters matt@ did to include all of the hot counters
in UVM, excluding uvmexp.free, which needs special treatment and will be
done with a separate commit. Cuts system time for a build by 20-25% on
a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).


Revision tags: phil-wifi-20191119
# 1.192 26-Sep-2019 bad

Provide a weak alias for vnode_to_path to be used unless librumpvfs is present.


Revision tags: netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609
# 1.191 02-Jun-2019 kre

Apply a patch from hannken@ which adds a weak alias for rump_getcwd_common()
allowing -lrump to be used without -lrumpvfs.

This is an alternate fix to the earluer one which added -lrumvfs to
many rump based tests (and the rump server) which might be undone soon.

This also fixes the sun2 build.


Revision tags: isaki-audio2-base
# 1.190 09-Mar-2019 hannken

Rumpkernel has its own thread deallocation. Add missing fstrans_lwp_dtor()
to lwproc_freelwp().

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.189 05-Dec-2018 christos

no more need for get_expose_address() here.


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020
# 1.188 06-Oct-2018 christos

add get_expose_address()


# 1.187 05-Oct-2018 hannken

Bring back three state file system suspension:

NORMAL -> SUSPENDING -> SUSPENDED

and add operation fstrans_start_lazy() that only blocks while SUSPENDED.

Change vndthread() support operation handle_with_rdwr() to bracket
its file system operations by fstrans_start_lazy() and fstrans_done().

PR kern/53624 (dom0 freeze on domU exit)


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.186 10-Aug-2018 pgoyette

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

branches: 1.185.2; 1.185.4;
Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.195 02-Jan-2020 thorpej

- Eliminate the global "boottime" variable, which was being accessed
without any synchronization against changes by e.g. clock_settime().
- Replace with new getbinboottime() / getnanoboottime() / getmicroboottime()
functions (naming mirrors that of other time access functions in kern_tc.c).
It returns the (maybe-converted) value of timebasebin, which also tracks
our estimate of when the system was booted (i.e. the legacy "boottime" was
redundant).

XXX There needs to be a lockless synchronization mechanism for reading
timebasebin, but this is a problem in kern_tc.c that pre-existed these
"boottime" changes. At least now the problem is centralized in one location.


# 1.194 02-Jan-2020 martin

Add shutting_down variable for rump.


# 1.193 16-Dec-2019 ad

- Extend the per-CPU counters matt@ did to include all of the hot counters
in UVM, excluding uvmexp.free, which needs special treatment and will be
done with a separate commit. Cuts system time for a build by 20-25% on
a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).


Revision tags: phil-wifi-20191119
# 1.192 26-Sep-2019 bad

Provide a weak alias for vnode_to_path to be used unless librumpvfs is present.


Revision tags: netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609
# 1.191 02-Jun-2019 kre

Apply a patch from hannken@ which adds a weak alias for rump_getcwd_common()
allowing -lrump to be used without -lrumpvfs.

This is an alternate fix to the earluer one which added -lrumvfs to
many rump based tests (and the rump server) which might be undone soon.

This also fixes the sun2 build.


Revision tags: isaki-audio2-base
# 1.190 09-Mar-2019 hannken

Rumpkernel has its own thread deallocation. Add missing fstrans_lwp_dtor()
to lwproc_freelwp().

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.189 05-Dec-2018 christos

no more need for get_expose_address() here.


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020
# 1.188 06-Oct-2018 christos

add get_expose_address()


# 1.187 05-Oct-2018 hannken

Bring back three state file system suspension:

NORMAL -> SUSPENDING -> SUSPENDED

and add operation fstrans_start_lazy() that only blocks while SUSPENDED.

Change vndthread() support operation handle_with_rdwr() to bracket
its file system operations by fstrans_start_lazy() and fstrans_done().

PR kern/53624 (dom0 freeze on domU exit)


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.186 10-Aug-2018 pgoyette

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

branches: 1.185.2; 1.185.4;
Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.194 02-Jan-2020 martin

Add shutting_down variable for rump.


# 1.193 16-Dec-2019 ad

- Extend the per-CPU counters matt@ did to include all of the hot counters
in UVM, excluding uvmexp.free, which needs special treatment and will be
done with a separate commit. Cuts system time for a build by 20-25% on
a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).


Revision tags: phil-wifi-20191119
# 1.192 26-Sep-2019 bad

Provide a weak alias for vnode_to_path to be used unless librumpvfs is present.


Revision tags: netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609
# 1.191 02-Jun-2019 kre

Apply a patch from hannken@ which adds a weak alias for rump_getcwd_common()
allowing -lrump to be used without -lrumpvfs.

This is an alternate fix to the earluer one which added -lrumvfs to
many rump based tests (and the rump server) which might be undone soon.

This also fixes the sun2 build.


Revision tags: isaki-audio2-base
# 1.190 09-Mar-2019 hannken

Rumpkernel has its own thread deallocation. Add missing fstrans_lwp_dtor()
to lwproc_freelwp().

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.189 05-Dec-2018 christos

no more need for get_expose_address() here.


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020
# 1.188 06-Oct-2018 christos

add get_expose_address()


# 1.187 05-Oct-2018 hannken

Bring back three state file system suspension:

NORMAL -> SUSPENDING -> SUSPENDED

and add operation fstrans_start_lazy() that only blocks while SUSPENDED.

Change vndthread() support operation handle_with_rdwr() to bracket
its file system operations by fstrans_start_lazy() and fstrans_done().

PR kern/53624 (dom0 freeze on domU exit)


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.186 10-Aug-2018 pgoyette

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

branches: 1.185.2; 1.185.4;
Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.193 16-Dec-2019 ad

- Extend the per-CPU counters matt@ did to include all of the hot counters
in UVM, excluding uvmexp.free, which needs special treatment and will be
done with a separate commit. Cuts system time for a build by 20-25% on
a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).


Revision tags: phil-wifi-20191119
# 1.192 26-Sep-2019 bad

Provide a weak alias for vnode_to_path to be used unless librumpvfs is present.


Revision tags: netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609
# 1.191 02-Jun-2019 kre

Apply a patch from hannken@ which adds a weak alias for rump_getcwd_common()
allowing -lrump to be used without -lrumpvfs.

This is an alternate fix to the earluer one which added -lrumvfs to
many rump based tests (and the rump server) which might be undone soon.

This also fixes the sun2 build.


Revision tags: isaki-audio2-base
# 1.190 09-Mar-2019 hannken

Rumpkernel has its own thread deallocation. Add missing fstrans_lwp_dtor()
to lwproc_freelwp().

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.189 05-Dec-2018 christos

no more need for get_expose_address() here.


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020
# 1.188 06-Oct-2018 christos

add get_expose_address()


# 1.187 05-Oct-2018 hannken

Bring back three state file system suspension:

NORMAL -> SUSPENDING -> SUSPENDED

and add operation fstrans_start_lazy() that only blocks while SUSPENDED.

Change vndthread() support operation handle_with_rdwr() to bracket
its file system operations by fstrans_start_lazy() and fstrans_done().

PR kern/53624 (dom0 freeze on domU exit)


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.186 10-Aug-2018 pgoyette

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

branches: 1.185.2; 1.185.4;
Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.192 26-Sep-2019 bad

Provide a weak alias for vnode_to_path to be used unless librumpvfs is present.


Revision tags: netbsd-9-base phil-wifi-20190609
# 1.191 02-Jun-2019 kre

Apply a patch from hannken@ which adds a weak alias for rump_getcwd_common()
allowing -lrump to be used without -lrumpvfs.

This is an alternate fix to the earluer one which added -lrumvfs to
many rump based tests (and the rump server) which might be undone soon.

This also fixes the sun2 build.


Revision tags: isaki-audio2-base
# 1.190 09-Mar-2019 hannken

Rumpkernel has its own thread deallocation. Add missing fstrans_lwp_dtor()
to lwproc_freelwp().

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.189 05-Dec-2018 christos

no more need for get_expose_address() here.


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020
# 1.188 06-Oct-2018 christos

add get_expose_address()


# 1.187 05-Oct-2018 hannken

Bring back three state file system suspension:

NORMAL -> SUSPENDING -> SUSPENDED

and add operation fstrans_start_lazy() that only blocks while SUSPENDED.

Change vndthread() support operation handle_with_rdwr() to bracket
its file system operations by fstrans_start_lazy() and fstrans_done().

PR kern/53624 (dom0 freeze on domU exit)


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.186 10-Aug-2018 pgoyette

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

branches: 1.185.2; 1.185.4;
Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.191 02-Jun-2019 kre

Apply a patch from hannken@ which adds a weak alias for rump_getcwd_common()
allowing -lrump to be used without -lrumpvfs.

This is an alternate fix to the earluer one which added -lrumvfs to
many rump based tests (and the rump server) which might be undone soon.

This also fixes the sun2 build.


Revision tags: isaki-audio2-base
# 1.190 09-Mar-2019 hannken

Rumpkernel has its own thread deallocation. Add missing fstrans_lwp_dtor()
to lwproc_freelwp().

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.189 05-Dec-2018 christos

no more need for get_expose_address() here.


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020
# 1.188 06-Oct-2018 christos

add get_expose_address()


# 1.187 05-Oct-2018 hannken

Bring back three state file system suspension:

NORMAL -> SUSPENDING -> SUSPENDED

and add operation fstrans_start_lazy() that only blocks while SUSPENDED.

Change vndthread() support operation handle_with_rdwr() to bracket
its file system operations by fstrans_start_lazy() and fstrans_done().

PR kern/53624 (dom0 freeze on domU exit)


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.186 10-Aug-2018 pgoyette

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

branches: 1.185.2;
Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


Revision tags: isaki-audio2-base
# 1.190 09-Mar-2019 hannken

Rumpkernel has its own thread deallocation. Add missing fstrans_lwp_dtor()
to lwproc_freelwp().

PR bin/50350: rump/rumpkern/t_sp/stress_{long,short} fail on Core 2 Quad


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.189 05-Dec-2018 christos

no more need for get_expose_address() here.


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020
# 1.188 06-Oct-2018 christos

add get_expose_address()


# 1.187 05-Oct-2018 hannken

Bring back three state file system suspension:

NORMAL -> SUSPENDING -> SUSPENDED

and add operation fstrans_start_lazy() that only blocks while SUSPENDED.

Change vndthread() support operation handle_with_rdwr() to bracket
its file system operations by fstrans_start_lazy() and fstrans_done().

PR kern/53624 (dom0 freeze on domU exit)


Revision tags: pgoyette-compat-0930 pgoyette-compat-0906
# 1.186 10-Aug-2018 pgoyette

Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys. Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

sys/arch/usermode/modules/syscallemu/syscallemu.c


Revision tags: pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

branches: 1.185.2;
Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


Revision tags: tls-maxphys-base-20171202
# 1.185 21-Nov-2017 ozaki-r

Add missing inclusion of pserialize.h (fix build)


# 1.184 21-Nov-2017 ozaki-r

Implement debugging feature for pserialize(9)

The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@


# 1.183 09-Nov-2017 christos

added booted_method


Revision tags: nick-nhusb-base-20170825 perseant-stdc-iso10646-base
# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.182 04-Jun-2017 hannken

Operations fstrans_start() and fstrans_start_nowait() now always
use FSTRANS_SHARED as lock type so remove the lock type argument.

File system state FSTRANS_SUSPENDING is now unused so remove it.

Regen vnode_if files.

Ride 8.99.1 less than a hour ago.


Revision tags: netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 jdolecek-ncq-base pgoyette-localcount-20170320
# 1.181 22-Feb-2017 hannken

branches: 1.181.6;
Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

branches: 1.180.2;
physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.181 22-Feb-2017 hannken

Add weak aliases for _fstrans_start() and fstrans_done().


Revision tags: nick-nhusb-base-20170204 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.180 22-Dec-2016 cherry

physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

branches: 1.179.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.


# 1.180 22-Dec-2016 cherry

physmem should be of type psize_t

Also, use PRIxPSIZE when printf(9)ing physmem.


Revision tags: nick-nhusb-base-20161204 pgoyette-localcount-20161104 nick-nhusb-base-20161004 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base nick-nhusb-base-20160907 nick-nhusb-base-20160529 nick-nhusb-base-20160422 nick-nhusb-base-20160319
# 1.179 26-Jan-2016 pooka

Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.


# 1.178 22-Jan-2016 ozaki-r

Fix build with RUMP_LOCKDEBUG=yes


# 1.177 18-Jan-2016 pooka

put lwp/proc stuff into the same source module (emul.c -> lwproc.c)


# 1.176 18-Jan-2016 pooka

massively reduce header pollution from times prehistoric


# 1.175 18-Jan-2016 pooka

boottime is a timespec, not timeval


# 1.174 29-Dec-2015 pgoyette

Now that the table of auto-loadable syscalls is per-emulation, make sure
that the rump-kernel has its own list. Otherwise, missing syscalls won't
trigger a module auto-load.

This commit finishes the work to get tests/lib/librumphijack/t_tcpip
nfs_autoload test case working again after 16 months of failures! (see
PR bin/49153).


Revision tags: nick-nhusb-base-20151226 nick-nhusb-base-20150921
# 1.173 25-Aug-2015 pooka

add cpu_getmodel()


# 1.172 24-Jul-2015 pooka

Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.


Revision tags: nick-nhusb-base-20150606
# 1.171 22-Apr-2015 pooka

Include kern_clock.c in rump kernels.


# 1.170 18-Apr-2015 pooka

Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.


Revision tags: nick-nhusb-base-20150406
# 1.169 03-Jan-2015 pooka

Put all sysproxy routines to their own C module, sysproxy.c


Revision tags: nick-nhusb-base
# 1.168 18-Nov-2014 pooka

branches: 1.168.2;
delay() can't use rumpuser_clock_sleep(), because that may unschedule().

Instead, busyloop with calls to rumpuser_clock_gettime(). Fixing delay()
properly should addressed in hypercall rev.18 by introducing a nowrap
variant/flag for rumpuser_clock_sleep().


# 1.167 18-Nov-2014 pooka

Attempt to make sure that DELAY()/delay() is available in all MD names.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base tls-earlyentropy-base tls-maxphys-base
# 1.166 28-May-2014 justin

Add missing __diagused in rump code


Revision tags: yamt-pagecache-base9 rmind-smpnet-nbase rmind-smpnet-base
# 1.165 25-Apr-2014 pooka

cpu_reboot() is more of an emul.c thing than a rump.c thing


Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3
# 1.164 11-Mar-2014 pooka

branches: 1.164.2;
Put the syncobjs in emul.c instead of locks.c so that they are
present for both locks.c and locks_up.c alike.


# 1.163 20-Feb-2014 pooka

+ resettodr


# 1.162 29-Jan-2014 pooka

lwp0 needs l_proc set for panic->cpu_reboot to dump core the right way


# 1.161 17-Jan-2014 pooka

Use subr_cprng.c instead of stub implementation. Rijndael migrates from
rumpkern_crypto to rumpkern due to it being mandatory for cprng.


# 1.160 16-Dec-2013 pooka

Translate return values for emulations, e.g. Linux. For ports without
__HAVE_MINIMAL_EMUL, we simply look up the values from p->p_emul->e_errno.
For ports which cannot afford to keep an extra pointer per emul structure
around, we hope there is __HAVE_SYSCALL_INTERN support and thread the
errno values through p_emuldata. Notably, we cannot alter the syscall
method like most ports do with syscall_intern, since they do it via
p_mdproc, so MI code is not possible there.


# 1.159 09-Dec-2013 pooka

Support ktrace for rump kernels.

Requested by Justin Cormack on rumpkernel-users.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.158 30-Apr-2013 pooka

branches: 1.158.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.


# 1.157 30-Apr-2013 pooka

Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.


# 1.156 28-Apr-2013 pooka

Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).


Revision tags: agc-symver-base
# 1.155 18-Mar-2013 para

calculate vnode cache size based on the resource it gets allocated from
this stops setting kern.maxvnodes to high so it exhausts available space in kmem

http://mail-index.netbsd.org/tech-kern/2013/03/08/msg015095.html


# 1.154 07-Mar-2013 pooka

set e_nsysent


# 1.153 19-Feb-2013 martin

Stopgap fix to make rump cooperate with pserialize, may be revisited later.
Patch from pooka, ok: rmind. No related regressions in a complete atf test
run (which works again with this, even on non x86 SMP machines).


Revision tags: yamt-pagecache-base8
# 1.152 20-Jan-2013 rmind

Provide xc_send_ipi() routine in RUMP, which is required for high-priority
xcall(9) mechanism. It is emulated using low-priority xcall(9).


Revision tags: yamt-pagecache-base7 yamt-pagecache-base6
# 1.151 27-Oct-2012 chs

split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-0-5-RELEASE netbsd-6-0-4-RELEASE netbsd-6-0-3-RELEASE netbsd-6-0-2-RELEASE netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 jmcneill-usbmp-base10 yamt-pagecache-base5 jmcneill-usbmp-base9 yamt-pagecache-base4 jmcneill-usbmp-base8 jmcneill-usbmp-base7 jmcneill-usbmp-base6 jmcneill-usbmp-base5 jmcneill-usbmp-base4 jmcneill-usbmp-base3 jmcneill-usbmp-pre-base2 jmcneill-usbmp-base2 netbsd-6-base jmcneill-usbmp-base jmcneill-audiomp3-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base rmind-uvmplock-nbase cherry-xenmp-base rmind-uvmplock-base
# 1.150 21-Mar-2011 pooka

branches: 1.150.4; 1.150.10; 1.150.14;
Update copyright statements.

no functional change.


Revision tags: bouyer-quota2-nbase bouyer-quota2-base
# 1.149 21-Jan-2011 pooka

Since "physmem" is largely unused except for zfs wanting to know
if it has enough memory available, just pick a number which makes
zfs happy.

We *could* use a MIN() of available host mem and rump_memlimit,
though ...


Revision tags: jruoho-x86intr-base
# 1.148 06-Jan-2011 pooka

branches: 1.148.2; 1.148.4;
Support LOCKDEBUG. To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


Revision tags: matt-mips64-premerge-20101231
# 1.147 21-Nov-2010 pooka

Realize the >1yo comment above rump_reboot and retire them to make
room for sys_reboot.


Revision tags: uebayasi-xip-base4 uebayasi-xip-base3
# 1.146 15-Oct-2010 tsutsui

Make common kernel module binaries work on both sun3 and sun3x.
Tested on 3/160 (on TME) and (real) 3/80.

XXX: module files can be loaded only on single user?


Revision tags: yamt-nfs-mp-base11
# 1.145 01-Sep-2010 pooka

Implement rump_lwproc: the new lwp/proc management routines for
rump. These move the management of the pid/lwpid space from the
application into the kernel, make code more robust, and make it
possible to attach multiple lwp's to non-proc0 processes.


Revision tags: uebayasi-xip-base2 yamt-nfs-mp-base10
# 1.144 23-Jun-2010 pooka

As normal, fix breakage from untested commits by rmind.


# 1.143 14-Jun-2010 pooka

Remove comment which wasn't supposed to get committed.


# 1.142 14-Jun-2010 pooka

Make some stubby tty routines used by printf weak aliases, so that
the full ones will be used if we have the upcoming tty component
loaded.


# 1.141 13-Jun-2010 pooka

Fix previous in emul.c -- only numbers are operands for cpp comparisons.
Apparently non-numbers logically produce arch-dependent behaviour.


# 1.140 13-Jun-2010 pooka

deal with sun3's module disability


# 1.139 13-Jun-2010 pooka

add rest of sparc pagesize variables


# 1.138 10-Jun-2010 pooka

Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"


# 1.137 11-May-2010 pooka

adjust comment in previous.
XXX: should make that (and physmem) mean something here


# 1.136 11-May-2010 pooka

remove unnecessary #ifdef


# 1.135 01-May-2010 pooka

Now that we have a big devsw_conv0, need at least as many entries
in devsw as the highest device number in the conv table. Do a
"good for a hundred years" guess now, fix properly later.


# 1.134 30-Apr-2010 pooka

Include devsw_conv0 from an i386 kernel compilation (no, we don't
care about the arch as long as all the devices we care about are
present). The file should be autogenerated, but that requires some
more changes to config(1).


Revision tags: uebayasi-xip-base1
# 1.133 28-Apr-2010 pooka

Make initial devsw a little more believable. Especially adjust
max_sys_devsw, since it was previously a bit too much, given that
the correct value is 0.


# 1.132 21-Apr-2010 pooka

remove stuff which now comes via std. kernel source modules


# 1.131 21-Apr-2010 pooka

support kern_resource


# 1.130 21-Apr-2010 pooka

Move all signal-related from emul.c to signals.c. Additionally,
define a few alternate signal models for the rump kernel, including
ones where signals are ignored or sent to host processes.


# 1.129 19-Apr-2010 pooka

no \n in panic


# 1.128 17-Apr-2010 pooka

One emul is enough and since we need emul_netbsd, retire emul_rump.


# 1.127 17-Apr-2010 pooka

Move scheduling related routines from emul.c to scheduler.c


# 1.126 14-Apr-2010 pooka

Use kern_syscall.c instead of homegrown syscall dis/establishment routines.


# 1.125 14-Apr-2010 pooka

Include kern_tc and use a timecounter driver instead of homerolled
kern_tc implementation.


# 1.124 31-Mar-2010 pooka

We don't have a real rootdev (by default at least), so set it to NODEV.


Revision tags: yamt-nfs-mp-base9
# 1.123 01-Mar-2010 pooka

branches: 1.123.2;
add signal stubs required by mfs


# 1.122 08-Feb-2010 joerg

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.


Revision tags: uebayasi-xip-base
# 1.121 31-Jan-2010 pooka

branches: 1.121.2;
Include newly-created subr_device.c and remove few special case
device accessor copypastes. This makes it possible to link static
binaries which use -lrumpdev.


# 1.120 31-Jan-2010 pooka

include kern_hook.c


# 1.119 15-Jan-2010 pooka

Use subr_percpu.c instead of homegrown implementation. ...except
when using malloc(3)-relegated allocators (happens in production
e.g. on Linux), since subr_percpu.c uses vmem and i don't want to
reimplement vmem.


# 1.118 13-Jan-2010 pooka

Minimize unnecessary differences in rump.


# 1.117 13-Jan-2010 pooka

Add a few symbols used by the tty code.


# 1.116 09-Jan-2010 pooka

Include kern_pmf.c in rumpdev.


# 1.115 08-Jan-2010 dyoung

Expand PMF_FN_* macros.


# 1.114 25-Dec-2009 elad

allow rump to build


# 1.113 16-Dec-2009 pooka

Generate vers.c and include it in the kernel component.


Revision tags: matt-premerge-20091211
# 1.112 03-Dec-2009 pooka

Decide it's not worth the fuss to have rumpfs as a module and just
hardcode attach into rump_vfs_init(). Saves us from a lot of
pingpong init bouncing from one component to another to get the order
right.


# 1.111 01-Dec-2009 pooka

Include cpu crosscall support (instead of stubbing it out).


# 1.110 26-Nov-2009 pooka

For rumpfs, do mountroot instead of the bunch of homegrown hacks
currently there. Still needs a little massage to get the kernel
interfaces right and avoid copypaste especially from main().

Also, move it a bit more into the direction of a real file system
(finally!) by giving it a vfsops. Most ops are still unimplemented,
though.


# 1.109 04-Nov-2009 pooka

misc_stub and emul have been the same thing for a looong time now,
so just move the few remaining routines in misc_stub to emul.


# 1.108 04-Nov-2009 pooka

Give the kthread->pthread interface emulation its own module.


# 1.107 04-Nov-2009 pooka

Pull all relegating memory allocators under a common roof in memalloc.c


# 1.106 04-Nov-2009 pooka

move copy-related routines to their own module


# 1.105 04-Nov-2009 pooka

Use std. uiomove() & friends.


Revision tags: jym-xensuspend-nbase
# 1.104 21-Oct-2009 rmind

Sync rump with kernel changes.


# 1.103 16-Oct-2009 pooka

Include sys_select.c for proper select()/poll() support.


# 1.102 15-Oct-2009 pooka

Give lwp usage some much-needed love: stop treating lwp0 as the
all-sink and make sure each separate thread in rump has its own
lwp. Happy-go-lucky callers will get scheduled a temporary lwp
on entry, while true lwp connoisseurs may request a stable lwp
for their purposes. Some more love may be required later down the
road, but for now different threads will stepping on each others
toes.


# 1.101 15-Oct-2009 pooka

Add initial work on a rump virtual cpu scheduler. This is necessary
for kernel code which has been written to avoid MP contention by
using cpu-local storage (most prominently, select and pool_cache).

Instead of always assuming rump_cpu, the scheduler must now be run
(and unrun) on all entry points into rump. Likewise, rumpuser
unruns and re-runs the scheduler around each potentially blocking
operation. As an optimization, I modified some locking primitives
to try to get the lock without blocking before releasing the cpu.

Also, ltsleep was modified to assume that it is never called without
the biglock held and made to use the biglock as the sleep interlock.
Otherwise there is just too much drama with deadlocks. If some
kernel code wants to call ltsleep without the biglock, then, *snif*,
it's no longer supported and rump and should be modified to support
newstyle locks anyway.


# 1.100 14-Oct-2009 pooka

"rumppriv" goes back to "rump" per internal interface naming change.


# 1.99 14-Oct-2009 pooka

Adjust rump sources for external/internal interfaces.
No functional change.


# 1.98 09-Oct-2009 pooka

Provide an interface for reboot.


# 1.97 03-Oct-2009 christos

Need proc_uidmatch


# 1.96 24-Sep-2009 pooka

remove a no longer necessary hack


# 1.95 20-Sep-2009 pooka

default to AB_SILENT


Revision tags: yamt-nfs-mp-base8
# 1.94 07-Sep-2009 pooka

provide pmf stubs


# 1.93 06-Sep-2009 pooka

move hppa cpp kludge to the end of the file


# 1.92 04-Sep-2009 pooka

add a few global symbols required by kernel code


Revision tags: yamt-nfs-mp-base7 jymxensuspend-base
# 1.91 20-Jul-2009 pooka

realloc works much better if it actually uses realloc instead of malloc


Revision tags: yamt-nfs-mp-base6 yamt-nfs-mp-base5
# 1.90 09-Jun-2009 pooka

Nuke some bss stuff which is coming from vfs_bio via rumpvfs.


Revision tags: yamt-nfs-mp-base4 jym-xensuspend-base
# 1.89 07-May-2009 pooka

Don't create unpgc thread if RUMP_THREADS is 0. The benefit is the
usual: possible to run programs using AF_LOCAL without threads.


Revision tags: yamt-nfs-mp-base3
# 1.88 29-Apr-2009 pooka

Add proof-of-concept code for enabling system calls to rump virtual
kernels running in other processes on the same machine or on an
entirely different host. I wrote this a while ago and am now
committing it mainly to avoid losing it. It works, but could do
with a little tuning here and there.

What this will hopefully eventually buy us is the ability to use
standard userland tools to configure rump kernels, e.g. ifconfig(8)
and route(8) could be used to configure the networking stack provided
by a rump kernel. Also some distributed OS implications may apply.

fun fact: a system call which just does copyin/copyout takes >1000x
longer when made over the LAN as compared to when made on the same
machine.


Revision tags: nick-hppapmap-base4 nick-hppapmap-base3 nick-hppapmap-base
# 1.87 26-Apr-2009 pooka

Fix getnano/microuptime to report actual uptime.


# 1.86 26-Apr-2009 pgoyette

Catch up with recent changes to sys/proc.h (Hello, rmind!)


# 1.85 30-Mar-2009 christos

we want microuptime too.


# 1.84 30-Mar-2009 christos

need getnanouptime not getmicrouptime


# 1.83 30-Mar-2009 christos

one more timeval -> timespec line


# 1.82 29-Mar-2009 christos

Catch up with kernel changes


# 1.81 18-Mar-2009 pooka

Support kqueue in the rump virtual kernel.


# 1.80 18-Mar-2009 cegger

Ansify function definitions w/o arguments. Generated with sed.


Revision tags: nick-hppapmap-base2
# 1.79 27-Feb-2009 pooka

decouple rumpuser gettime from struct timeval


# 1.78 26-Feb-2009 pooka

Make rumpuser stat and nanosleep independent of the host system
stat and timespec definitions.


# 1.77 07-Feb-2009 pooka

branches: 1.77.2;
Make the clock interrupt tick based on absolute time instead of
relative time. This prevents drifting. Also, keep track of time
within userspace, so we do not have to make a syscall to get the
clock value. This is approximately 7 times cheaper, but on the
negative side is limited to the clock interrupt frequency.


Revision tags: mjf-devfs2-base
# 1.76 13-Jan-2009 pooka

Implement block I/O as a real block driver instead of a hacked copy
of specfs. That was easier years ago when rump didn't support
devices, but brings no gain now. This allows us to include the
real specfs in rump.


# 1.75 12-Jan-2009 pooka

Shove in some hppa love to help with spcopy.S (why does that need
to be in libkern?).


# 1.74 11-Jan-2009 pooka

Protect against nfssilly in RUMP_THREADS=0


# 1.73 11-Jan-2009 christos

merge christos-time_t


Revision tags: christos-time_t-nbase christos-time_t-base
# 1.72 07-Jan-2009 pooka

provide kern_realloc


# 1.71 05-Jan-2009 pooka

Rename malloc() to kern_malloc() to avoid name conflict with libc.
Now it is possible to use the kernel linker with rump.


# 1.70 04-Jan-2009 pooka

Include libkern contents in librump.


# 1.69 02-Jan-2009 pooka

Sauce with some kludges:
* revert rev 1.68 of emul.c: delay() is hopelessly MD and needs
whipping (not the fun kind)
* #undef DELAY in cpu.h

This will hopefully fix build for all archs and give me time to
hop through our 46521 fine archs and edit the headers.


# 1.68 02-Jan-2009 pooka

Export delay, _delay and delay_func symbols to attempt to appease
the macro mania set over all architectures.


# 1.67 02-Jan-2009 pooka

Include kernel printf routines in rump instead of relying on the
magic libc symbol. This also allows to bid farewell to subr_prf2.c
and merge the contents back to subr_prf.c. The host kernel bridging
is now done via rumpuser_putchar().


# 1.66 01-Jan-2009 pooka

Define MODULAR for rump core components. This enables module
loading via the kernel module framework (instead of dlopen()).
For now it only works on amd64 and i386, but for the rest it should
just be a matter of including the relevant kobj_machdep.c modules
from the kernel sources.


# 1.65 30-Dec-2008 pooka

properly handle kthread_exit()


# 1.64 29-Dec-2008 pooka

include subr_devsw in rumpkern


# 1.63 21-Dec-2008 cegger

branches: 1.63.2;
undo turn malloc flags to enums.
Requested by christos.

Keep malloc flag defines in kernel section.


# 1.62 20-Dec-2008 cegger

Turn malloc flags into an enum. Fixes build breakage.


# 1.61 18-Dec-2008 pooka

__KERNEL_RCSID


# 1.60 17-Dec-2008 pooka

If available (__NetBSD__), use pthread_setname_np() to set the
thread name for kthread_create().


# 1.59 14-Dec-2008 pooka

If the arch uses __BSWAP_RENAME, provide non-namespaced kernel
symbols which just call the libc symbols. Allows to get rid of
rump machine/bswap.h.

XXX:
1) this is unlikely to work on non-NetBSD
==>
2) should look into including libkern in librump


Revision tags: haad-dm-base2 haad-nbase2 haad-dm-base
# 1.58 10-Dec-2008 pooka

Make non-mpsafe threads KERNEL_LOCK() before starting execution.


Revision tags: ad-audiomp2-base
# 1.57 27-Nov-2008 pooka

Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.


# 1.56 26-Nov-2008 pooka

Add a few symbols required by nfsd


# 1.55 17-Nov-2008 pooka

Add more verbose commentage to the module thread non-creation.


# 1.54 17-Nov-2008 pooka

Ignore the module unload thread.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 haad-dm-base1
# 1.53 14-Oct-2008 pooka

branches: 1.53.2; 1.53.4; 1.53.8;
Add some more trivial emulations.


# 1.52 13-Oct-2008 pooka

Provide psignal() so that we don't get linked against psignal(3).
As there is no real process model currently, just "trap" the signals
appropriately.


Revision tags: wrstuden-revivesa-base-4
# 1.51 10-Oct-2008 pooka

Support callouts and call callout_hardclock() from the timer
interrupt thread.

The sleepq implementation required for callouts is horrible, kludged
only for callouts, and generally unacceptable. It needs revisiting,
but I'm not sure yet should rump or kern_timeout be improved. It's
almost untested as of now, but committing this will give me some
maneuvering space while letting application compile.


# 1.50 02-Oct-2008 pooka

Remove rumpuser_yield(). Not only doesn't it really make sense
here, some kind soul made it completely empty.


# 1.49 30-Sep-2008 pooka

Switch to std kern_auth.


# 1.48 25-Sep-2008 pooka

Move global malloc types from kern_malloc into a separate module.


Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.47 12-Aug-2008 pooka

Make it possible to control starting of threads per env variable
instead of only at compile-time.


# 1.46 04-Aug-2008 pooka

Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.


# 1.45 01-Aug-2008 pooka

support real sysctls


Revision tags: simonb-wapbl-nbase simonb-wapbl-base
# 1.44 29-Jul-2008 pooka

Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly


# 1.43 21-Jul-2008 pooka

Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL


# 1.42 18-Jul-2008 pooka

emulate vlog()


# 1.41 25-Jun-2008 pooka

branches: 1.41.2;
Don't compile kern_lock for rump any more, it's no longer required.
Allows us to get rid of the incorrect _RUMPKERNEL ifdefs outside sys/rump.


# 1.40 24-Jun-2008 pooka

Make kpause() use nanosleep() instead of usleep(). Fixes >=1s sleeps
to actually sleep a bit too.

from Arnaud Ysmal


Revision tags: wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 wrstuden-revivesa-base
# 1.39 29-May-2008 pooka

branches: 1.39.2;
Also fake the namecache g/c thread in kthread_create() so that file
systems can again be run without threads (and hence gdb can be used
on them).


Revision tags: hpcarm-cleanup-nbase yamt-pf42-base2 yamt-nfs-mp-base2 yamt-nfs-mp-base
# 1.38 24-Apr-2008 ad

branches: 1.38.2; 1.38.4;
Catch up with process locking changes.


Revision tags: yamt-pf42-baseX yamt-pf42-base
# 1.37 06-Apr-2008 matt

branches: 1.37.2;
Add a device_xname() stub.


Revision tags: ad-socklock-base1
# 1.36 25-Mar-2008 yamt

- for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well. fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map. XXX a bit arbitrary.
- add a comment.


# 1.35 24-Mar-2008 martin

Adapt to sel* changes


Revision tags: yamt-lazymbuf-base15 yamt-lazymbuf-base14
# 1.34 23-Mar-2008 yamt

when calculating some cache sizes, consider the amount of available kva.
PR/33185.


# 1.33 21-Mar-2008 ad

Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.


Revision tags: keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase
# 1.32 19-Mar-2008 bjs

Add lwp_unsleep from kern/kern_lwp.c so that this builds. ok ad@


# 1.31 12-Mar-2008 pooka

Support multiple file systems within one process with ukfs by using
a "chroot" for each file system.


# 1.30 11-Mar-2008 pooka

Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".


Revision tags: nick-net80211-sync-base mjf-devfs-base hpcarm-cleanup-base
# 1.29 15-Feb-2008 ad

branches: 1.29.2; 1.29.6;
Implement yield().


# 1.28 15-Feb-2008 ad

Add dummy hardclock_ticks.


# 1.27 27-Jan-2008 pooka

Use vfs_subr.c from sys/kern. This brings differences in the vnode
life cycle between rump and a real kernel to a minimum.


# 1.26 24-Jan-2008 pooka

Use namei() etc. from kernel sources instead of a reimplementation.
To accommodate, give the rootvnode its own vnode op vector with a
simple lookup operation. This is used for looking up the file
system's device vnode instead of doing that directly in a homesmoked
namei().


# 1.25 24-Jan-2008 pooka

Don't use PAGE_SIZE when faking physmem, as it's not always available
at compile-time. We could init it runtime, but it's just a random
number anyway.


# 1.24 24-Jan-2008 pooka

Default physmem was too tight, increase to 256megs from 0 bytes.


Revision tags: bouyer-xeni386-nbase
# 1.23 22-Jan-2008 pooka

Until debugging threaded programs in NetBSD is fixed, supply the
cpp option RUMP_WITHOUT_THREADS as a workaround. If defined, it
makes rump itself operate single-threaded and prevents kthread_create()
from working.


# 1.22 20-Jan-2008 joerg

Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.


Revision tags: bouyer-xeni386-base matt-armv6-base
# 1.21 04-Jan-2008 pooka

Print "panic: " before panicstr when panicking.


# 1.20 02-Jan-2008 pooka

Add the ability to run puffs in userspace. This means that puffs
can now be developed in userspace using puffs for development
(I hate emulators, they are annoyingly clumsy).

To e.g. mount psshfs using puffs-on-puffs, run fs/bin/syspuffs/syspuffs
with the regular mount_psshfs command line as an argument:

golem> ./syspuffs /usr/sbin/mount_psshfs ftp.netbsd.org:/pub /puffs

This will make the mount appear as usual, with the exception that the
requests will be passed through puffs both in the kernel and userspace:

ftp.netbsd.org:/pub on /puffs type puffs|p2k|puffs|psshfs


Revision tags: vmlocking2-base3 yamt-kmem-base3 cube-autoconf-base yamt-kmem-base2 yamt-kmem-base vmlocking2-base2 reinoud-bufcleanup-nbase reinoud-bufcleanup-base vmlocking2-base1 bouyer-xenamd64-base2 vmlocking-nbase bouyer-xenamd64-base jmcneill-pm-base
# 1.19 11-Nov-2007 pooka

branches: 1.19.6;
fix build (hi rmind!)


Revision tags: jmcneill-base
# 1.18 04-Nov-2007 pooka

branches: 1.18.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()


# 1.17 31-Oct-2007 pooka

Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.


# 1.16 24-Oct-2007 pooka

branches: 1.16.2;
"flags * (M_CANFAIL | M_NOWAIT)" is probably not correct. Use & instead.
And while committing, add other random cruft I've needed recently.


# 1.15 19-Oct-2007 ad

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h


Revision tags: yamt-x86pmap-base4 yamt-x86pmap-base3 vmlocking-base yamt-x86pmap-base2
# 1.14 24-Sep-2007 pooka

branches: 1.14.2;
Don't whine about wakeup() not being implemented every time it's
called. Nobody cares unless ltsleep() is called (and it panics).


Revision tags: yamt-x86pmap-base
# 1.13 11-Sep-2007 briggs

branches: 1.13.2;
If !_HAVE_TIMECOUNTER, initialize 'time' instead of 'time_second.'


# 1.12 10-Sep-2007 pooka

Provide errno from rumpuser_{gettimeofday,close}() to be consistent.


Revision tags: nick-csl-alignment-base5
# 1.11 26-Aug-2007 pooka

branches: 1.11.2; 1.11.4;
few panicky functions


# 1.10 20-Aug-2007 pooka

branches: 1.10.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.


# 1.9 15-Aug-2007 pooka

Wrap malloc() so that we catch the kernel arguments (namely M_ZERO)
properly. It's fairly amusing that this wasn't noticed until now.


# 1.8 14-Aug-2007 pooka

branches: 1.8.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.


# 1.7 13-Aug-2007 pooka

Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).


# 1.6 13-Aug-2007 pooka

compile in libkern __assert.c, argument order differs from libc model


# 1.5 09-Aug-2007 pooka

Add some stubs for lfs.


# 1.4 08-Aug-2007 pooka

Provide rumpmachine bswap.h, which makes bswapxx() call rumpuser
directly instead of relying on a symbol in rumpkern. I would like
to make it call the libc symbol directly, but I don't currently know
how to make it do that MI.

Makes hfs work (on i386), as it avoids endless recursion in bswap64().
Thanks to dillo for the image!


# 1.3 08-Aug-2007 pooka

* compile param.c
* move opts to a separate directory


# 1.2 08-Aug-2007 pooka

add microtime


Revision tags: matt-mips64-base
# 1.1 05-Aug-2007 pooka

branches: 1.1.2;
Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.