Commit Graph

1172 Commits

Author SHA1 Message Date
pooka
1fb57ddbb5 Don't link rump kernel libs against libc. They have no host system
dependencies apart from indirect ones via rumpuser.
2009-11-17 16:17:06 +00:00
pooka
f7dd9c5812 Don't build rumpuser if NORUMPUSER is set. 2009-11-17 15:36:28 +00:00
pooka
8ef9411fc9 init global cv only once 2009-11-17 15:23:42 +00:00
pooka
53e3c13474 set return value properly 2009-11-11 16:50:17 +00:00
pooka
9359f96adb support timeouts in tsleep 2009-11-11 16:47:50 +00:00
pooka
ee4c8e1012 Make rumpuser_cv_timedwait take two int64's instead timespec to
uncouple it from the timespec layout.  Also, change return value
to zero for "timeout didn't expire" and non-zero for "timeout
expired".  This decouples the interface from errno assignments.
2009-11-11 16:46:50 +00:00
pooka
303e90e2c8 Give this a makefile for easy rebuild of all the components when
the kernel ABI changes.
2009-11-11 13:54:54 +00:00
pooka
886a3cee40 init uvm readahead 2009-11-10 17:02:36 +00:00
pooka
054e6b6e93 Code which uses pages fetched by the pager needs PGO_SYNCIO for
obvious reasons.
2009-11-10 16:55:12 +00:00
pooka
644009f9cb Hash out soft interrupts to be a little closer to real softints:
* split them into levels
  * allow only one per level to be active at a time
  * fire softints only when we are unscheduling from a CPU instead
    of immediately in softint_schedule().  this will later morph
    into return from interrupt, but that part isn't done yet.
