summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2020-01-26In amdgpio_pin_intr() disable pins a pending interrupt is seen for whichJonathan Gray
have no interrupt handler registered. Avoids interrupt storm on Matebook D reported by brynet@ From James Hastings. ok kettenis@ brynet@
2020-01-25physio() just needs to check for b_bcount overflow. Let the providedKenneth R Westerback
minphys() function check for MAXPHYS. Feedback from tedu@ kettenis@ dlg@ ok cheloha@, robert@, jmatthew@ as part of larger diff
2020-01-25Drivers that implement their own *minphys() don't need to call theKenneth R Westerback
system minphys(). scsi_minphys() will do that and cd/sd/st will call scsi_minphys(). ok jmatthew@ as part of larger diff
2020-01-25Ensure scsi_minphys() is always called on the physio() path.Kenneth R Westerback
Will allow simplification of individual driver *minphys() functions. ok jmatthew@ as part of larger diff
2020-01-25Enable umt(4)Patrick Wildt
2020-01-25move the SMR_LIST_REMOVE and smr_barrier up in tun_clone_destroy.David Gwynne
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
2020-01-25tweaks sleeping for an mbuf so it's more mpsafe.David Gwynne
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.
2020-01-25use SMR rather than SRP to protect the device handle arrayJonathan Matthew
ok dlg@
2020-01-25use SMRs to find the right tun_softc on syscall entries.David Gwynne
2020-01-25rework the driver to better manage lifetimes and device lifetimes.David Gwynne
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@
2020-01-25The ELF NOTE parser would only inspect the first NOTE for 'OpenBSD'.Theo de Raadt
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
2020-01-24*sleep_nsec(9): log process name and pid when nsecs == 0cheloha
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@
2020-01-24Use major 32 for dt(4).Martin Pieuchot
ok visa@, kettenis@, deraadt@
2020-01-24New `kern.allowdt' button must be set to open(2) /dev/dt.Martin Pieuchot
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@
2020-01-24Improve small random read ffs performance:Kurt Miller
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@
2020-01-24no fields are protected by the kernel lock anymoreanton
2020-01-24add pf.h include for NPF > 0 use added in rev 1.71Jonathan Gray
ok dlg@
2020-01-24pool(9): replace custom TAILQ concatenation loops with TAILQ_CONCAT(3)cheloha
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@
2020-01-24Rename audio_mixer_{read,write} to audio_mixer_{get,set}.Alexandre Ratchov
The audio_mixer_{read,write} names are misleading: these functions are not the methods of the read and write syscalls. No object change.
2020-01-24Machines have started to appear that have the framebuffer at an address > 4GB.Mark Kettenis
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@
2020-01-24cleanup unused headers generated by configJonathan Gray
ok tedu@ krw@ deraadt@
2020-01-24mesh(4) is old world and only new world macppc hardware is supported.Kenneth R Westerback
ok tedu@ jsg@
2020-01-24mesh(4) is old world and only new world macppc hardware is supported.Kenneth R Westerback
ok tedu@ jsg@
2020-01-24ihidev(4): tsleep(9) -> tsleep_nsec(9); ok mpi@ jcs@cheloha
2020-01-24remove a notyet that remains more not than yet after 25 years. ok krwTed Unangst
2020-01-24remove some ifdef notyet code that doesn't seem to be moving forward...Ted Unangst
some ok ratchov
2020-01-24remove unreferenced ncr5380 driver filesTed Unangst
ok jsg
2020-01-24Double tap the actual Zaurus zombies.Kenneth R Westerback
ok tedu@ jsg@
2020-01-24Nuke references to zaurus zombies.Kenneth R Westerback
ok tedu@ jsg@
2020-01-24move to if_vinput() in tun_dev_write.David Gwynne
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.
2020-01-24provide a tun_input() interface input handler for tun(4) packets.David Gwynne
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.
2020-01-24change tun_dev_write to allocate one mbuf and cluster for the whole packet.David Gwynne
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.
2020-01-23simplify the uiomove loop in tun_dev_read.David Gwynne
2020-01-23don't need to manage TUN_NBIO ourselves, we get IO_NDELAY for free.David Gwynne
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.
2020-01-23provide a custom if_enqueue handler.David Gwynne
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.
2020-01-23remove IFCAP_VLAN_MTU from tap(4). it's a lie.David Gwynne
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.
2020-01-23unify the tun and tap output and read behaviour.David Gwynne
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.
2020-01-23Make thermal framework support in sxitemp(4) interrupt driven such thatMark Kettenis
it works with future Linux device trees. ok patrick@
2020-01-23mild whitespace massaging. no functional change.David Gwynne
2020-01-23don't prototype the cdev entrypoints, sys/conf.h already does it.David Gwynne
2020-01-23pool(9): pl_sleep(): drop unused timeout argumentcheloha
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@
2020-01-23Fix the mask that we applied when setting the voltage.Mark Kettenis
ok jsg@, patrick@
2020-01-23Use a consistant idiom/format when declaring scsi_adapter structuresKenneth R Westerback
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@
2020-01-23we've been using LBA48 for < 137GB drives for 17 years, so perhapsTed Unangst
we can remove the XXX now.
2020-01-23regenJonathan Gray
2020-01-23add ids for coffee lake and comet lake graphics with known marketing namesJonathan Gray
2020-01-23Hook sxisid(4) up to the nvmem "framework".Mark Kettenis
ok patrick@
2020-01-23remove PIPEX from tun(4) now that pppac(4) should be used instead.David Gwynne
ok claudio@
2020-01-23Use information from nvmem (provided by sxisid(4)) to calibrate theMark Kettenis
temperature sensors. ok patrick@
2020-01-23Add an interface to read an nvmem "cell".Mark Kettenis
ok patrick@