Age | Commit message (Collapse) | Author |
|
have no interrupt handler registered.
Avoids interrupt storm on Matebook D reported by brynet@
From James Hastings. ok kettenis@ brynet@
|
|
minphys() function check for MAXPHYS.
Feedback from tedu@ kettenis@ dlg@
ok cheloha@, robert@, jmatthew@ as part of larger diff
|
|
system minphys(). scsi_minphys() will do that and cd/sd/st will call
scsi_minphys().
ok jmatthew@ as part of larger diff
|
|
Will allow simplification of individual driver *minphys() functions.
ok jmatthew@ as part of larger diff
|
|
|
|
without this the tun_softc is still available on the list for the
syscalls to get to, even though the device is dead and should no
longer be referenced. by leaving it in the list after the
refcnt_finalize, it was still be found and was used.
found by claudio@
jmatthew@ agrees with the change
|
|
the stack puts an mbuf on the tun ifq, and ifqs protect themselves
with a mutex. rather than invent another lock that tun can wrap
these ifq ops with and also coordinate it's conditionals (reading
and dying) with, try and reuse the ifq mtx for the tun stuff too.
because ifqs are more special than tun, this adds a special
ifq_deq_sleep to ifq code that tun can call. tun just passes the
reading and dying variables to ifq to check, but the tricky stuff
about ifqs are kept in the right place.
with this, tun_dev_read should be callable without the kernel lock.
|
|
ok dlg@
|
|
|
|
i want to make tun_dev_read and tun_dev_write safe to run without
the kernel lock. the problem with that is you need a way to prevent
the tun_softc from going away while it's being used by those syscall
paths rather than relying on the big lock to serialise them. blocking
reads sleep, and this was coped with by checking if the interface
went away or changed by looking up the ifindex after every sleep
and seeing if the ifp changed.
i wanted to simplify this by just refusing to let an interface get
destroyed while the device side is open. everyone i asked at a2k20
about whether this was acceptable said this is wrong and i was a
terrible person for trying to make my life easier for myself. so i
ended up going down this rabbit hole.
the code now keeps track of the actual device node (ie, both the
major and minor) which is open, and when the interface is destroyed
it calls VOP_REVOKE against it. this basically calls tun_dev_close
immediately, and wires the fd/vfs stuff up against some deadfs thing
which makes subsequent operations fail as if the device was pulled.
this is good. previously if a tun/tap interface was destroyed while
it was open, and then got recreated, userland wouldnt notice and
would just go ahead and use the newly created device as if it always
had it open. now it actually has access revoked, and access to a
newly created tun/tap interface has to have a new tun_dev_open call
against it.
im putting this in now so people can have a go at it. claudio@ and
i have been hitting it pretty hard, but more testing is welcome.
ok claudio@
|
|
Furthermore the parser was unaware a NOTE could contain multiple
records. The scanner has been rewritten. Another bonus bug: if the
binary was labelled as OPENBSD ABI, NOTE parsing was completely
skipped so WXNEEDED wasn't learned either...
Now that NOTEs are scanned correctly, search for the 'Go' NOTE. (During
this work found the Go linker produces slightly broken NOTEs - Go team
will probably fix that).
Work is happening for our Go dynamic-binaries to use libc syscall
stubs, but the change isn't ready. Go (and reportedly free-pascal
also?) binaries are the only dynamic programs which require syscalls
in the main-program. Since Go binaries are now identifiable, we can
disable syscalls in all other regular dynamic-main-programs, gaining
the strict enforcement we want. When the the Go-libc-stub change
arrives we'll delete the Go NOTE scan and treat Go binaries same as
regular binaries.
This change probably breaks free-pascal, a lower priority item to repair.
some discussion with jsing, ok kettenis
|
|
We included DIAGNOSTIC in *sleep_nsec(9) when they were first committed
to help us sniff out divison-to-zero bugs when converting *sleep(9)
callers to the new interfaces.
Recently we exposed the new interface to userland callers. This has
yielded some warnings.
This diff adds a process name and pid to the warnings to help determine
the source of the zero-length sleeps.
ok mpi@
|
|
ok visa@, kettenis@, deraadt@
|
|
dt(4) exposes kernel internals, addresses and content of states to
userland. As such its interface shouldn't be available without
enabling it consciously.
ok millert@, deraadt@
|
|
Only call bread_cluster if either the previously read ffs block is
adjacent to the current block or if the current read request exceeds the
current ffs block. This effectively turns off read-ahead for random reads
that fall within one ffs block.
okay beck@, mpi@, visa@
|
|
|
|
ok dlg@
|
|
TAILQ_CONCAT(3) apparently wasn't in-tree when this code was written.
Using it leaves us with less code *and* better performance.
ok tedu@
|
|
The audio_mixer_{read,write} names are misleading: these functions are
not the methods of the read and write syscalls. No object change.
|
|
On these machines we can't use the direct map since early on during boot
the direct map only covers the first 4GB of memory. Instead, use a
special (and temporary) mapping until we remap the framebuffer near the
start of autoconf. With lots of help from mlarkin@
tested by yasuoka@
ok mlarkin@
|
|
ok tedu@ krw@ deraadt@
|
|
ok tedu@ jsg@
|
|
ok tedu@ jsg@
|
|
|
|
|
|
some ok ratchov
|
|
ok jsg
|
|
ok tedu@ jsg@
|
|
ok tedu@ jsg@
|
|
this means tun doesn't queue the packet on input for the network
stack to process, it's pushed through as part of the write into the
kernel.
discussed at length with claudio@ who agrees that avoiding a queue,
and charging the writing process with the work associated with the
packet, are both reasonable (good) things to do.
|
|
this makes tun(4) more like tap(4). it now relies on the network
stack to set the rcvif, rdomain, count the packets, and lock
appropriately. right now it also means we consistently use if input
queues for both tun and tap, and return backpressure at the same
points.
the tun_input handler is then responsible for pulling the "link"
header off the packet and shoving it it into the various protocol
handlers as appropriate.
a consequence of having the stack count the bytes before tun_input
strips the header is ibytes now includes the 4 byte AF header.
however, this makes tun input consistent with the accounting on tun
output, which included those 4 bytes anyway.
|
|
this is instead of possibly allocating a change of mbufs and MCLBYTE
sized clusters, and doing uiomove in a loop.
while here add max_linkhdr space to the front of the allocated mbuf
to help if we're forwarding the frame out some other interface.
|
|
|
|
as long as we don't error when open/ioctl/read/write have IO_NDELAY
set, the fd (vfs?) layer seems to keep track of it fine for us.
|
|
tun and tap now queue a packet on output (for userland to read) on
the if send queue, and then directly call tun_wakeup to tell userland
about it. this bypasses calling the ifq serialiser machinery which
then calls tun_start, which then calls tun_wakeup.
|
|
there's no magical extra space for tap to carry a VLAN tag up to
userland, you need to put it in the packet, and it takes up space.
|
|
let tap use ether_output directly, and then cut back tun_output so
it does the same things that ether_output does. specifically, this
means tun_output now only prepends the packet with the "link" header,
and no longer runs BPF for outgoing packets. running BPF for tun
packets in output used to be needed because pipex used to get a
chance to steal the packet at this point, but you would still want
to see the packet in tcpdump output. now BPF is handled in tun_dev_read
for both tun and tap.
|
|
it works with future Linux device trees.
ok patrick@
|
|
|
|
|
|
All sleeps have been indefinite since introduction of this interface
~5 years ago, so remove the timeout argument and make indefinite sleeps
implicit.
While here: *sleep(9) -> *sleep_nsec(9)
"i don't think we're going to use timeouts [here]" tedu@, ok mpi@
|
|
ok jsg@, patrick@
|
|
in drivers. Terse one liners, NULLs instead of 0's, explicitly specify
all members, etc.
Nuke #ifdef notyet blocks related to the scsi_adapter in aic.
No intentional functional change.
ok tedu@
|
|
we can remove the XXX now.
|
|
|
|
|
|
ok patrick@
|
|
ok claudio@
|
|
temperature sensors.
ok patrick@
|
|
ok patrick@
|