2009-11-09 19:16:18 +00:00
pooka
19cde6b50d adjust comment for previous 2009-11-09 19:02:49 +00:00
pooka
1029997ffd set LP_INTR for KTHREAD_INTR 2009-11-09 19:00:52 +00:00
pooka
f1be958892 Add scheduling points around the iothread call to biodone() 2009-11-09 18:00:26 +00:00
nakayama
62117cce6e - make this compile on sparc.
- shrink blanks to fit in 80 columns.
2009-11-09 14:35:38 +00:00
dsl
26a8a91ded Fix stub prototype 2009-11-07 12:08:35 +00:00
pooka
3ad682caa6 Enable kernel kmem/vmem/pool/pool_cache by default again instead
of malloc(3) allocators.
2009-11-06 16:16:59 +00:00
pooka
83a2f995b9 In case a temp thread is exiting, borrow lwp0 for the respective
kmem_free().
2009-11-06 16:15:16 +00:00
pooka
9d391c932b account creds for processes, not lwp's 2009-11-06 15:22:33 +00:00
pooka
6abd8e3cdf lie that we are never in a softintr (i.e. add stub) 2009-11-06 15:22:16 +00:00
pooka
f5b3a079d0 Loop over dso list while loading succeeds (brute force dependency handling). 2009-11-05 14:13:03 +00:00
pooka
2a244b850d enqueue loaded modules and prevent duplicates 2009-11-05 14:10:53 +00:00
pooka
947f23c334 Pull all relegating memory allocators under a common roof in memalloc.c
(forgot to commit the new file)
2009-11-04 20:38:58 +00:00
pooka
d502da58ec 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.
2009-11-04 19:21:51 +00:00
pooka
c03306bc0d Give the kthread->pthread interface emulation its own module. 2009-11-04 19:17:53 +00:00
pooka
8ec96b27ff trim trailing whitespace 2009-11-04 18:27:40 +00:00
pooka
8ef52102c2 Pull all relegating memory allocators under a common roof in memalloc.c 2009-11-04 18:25:36 +00:00
pooka
83dbe94e8b Implement yield()/preempt() now that there is a CPU scheduler. 2009-11-04 18:11:11 +00:00
pooka
080522e1ce move copy-related routines to their own module 2009-11-04 17:01:45 +00:00
pooka
a69d555865 Use std. uiomove() & friends. 2009-11-04 16:55:20 +00:00
pooka
510038040b Use kern_mutex_obj.c directly instead of copypasting code. 2009-11-04 13:32:39 +00:00
pooka
332ad24cfd Weak aliazeize usermount_common_policy() to uncouple rumpkern
linkage from rumpvfs once again after the secmodel changes.
(temp solution, should find a better one)
2009-11-03 20:25:31 +00:00
pooka
652a56fde0 Reorder enough of lwp/cpu initialization to have enough context
for pool/kmem init to work again with the stock versions (as opposed
to rump malloc relegations).
2009-11-03 20:22:33 +00:00
pooka
341072b737 move module to SRCS where it logically belongs. no functional change. 2009-11-03 18:44:15 +00:00
pooka
2a63153751 regen: add AB_* macros 2009-11-03 18:23:15 +00:00
pooka
ef8c3e068e include AB_* macros from reboot.h 2009-11-03 18:22:44 +00:00
pooka
b32585a644 Add rump_boot_set/gethowto(), which can be called before rump_init()
to control .... *tadaa* boothowto.
2009-11-03 18:22:16 +00:00
pooka
99e178a1c1 Pass modinit to rumpuser_dl_module_bootstrap() as a function pointer
to avoid linker rump -> rumpuser -> rump dependency which is annoying
redundancy in static linking.
2009-10-24 11:36:59 +00:00
pooka
c9f53946a5 unused rumpuser_realpath is really dead 2009-10-24 11:29:55 +00:00
rmind
10758cb0f9 Simplify pmap_remove() a little by avoiding pmap_do_remove() layer, since
possibility to skip wired mappings is not needed anymore.  Apart from that,
no functional differences are intended.
2009-10-22 19:50:55 +00:00
rmind
3e88e8e75c Sync rump with kernel changes. 2009-10-21 23:13:53 +00:00
rmind
40cf6f3659 Remove uarea swap-out functionality:
- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code.  Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
2009-10-21 21:11:57 +00:00
pooka
5a1b660dab use autogenerated prototype 2009-10-20 23:29:57 +00:00
pooka
b762b305fb regen 2009-10-20 23:29:39 +00:00
pooka
693ea25ed2 add shmif_create 2009-10-20 23:28:50 +00:00
pooka
17e6aa2d7b printf -> rumpuser_dprintf
(can't use printf while holding spinlock)
2009-10-20 23:21:53 +00:00
tron
3ad0ebd5a8 Only allocate a "struct iovec" array from the healp if a reasonably sized
stack array isn't large enough.
2009-10-20 12:17:44 +00:00
pooka
0d29473b2c Actually, put uvm_readahead into rumpkern, since while it's
technically vfs stuff, sys_descrip depends on it and readahead
itself uses only the pager interface.
2009-10-20 10:42:41 +00:00
pooka
02a39de4a7 fix sign-compare warnings 2009-10-20 00:25:26 +00:00
pooka
fe208f2f7a __weak_alias for uvm_readahead() since it's used also in sys_descrip.c 2009-10-19 22:35:11 +00:00
pooka
639268f462 remove stale uvm_readahead() stub 2009-10-19 22:31:47 +00:00
christos
32ec2634aa treat sun2 like the other losing platforms. 2009-10-19 22:07:29 +00:00
pooka
c8d929f4fb add Arnaud's EuroBSDCon paper 2009-10-19 14:43:46 +00:00
tron
8cd44ca832 Avoid panic if a file system tries to write a chain of more than 32 mbuf-s
to a socket. This happens e.g. when copying large files to SMBFS.

Code reviewed by Antti Kantee.
2009-10-18 22:55:56 +00:00
pooka
9646a920b0 Clear PG_FAKE for pages we wrote to. This avoids paging in data
we already have (and the backend might not yet have) in cases where
fs_bshift > PAGE_SHIFT.
2009-10-18 00:41:09 +00:00
pooka
a6085c2236 fix off-by-one in sanity check and bump lazy bum magic value 2009-10-17 20:35:52 +00:00
pooka
291f141ce9 for udp sockets crank snd/rcvbufsize to 64k 2009-10-16 23:17:46 +00:00
pooka
afa1f603b7 In case of timeout, remember to remove ourselves from the sleep staleq. 2009-10-16 02:13:54 +00:00
pooka
d0c17feb81 We have real pollsuck() now, so remove this, ahem, less-than-perfect one.
(XXX: only thing in the kernel using pollsuck is netsmb)
2009-10-16 00:16:32 +00:00
pooka
254ffabc38 Include sys_select.c for proper select()/poll() support. 2009-10-16 00:14:53 +00:00
pooka
cc056ae92c include rumpcpu_generic 2009-10-15 23:42:40 +00:00
pooka
2f6e67dfd6 When allocating the temporary lwp we must have an lwp context. So
take turns using lwp0 for this purpose, nothing else uses it.
2009-10-15 23:15:55 +00:00
pooka
cfc0373f49 rump_get_curlwp() is dead 2009-10-15 16:46:37 +00:00
pooka
c663ed2f3f regen: lwp interface changes 2009-10-15 16:40:15 +00:00
pooka
8559951571 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.
2009-10-15 16:39:22 +00:00
pooka
5a586117cf fix previous to make sense 2009-10-15 01:50:08 +00:00
pooka
466e9bcfec adjust for new rump_cpu 2009-10-15 01:35:23 +00:00
pooka
8c6bd3376a forgot to commit with previous batch 2009-10-15 01:29:06 +00:00
pooka
9bb1dbd8d7 rump_cpu is now a pointer 2009-10-15 00:34:05 +00:00
pooka
fcebdb26e0 Add prototype for wait operation variants which do not drop any
resources (because they should be holding any in the first place).
2009-10-15 00:33:37 +00:00
pooka
f1f3f36233 regen: scheduling points 2009-10-15 00:32:11 +00:00
pooka
000a197343 regen: scheduling points in rump_pub wrappers 2009-10-15 00:31:25 +00:00
pooka
cd231d0604 Generate scheduling points in rump_pub calls. 2009-10-15 00:29:19 +00:00
pooka
9454f185c4 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.
2009-10-15 00:28:46 +00:00
pooka
36f718311e whoops, restore probing of ugen{0..3} instead of just ugen2 2009-10-14 23:29:42 +00:00
pooka
a9cd93a788 use rump_pub 2009-10-14 19:14:39 +00:00
pooka
d09e2773d0 "rumppriv" goes back to "rump" per internal interface naming change. 2009-10-14 18:18:53 +00:00
pooka
a6f92a2b8f regen: put all public interfaces created by ifspec into a rump_pub namespace 2009-10-14 18:16:41 +00:00
pooka
abf164854c Actually, adjust previous a bit: instead of preserving the names
of the external interfaces and namespacing the internal ones to
"rumppriv", put the external ones in a "rump_pub" namespace.  While
this requires adjusting all of the external callers of these
interfaces, it is the right thing to do in the long run, since it
clarifies the structure.
2009-10-14 18:14:48 +00:00
pooka
aa022ebd2b This wasn't supposed to go in -- the tree is under temporary
component boundary breakage.
2009-10-14 17:34:08 +00:00
pooka
8ca7f09f6e g/c some stuff which wasn't supposed to see the light of day 2009-10-14 17:30:52 +00:00
pooka
42972db848 Adjust rump sources for external/internal interfaces.
No functional change.
2009-10-14 17:29:19 +00:00
pooka
796b2444f2 generate rump local interfaces 2009-10-14 17:28:13 +00:00
pooka
c1bfb8966b adjust whitespace a bit 2009-10-14 17:26:09 +00:00
pooka
f2c144d595 Create rump public interfaces from description tables. This allows
us to control and wrap all entry points from "userspace" into rump.
This in turn is necessary for the upcoming rump cpu scheduler.

For each interface "foo" a public wrapper called "rump_foo" is
created.  It calls the internal implementation "rumppriv_foo".  In
case foo is to be called from inside of rump kernel space, the
private interface "rumppriv_foo" is used -- the userspace wrapper
prototypes are not even exported into the rump kernel namespace.
Needless to say, the rump kernel internal interfaces are not exported
for users.

Now, three classes of interfaces fight for control of rump:
  + the noble local control interfaces (which this commit addresses)
  + the insidious rump system calls (which are generated from syscalls.master)
  + and the evil vnode interfaces (which are generated from vnode_if.src)
2009-10-14 17:17:00 +00:00
pooka
ddc943db02 regen: fix rump varargs syscalls prototypes 2009-10-13 21:57:52 +00:00
pooka
5ac5a300e2 don't define curlwp, it's just (unused) sugar 2009-10-13 20:08:08 +00:00
pooka
b7f550b683 add one more passthrough 2009-10-13 18:36:48 +00:00
pooka
c8c66517fe Bump iovec lazy bum magic value to 32: nfsd likes to write mbufs
with 17 per chain (previous i'm-too-lazy-for-my-forloop value was
of course 16).
2009-10-12 02:25:44 +00:00
pooka
8ac0fe74d9 add recvmsg and sendmsg to networking rump syscalls 2009-10-11 23:23:09 +00:00
pooka
7e9bd843aa Include host offset in regular etfs read/write operations (I can't
imagine it being particularly useful, but let's call file this
under POLA).
2009-10-11 18:12:51 +00:00
pooka
860f5d7238 Support creating file system sockets (non-sockets not supported in
VOP_CREATE since I don't want to have to write read/write support
for non-etfs files).
2009-10-11 17:54:22 +00:00
pooka
fed1ab4ee0 raidframe works well enough now to initialize parity, so install it. 2009-10-11 11:26:40 +00:00
pooka
8d38112c32 add some stubs required by raidframe linkage 2009-10-10 21:10:04 +00:00
pooka
d4069e2c5e Provide an interface for reboot. 2009-10-09 14:41:36 +00:00
pooka
d3da4377ca regen 2009-10-09 14:32:07 +00:00
pooka
4dd39169ff namespace RB_ from reboot.h 2009-10-09 14:31:47 +00:00
pooka
0111b794da Seems like module loading code is tasked with calling secmodel_register()
these days ...
2009-10-08 00:47:47 +00:00
pooka
b15be8fcc2 remove extraneous call to secmodel_suser_start() 2009-10-08 00:36:56 +00:00
pooka
4ecb17968a dlclose() in error branch 2009-10-08 00:34:54 +00:00
pooka
366ae82927 Use uvm_readahead.c instead of null stubs. 2009-10-07 10:23:50 +00:00
pooka
2038fbfec8 use vref() for increasing reference count instead of homegrown brilliance 2009-10-07 09:55:35 +00:00
pooka
3398bac8f2 g/c some prehistoric interfaces which have been superceded by others. 2009-10-07 09:50:43 +00:00
pooka
9759195360 * set winsize to memwinsize in initial getwindow(). makes no functional
difference, but looks less like a debug hack leftover.
* explain memory windows vs. directio a little better in comment
2009-10-07 09:42:14 +00:00
pooka
a8268fa583 space -> tab in one entry for consistency 2009-10-07 09:24:27 +00:00
pooka
788da19b0b do initial window allocation test at proper offsets 2009-10-07 09:23:03 +00:00
pooka
61d1563c1b Allow to set size and host file offset for etfs files and rumpblk. 2009-10-07 09:17:54 +00:00
pooka
5290e6c820 Give a p2k node an internal state. This allows us to do proper
reference counting and not release nodes based just on puffs'
impression of if they are free.

This also allows us to reclaim vnodes already in inactive if the
file system so desires.  Some file systems, most notably ffs, change
file state already in inactive.  This could lead to a deadlock in
the middle of inactive and reclaim if some other puffs operation
was processed in between (as exposed by haad's open(at) test
program).

Also, properly thread the componentname from lookup to the actual
vnode operation.  This required the changes the rump componentname
routines.  Yes, the rename case is truly mindbogglingly disgusting.
Puke for yourself.
2009-10-06 16:23:03 +00:00
pooka
a373547b43 Use uint64_t instead of size_t for block device partition size.
from jak
2009-10-06 13:05:44 +00:00
pooka
0f0ad0a73d Build proper version for i386 (since it works) and dummy versions
for the rest until the disklabel MD problems get sorted out.
2009-10-06 09:12:47 +00:00
pooka
608e3170ea * support async transfers
* make it possible to abort transfers
(these are all cheap hacks, but make things work)
2009-10-05 13:00:37 +00:00
pooka
281623cb29 Call the pager with page-aligned offsets, 'cause that's what the
pager expects.  Fixes KASSERT failure if someone manages to do
otherwise.
2009-10-05 09:11:29 +00:00
pooka
cd7abaf063 set l_cpu for lwp0 2009-10-05 09:09:29 +00:00
pooka
29b5e8e633 Attach sd to devsw and create /dev/sd0[a-h]. 2009-10-05 08:34:53 +00:00
pooka
bc9ecc7b8b * pass a few write requests through to the device.
* drop async transfer requests on the floor (no, this does not make
  anything work, but it's the easiest way to prevent a receive pipe
  transfer request from hanging everything.  one tiny bugstep at a time ...)
2009-10-04 17:46:58 +00:00
pooka
8e5c2019ed Fix hopefully the last deadlock in the wretched piece of code:
since ltsleep abuses "while (!mutex_tryenter()) continue;" for NOT
releasing the kernel biglock before sleeping, we cannot do a normal
mutex_enter() in the wakeup path, or otherwise we might be a
situation where the sleeper holds the kernel lock and wants the
sleepermutex (and will not back down) and the wakeupper holds the
sleepermutex and wants the kernel lock.  So introduce kernel lock
backdown to the wakeup path.
2009-10-04 17:40:34 +00:00
pooka
9dbaa03ccb Implement RUMP_ETFS_REG. Usable e.g. by firmload(9).
(well, it should probably be RUMP_ETFS_PATH, but simple things first)
2009-10-04 16:31:08 +00:00
pooka
8ec501e110 Include firmload. Although it may be used by devices, it's pure
vfs in nature, and therefore it belongs here (can't load a firmware
from a file system without file system support, right?).  Rename
rump_cwdi to cwdi0, since firmload depends on that name (naughty
firmload).
2009-10-04 13:29:36 +00:00
pooka
a346a8ca77 Initialize suckets before domains since some domains install timers
which take softnet_lock and might run before the lock is actually
initialized.  Also, soinit() itself already calls soinit2(), so no
need to call it twice.
2009-10-04 13:24:58 +00:00
pooka
6e184706c2 Pass some requests to the device. Hi ho, required for rum. 2009-10-04 10:44:31 +00:00
pooka
4712dfb73d Support rum@usb. Currently manages to configure and attach:
pain-rustique:66:~> ./rumpusbprobe
mainbus0 (root)
rumpusbhc2 at mainbus0
usb0 at rumpusbhc2: USB revision 2.0
uhub0 at usb0: vendor 0x0000 product 0x0000, class 9/0, rev 0.00/0.00, addr 1
rum0 at uhub0 port 1
rum0: D-Link DWA-111, rev 2.00/0.01, addr 2
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, address 00:24:01:31:98:9a
rum0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
rum0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
2009-10-04 10:43:03 +00:00
pooka
3e8421a27d Support net80211 in rump (for wireless device drivers, therefore in "dev") 2009-10-04 10:40:40 +00:00
christos
c9bb67bb7b Need proc_uidmatch 2009-10-03 22:55:48 +00:00
pooka
a611f250f5 Report the root hub as self-powered. Works better when attaching
power-hungry devices.
2009-10-03 20:46:49 +00:00
pooka
8d655ed84b probe and attach ugen0 through ugen3 2009-10-03 19:07:33 +00:00
pooka
cbdc6e568f pass unit number in mainbus attach args 2009-10-03 19:06:35 +00:00
elad
53ca19a3b3 First part of secmodel cleanup and other misc. changes:
- Separate the suser part of the bsd44 secmodel into its own secmodel
    and directory, pending even more cleanups. For revision history
    purposes, the original location of the files was

        src/sys/secmodel/bsd44/secmodel_bsd44_suser.c
        src/sys/secmodel/bsd44/suser.h

  - Add a man-page for secmodel_suser(9) and update the one for
    secmodel_bsd44(9).

  - Add a "secmodel" module class and use it. Userland program and
    documentation updated.

  - Manage secmodel count (nsecmodels) through the module framework.
    This eliminates the need for secmodel_{,de}register() calls in
    secmodel code.

  - Prepare for secmodel modularization by adding relevant module bits.
    The secmodels don't allow auto unload. The bsd44 secmodel depends
    on the suser and securelevel secmodels. The overlay secmodel depends
    on the bsd44 secmodel. As the module class is only cosmetic, and to
    prevent ambiguity, the bsd44 and overlay secmodels are prefixed with
    "secmodel_".

  - Adapt the overlay secmodel to recent changes (mainly vnode scope).

  - Stop using link-sets for the sysctl node(s) creation.

  - Keep sysctl variables under nodes of their relevant secmodels. In
    other words, don't create duplicates for the suser/securelevel
    secmodels under the bsd44 secmodel, as the latter is merely used
    for "grouping".

  - For the suser and securelevel secmodels, "advertise presence" in
    relevant sysctl nodes (sysctl.security.models.{suser,securelevel}).

  - Get rid of the LKM preprocessor stuff.

  - As secmodels are now modules, there's no need for an explicit call
    to secmodel_start(); it's handled by the module framework. That
    said, the module framework was adjusted to properly load secmodels
    early during system startup.

  - Adapt rump to changes: Instead of using empty stubs for securelevel,
    simply use the suser secmodel. Also replace secmodel_start() with a
    call to secmodel_suser_start().

  - 5.99.20.

Testing was done on i386 ("release" build). Spearated module_init()
changes were tested on sparc and sparc64 as well by martin@ (thanks!).

Mailing list reference:

	http://mail-index.netbsd.org/tech-kern/2009/09/25/msg006135.html
2009-10-02 18:50:12 +00:00
pooka
93992109b3 Include humanize and extent support in rumpkern. 2009-10-02 15:51:26 +00:00
pooka
713aaa79d5 Checkpoint rump usb host controller implementation. It's pretty
barebones, but manages to succesfully probe and attach the two USB
memory sticks I own.  (I don't own much USB junk, *hint hint*)

"dmesg":
pain-rustique:50:~> ./rumpusbprobe
mainbus0 (root)
rumpusbhc0 at mainbus0
usb0 at rumpusbhc0: USB revision 2.0
uhub0 at usb0: vendor 0x0000 product 0x0000, class 9/0, rev 0.00/0.00, addr 1
umass0 at uhub0 port 1 configuration 1 interface 0
umass0: vendor 0x1221 product 0x3234, rev 2.00/0.00, addr 2
scsibus0 at umass0: 2 targets, 1 lun per target
sd0 at scsibus0 target 0 lun 0: <USB2.0, Flash Disk, 2.20> disk removable
sd0: fabricating a geometry
sd0: 2023 MB, 2023 cyl, 64 head, 32 sec, 512 bytes/sect x 4143104 sectors

[switch the other stick in]

pain-rustique:51:~> ./rumpusbprobe
mainbus0 (root)
rumpusbhc0 at mainbus0
usb0 at rumpusbhc0: USB revision 2.0
uhub0 at usb0: vendor 0x0000 product 0x0000, class 9/0, rev 0.00/0.00, addr 1
umass0 at uhub0 port 1 configuration 1 interface 0
umass0: Kingston Technology product 0x1603, rev 2.00/2.00, addr 2
scsibus0 at umass0: 2 targets, 1 lun per target
sd0 at scsibus0 target 0 lun 0: <Kingston, DataTraveler 2.0, 1.00> disk removable
sd0: fabricating a geometry
sd0: 974 MB, 974 cyl, 64 head, 32 sec, 512 bytes/sect x 1994752 sectors
pain-rustique:52:~>
2009-10-02 15:35:46 +00:00
pooka
ee5f440732 include usbroothub_subr.c 2009-10-02 12:41:38 +00:00
pooka
9b32227de9 Hold on to your giantlocks while calling device autoconfusion. 2009-10-02 11:01:53 +00:00
pooka
fb39ec98d5 panic if cv_wait() is called in non-threaded mode 2009-10-02 09:56:08 +00:00
pooka
f9a183b5d6 Checkpoint some work-in-progress for USB support in rump (currently
with limited scsi@umass support).  However, not useful for anything
before I get the ugen-to-rump usb host controller cleaned up and
checkpointed.
2009-10-01 21:46:30 +00:00
pooka
73ad6a8b6e add a new init-related calls 2009-10-01 21:43:29 +00:00
pooka
5ef3483b17 children of mainbus, attach (well, one child, iff it happens to be around) 2009-10-01 15:21:38 +00:00
pooka
8de13bd4c6 regen: remove VNODE_LOCKDEBUG 2009-09-29 11:54:52 +00:00
dholland
e0ec0f8616 regen again (forgot both patches touched namei.h) 2009-09-27 17:24:31 +00:00
dholland
a3c0999baa regen 2009-09-27 17:21:22 +00:00
pooka
ca97c3aebc Load modules from all components which are linked into a rump binary
with -lrumpcomponent.  Previously only the first library component
containing a module would get loaded automatically.
2009-09-24 21:30:42 +00:00
pooka
dedb61e364 remove a no longer necessary hack 2009-09-24 21:00:09 +00:00
pooka
79b1421a0b <sys/stdint.h> is a non-standard header, so include it only from
kernel code (where it will be included from the NetBSD kernel source
tree).  Use <stdint.h> in userland namespace, i.e. when compiling
librumpuser.
2009-09-21 15:29:36 +00:00
pooka
9b040bc3a9 Split config_init() into config_init() and config_init_mi() to help
platforms which want to call config_init() very early in the boot.
2009-09-21 12:14:46 +00:00
pooka
eeb94c804f attach mainbus 2009-09-20 23:16:09 +00:00
pooka
dfd2ba19ba default to AB_SILENT 2009-09-20 23:02:31 +00:00
pooka
64d32972db arrr, implement softint_disestablish(). this code be needin' an enema, matey. 2009-09-19 14:18:01 +00:00
pooka
159d9b46b8 vax macro magic requires Sysmap (untested).
XXX: I should add the blanket userspace pmap back for vax, its
pmap.h just has too many inlines and macros for this to ever work.
2009-09-18 18:31:53 +00:00
pooka
11281f01a0 Replace a large number of link set based sysctl node creations with
calls from subsystem constructors.  Benefits both future kernel
modules and rump.

no change to sysctl nodes on i386/MONOLITHIC & build tested i386/ALL
2009-09-16 15:23:04 +00:00
pooka
4b1eb92699 include init_sysctl_base.c 2009-09-16 15:10:23 +00:00
pooka
d04c4fc891 call ifinit{,1}() 2009-09-16 15:08:53 +00:00
pooka
66f04a7703 create interfaces only after ifnef is initialized 2009-09-16 13:30:41 +00:00
pooka
4f50c4bce3 work around tap bug: if /dev/tap<n> was previously non-blocking, newly
opened fd's will also be non-blocking.
(yeayea, i'll fix the kernel some day, but I don't want to reboot
my host OS now)
2009-09-16 13:29:42 +00:00
degroote
2d48ac808c Import pfsync support from OpenBSD 4.2
Pfsync interface exposes change in the pf(4) over a pseudo-interface, and can
be used to synchronise different pf.

This work was part of my 2009 GSoC

No objection on tech-net@
2009-09-14 10:36:48 +00:00
pooka
48b3a6f7a3 binutils 2.19 has changed the old behaviour of defining __start_SECTNAME
for orphaned sections to using PROVIDE.  What this means is that
unless a rump component internally references that symbol, it will
not be included in the component shared library, and hence cannot
be referenced when the component is loaded.  Add a workaround which
works both with 2.16 and 2.19: force a reference to the __start
symbol internally and hence retain it in the resulting library.
2009-09-13 22:51:41 +00:00
pooka
f27984527b call prop_kern_init() 2009-09-13 19:09:13 +00:00
pooka
a06e4d63b8 remove pool link set attach code 2009-09-13 19:07:18 +00:00
pooka
4aaa6d0b91 librumpdev_disk doesn't compile on a lot of platforms, so replace
it with a dummy for now until I can work out the problems (nothing
in-tree links against it yet).
2009-09-11 19:01:08 +00:00
pooka
c7ef14e487 Build and install cgd, disk and rnd rump device components. 2009-09-08 20:34:47 +00:00
pooka
725cff3f33 kernel code needs -Wno-format-zero-length 2009-09-08 20:24:08 +00:00
pooka
9367779abf initialize rnd if present 2009-09-08 20:15:51 +00:00
pooka
293b1ff86d add rump rnd device component 2009-09-08 20:12:52 +00:00
pooka
3939408d61 Add a few weak symbols for places where the kernel module boundaries
are not as perfect as theory.
2009-09-08 20:10:44 +00:00
pooka
795229a9f5 Use PTHREAD_MUTEX_ERRORCHECK. This enables rump deadlock detection
once again:
panic: rumpuser fatal failure 11 (Resource deadlock avoided)
2009-09-08 20:04:03 +00:00
pooka
23503a9bee provide pmf stubs 2009-09-07 20:56:04 +00:00
pooka
a1b3e27877 remember to build opendisk 2009-09-07 20:50:35 +00:00
pooka
75509b2e20 one more ketchup with rump_dev_makenodes -> rump_vfs_makedevnodes 2009-09-07 14:28:18 +00:00
pooka
7b557eda2c Always define __NetBSD__ (for builds on non-NetBSD) 2009-09-07 13:02:37 +00:00
pooka
5b7424e53f ketchup: rump_dev_makenodes() -> rump_vfs_makedevnodes() 2009-09-07 11:23:39 +00:00
pooka
4b28bbe377 Run rump_dev_init() where available. 2009-09-06 20:54:19 +00:00
pooka
129104a3ac Rename rump_dev_makenodes() to rump_vfs_makedevnodes() -- while it
will most likely be used devices, the implementation requires
services provided by vfs (mkdir, mknod).
2009-09-06 20:42:25 +00:00
pooka
cec76b1282 add a very simple version of pollsock()
XXX: it seems to exist purely for the pleasure of netsmb??
2009-09-06 20:02:49 +00:00
pooka
880deff995 move hppa cpp kludge to the end of the file 2009-09-06 19:14:54 +00:00
pooka
6694ae0257 zalloc new rumpfs nodes to make sure rn_vp is initially NULL.
Fixes problem pointed out by Nicolas Joly in private email.
2009-09-05 11:02:49 +00:00
pooka
da73ba1e67 build & install librumpdev_netsmb and librumpfs_smbfs components 2009-09-04 17:21:33 +00:00
pooka
f42da03906 add a few global symbols required by kernel code 2009-09-04 17:15:21 +00:00
pooka
c39c71d23c brace policy. no functional change. 2009-09-04 16:42:19 +00:00
pooka
77c3d9700d Actually, we cannot release the megalock before we take sleepermtx,
since that opens a race window for non-mpsafe code, so do it after.
Additionally, we cannot call mutex_enter() for sleepermtx, since
ltsleep/mtsleep should not block (i.e. release kernel lock) before
actually blocking, so busyloop in mutex_tryenter().  Finally, when
waking up, take kernel lock back only *after* releasing sleepermtx
to avoid deadlock against another thread holding the kernel lock
and wanting sleepermtx.
2009-09-04 16:41:39 +00:00
pooka
3f664c0a97 * wrap tsleep functions to drop die grosslock since we're going to
sleep anyway in a few flicks from the clock
* broadcast instead of signal in wakeup()
2009-09-04 13:58:57 +00:00
pooka
adc720a745 allocate p_lock for virtual processes 2009-09-04 12:27:09 +00:00
pooka
208d98b320 add netsmb rump component
(yes, it's functionally a device instead of a networking domain,
since it provides and is accessed through /dev/nsmb instead of
being accessed through sockets)
2009-09-04 12:20:42 +00:00
pooka
721430ffd9 rump smbfs component 2009-09-04 12:16:54 +00:00
pooka
e16bbe64c5 update list of directories 2009-09-04 10:54:44 +00:00
he
e6203cd52f Both amiga and atari needs <sys/lwp.h> explicitly included in order
for curlwp to be properly declared.
2009-09-04 08:57:00 +00:00
pooka
de4fa6c51a Build & install rumpdev, a device component for rump. It currently
supports autoconf and is required for example by pseudo-device rump
components.
2009-09-03 15:35:58 +00:00
pooka
bd8ebb811a install librumpfs_fdesc 2009-09-03 12:55:10 +00:00
pooka
a6ea870a1c descend into librumpcrypto for a local build 2009-09-03 12:35:19 +00:00
pooka
4581312d58 * implement pr_ctloutput
* check for errno before more costly checks
2009-09-02 19:04:51 +00:00
pooka
87afe0b831 add rumpuser_net_setsockopt() 2009-09-02 19:02:51 +00:00
pooka
c597708331 add address space specifiers to do_sys_mk{dir,nod} calls 2009-09-02 16:55:07 +00:00
skrll
719e2eddb4 s/int/u_int/ for flags in pmap_enter and deal with this in rump.
Hi cegger.
2009-08-16 14:06:36 +00:00
skrll
4519d76c61 KNF 2009-08-16 14:02:08 +00:00
martin
1d37d9399f Use __sparc_v9__ instead of __sparc64__ - this hack is due to arch dependend
pmap peculiarities, and does not cover sparc64 code when compiled
with -m32.
2009-08-10 12:04:17 +00:00
skrll
364eb45f71 Fix vax.
Built by default options really should be tested better.
2009-08-09 09:22:16 +00:00
pooka
2a112e499e arm32 (but not arm26) wants to be different and #define pmap_remove()
as pmap_do_remove().  Compensate.
2009-08-08 00:46:56 +00:00
pooka
0ebb0c6cda Move genfs_io.c from rump SRCS to genfs SRCS.
Aesthetic commit, no functional change.
2009-08-07 18:52:56 +00:00
pooka
75f7f90d47 Switch rump from the handwritten vnode pager to the standard kernel
vnode pager.

It would have been nice to keep a separate version:
 * it has helped find file system bugs which the kernel pager
   treated as non-errors
 * it does not contain extra payload unnecessary in userspace

However, getting the details of the pager implementation correct
with all the flags, offsets and block/page size special cases is
*EXTREMELY* difficult (chuq > god).

On the plus side, LFS write now works for file data too instead of
just metadata.  Also, maybe being able to singlestep the genfs
vnode pager in the comfort of userspace will allow more people to
understand how the behemoth functions.
2009-08-06 12:07:56 +00:00
pooka
7f2a28a489 Add suicidal stubs for pmap_enter() and pmap_remove(). Hopefully
the MD bits for all the glorious archs went right.
2009-08-06 11:50:19 +00:00
pooka
a19ded3606 g/c uvm_aio_biodone1(). not used anymore. 2009-08-05 14:11:57 +00:00
pooka
095aaa3428 Clear PG_PAGEOUT in uvm_aio_aiodone() 2009-08-05 14:05:22 +00:00
pooka
b2ae25b4cd Use uvm_vnode.c instead of homerolled stuff. 2009-08-05 00:04:08 +00:00
pooka
b46117f3cd * support uvm_pagermapin/out(), adapt uvm_pageratop()
Instead of doing actual page remapping, which we can't portably
  do in userspace without extensive trickery (read: signals), simply
  allocate the kva window with new physical backing, copy page
  contents, return, and copy contents back in mapout.  Since the
  pages are locked during the mapping cycle, we can do this without
  hazard.

* add lots of stubbies necessary for new stuff coming soon
2009-08-04 23:58:29 +00:00
pooka
c8c1730cc4 terminate comment too 2009-08-04 20:01:06 +00:00
pooka
16de900c99 * supply pager flags in ubc_uiomove()
* implement uvm_aio_aiodone() (which is almost identical to the "real" one)
2009-08-04 19:54:16 +00:00
pooka
3ec4aae3c4 Do std vnode locking for specnodes located on rumpfs. 2009-08-04 12:40:42 +00:00
pooka
fd3da5f6fe g/c cachepgmtx, i have no idea what it was supposed to be useful for. 2009-08-03 23:32:06 +00:00
pooka
e9eda42d2c track number of pages associated with vm object 2009-08-03 17:10:51 +00:00
pooka
43ccc52f24 Support read/write in rumpblk via physio() 2009-08-03 16:22:00 +00:00
pooka
eddab4e9bc * get rid of the old fakeblk registration interface. Instead,
introduce a new and improved "etfs" interface, which can be used
  to register host files accessible from rump fs namespace.  This
  new interface is not restriced to block devices, and neither does
  it require the same pathname in host namespace and rump namespace.
  Therefore, the same host file can be represented both as a char
  and block device in rump namespace.

* adjust rumpblk to make the above possible

* improve rumpfs: nodes are now created properly and not implicitly
  tied to the vnode lifecycle
2009-08-03 14:23:30 +00:00
pooka
9d98904e35 add fdesc fs rump lib
(don't descend in here by default, I don't want to deal with the
setlist pain for now)
2009-07-31 19:16:45 +00:00
pooka
35e55460ba Since rumpfs can now be used from publically exported routines,
convert unsupported checking KASSERTs to return EOPNOTSUPP.
2009-07-22 21:06:56 +00:00
pooka
22d6f86dee regen: fh syscalls 2009-07-21 23:59:19 +00:00
pooka
dd081aad70 the consumers expect the aiodone workqueue to be mpsafe. make it so. 2009-07-21 00:33:28 +00:00
pooka
9d8db640e4 describe & attach raidframe rump kernel component 2009-07-20 18:11:37 +00:00
pooka
eee912bc25 Add cgd rump kernel component. 2009-07-20 18:09:20 +00:00
pooka
28631b61bf device subroutines and autoconfig support for rump. work in progress. 2009-07-20 18:04:13 +00:00
pooka
d0095f0917 add crypto support for rump 2009-07-20 18:03:26 +00:00
pooka
fd1eba5f43 realloc works much better if it actually uses realloc instead of malloc 2009-07-20 17:12:43 +00:00
reinoud
69a586f230 Import read-only part of the NiLFS (v2) implementation for NetBSD. It has been
tested with a DEBUG+DIAGNOSTIC+LOCKDEBUG kernel. To summerise NiLFS, i'll
repeat my posting to tech-kern here:

NiLFS stands for New implementation of Logging File System; LFS done
right they claim :) It is at version 2 now and is being developed by NTT, the
Japanese telecom company and recently put into the linux source tree. See
http://www.nilfs.org. The on-disc format is not completely frozen and i expect
at least one minor revision to come in time.

The benefits of NiLFS are build-in fine-grained checkpointing, persistent
snapshots, multiple mounts and very large file and media support. Every
checkpoint can be transformed into a snapshot and v.v. It is said to perform
very well on flash media since it is not overwriting pieces apart from a
incidental update of the superblock, but that might change. It is accompanied
by a cleaner to clean up the segments and recover lost space.

My work is not a port of the linux code; its a new implementation. Porting the
code would be more work since its very linux oriented and never written to be
ported outside linux. The goal is to be fully interchangable. The code is non
intrusive to other parts of the kernel. It is also very light-weight.

The current state of the code is read-only access to both clean and dirty
NiLFS partitions. On mounting a dirty partition it rolls forward the log to
the last checkpoint. Full read-write support is however planned!

Just as the linux code, mount_nilfs allows for the `head' to be mounted
read/write and allows multiple read-only snapshots/checkpoint mounts next to
it.

By allowing the RW mount at a different snapshot for read-write it should be
possible eventually to revert back to a previous state; i.e. try to upgrade a
system and being able to revert to the exact state prior to the upgrade.

Compared to other FS's its pretty light-weight, suitable for embedded use and
on flash media. The read-only code is currently 17kb object code on
NetBSD/i386. I doubt the read-write code will surpass the 50 or 60. Compared
this to FFS being 156kb, UDF being 84 kb and NFS being 130kb. Run-time memory
usage is most likely not very different from other uses though maybe a bit
higher than FFS.
2009-07-18 16:31:41 +00:00
apb
559e6ded07 Mark rumpuser_thread_exit() as __dead, to match its prototype.
Part of PR 41255 from Kurt Lidl.
2009-07-14 21:00:53 +00:00
pooka
bbd95bc6d9 add reference 2009-06-30 15:28:01 +00:00
dholland
9b5247fa1c Another namei_simple like the previous ones; was added after I did the
initial sweep and I guess I missed it while merging.
2009-06-29 07:11:06 +00:00
dholland
69b592eb0c regen 2009-06-29 05:03:12 +00:00
pooka
ab415fb3d5 MAXUSERS comes from Makefile.rump 2009-06-10 20:54:55 +00:00
pooka
f4b516bb14 libkern is fully included in rumpkern, no need for cherry-picking
modules elsewhere.
2009-06-10 20:50:51 +00:00
pooka
98c3c6a157 indicate function of previous in comment 2009-06-10 18:36:33 +00:00
pooka
1c083dc02b Add rumpuser_dprintf(), which can be used as a "safe" debug print
routine -- the kernel printf does a lot of crud which is not always
nice and dandy especially when debugging locks.
2009-06-10 18:34:49 +00:00
pooka
3178a63559 Support VOP_MKNOD. This is so that components which need device
nodes (e.g. raidframe) can create them.
2009-06-10 12:12:23 +00:00
he
4ffd944fac Add a dummy uvm_readahead() function, to fix build issues after it
recently got added to the kernel.
OK'ed by pooka@
2009-06-10 11:41:43 +00:00
pooka
ed545b8d69 check that interlock isn't null before releasing it 2009-06-09 23:26:19 +00:00
pooka
4c54895067 Checkpoint a bunch of work-in-progress: support for disk devices
and raidframe.  Raidframe works well enough to configure a raid in
the rump kernel, but the usage is "interesting" (pending some other
changes/cleanup from other parts in my tree).

These are not built by default yet.
2009-06-09 16:16:14 +00:00
pooka
698910a47a simplelocks have been supported in rump for a while, allow their use. 2009-06-09 15:53:05 +00:00
pooka
162fa5811a Nuke some bss stuff which is coming from vfs_bio via rumpvfs. 2009-06-09 14:30:06 +00:00
pooka
99616de8dc Put some spunk into deadfs. 2009-06-09 14:20:42 +00:00
pooka
13c5258c1a pool_prime emulation 2009-06-03 16:07:21 +00:00
pooka
8f814de2c0 Add user vmspace locking and remapping routines. Obviously, these
currently work only if the vmspace is local to the rump kernel.
2009-06-03 16:06:10 +00:00
pooka
2c5f264f9b implement wakeup_one 2009-06-03 15:16:42 +00:00
pooka
ca254ab879 include syscalls.c 2009-06-02 23:28:53 +00:00
wiz
53b002f1fb Use Nx for NetBSD. 2009-05-28 09:41:05 +00:00
pooka
f731c31fa4 Use a bunch of weak symbols to determine which network components
are present.  This works in userspace as opposed relying in link
sets, which fail miserably.  Later, when the networking stack
becomes modularized, we can move to a dynamic scheme like with file
systems.

Also, this change allows us to do proper autoconfig, namely attach
the loopback interface iff it is present.
2009-05-28 00:02:16 +00:00
pooka
9523c2be23 Add a dummyif, which doesn't actually traffic any cargo, but since
it has no backend it can always be attached and is therefore
convenient for testing ifconfig.
2009-05-27 23:41:20 +00:00
pooka
7d6e9ec774 Support IPv6 in rump. I'd have liked to introduce a netinet6
component, but due to ifdef happiness permeating the sources, it's
a compile decision for now, so netinet pulls in both inet and inet6.

One issue, one single issue: the loopback interface still needs to
be created for IPv6 to work.  I have patches to take care of it
automatically if the appropriate component (net) is present, but
they require a bit more testing before commit.
2009-05-26 23:43:39 +00:00
pooka
9c2d055f86 Filter out ENETRESET from ether_ioctl() since we aren't interested
in multicast hugging.
2009-05-26 19:03:05 +00:00
pooka
c50e4e4fff add ioctl to list of compile-time translated calls 2009-05-26 15:44:35 +00:00
pooka
387cc577e1 Add BSDCan 2009 paper to SEE ALSO. 2009-05-24 23:13:49 +00:00
mlelstv
57f2ff1bb6 <sys/syscallargs.h> requires <sys/sched.h> to define cpuset_t. 2009-05-24 20:10:50 +00:00
pooka
3f019758ec forward declare struct stat to avoid implicit header dependencies 2009-05-22 12:47:39 +00:00
pooka
aeedc12a43 Add compat routines for vattr translation over time_t change. 2009-05-22 10:51:54 +00:00
pooka
659f41e70a Add handrolled stat30 compat syscalls for calling post-time_t rump
kernels from pre-time_t userlands.
2009-05-22 08:59:32 +00:00
pooka
ac42a021b0 Add rump_getversion(), which returns the version of NetBSD for the
rump kernel.
2009-05-22 08:34:14 +00:00
pooka
908a0b2534 fix __KERNEL_RCSID 2009-05-22 08:26:52 +00:00
pooka
e11306504d Set vnode op vector properly for block devices too. Makes mounting
a real block device work again.
2009-05-19 13:42:35 +00:00
pooka
68136aad74 regen: removal of pad arguments from the public interfaces 2009-05-15 15:52:46 +00:00