summaryrefslogtreecommitdiff
path: root/sys
AgeCommit message (Collapse)Author
2015-11-22For "disklabel", allow sysctl mach.chr2kblk and ioctl BIOCINQ/BIOCVOLTheo de Raadt
also, to satisfy midlayers that some fs/install tools need.
2015-11-22"getpw" should also allow access to /etc/netidTheo de Raadt
discovered by rpe
2015-11-22Remove drm_gem_object_alloc() and associated infrastructure. It's unused andMark Kettenis
has been removed upstream as well.
2015-11-22The "CRITICAL" APM battery level, that is exported/faked by the ACPIReyk Floeter
stack, is currently set to 25%. With 25% battery left, a typical modern laptop will have at least one hour runtime left. It is an arbitrary value, and other APM power layers in the kernel set CRITICAL to something like 5% or 10%, so set it to 10% for now. OK mlarkin@
2015-11-22fix uninitialised variable use in nep_rx_proc()Jonathan Gray
ok kettenis@
2015-11-21The drm irq stuff isn't actually used on OpenBSD. Using the PCI deviceMark Kettenis
interrupt line register as the irq number doesn't really work as the contents of that register might be 0, and the code has checks for non-zero irq numbers in places. Insteadmake drm_dev_to_irq() return -1, which is an obviously bogus, but non-zero value. This should fix inteldrm(4) on recent Apple hardware.
2015-11-21Make this work with 64-bit memory BARs such as those found on the newMark Kettenis
pcengines APU. ok deraadt@
2015-11-21Retire ml_requeue(9) and mq_requeue(9).Martin Pieuchot
As Kenjiro Cho pointed out it is very hard to cancel a dequeue operation for some queueing disciplines when such it keeps some internal states. As you can see, APIs can also Live Fast & Die Young. ok dlg@
2015-11-21Add a comment after every #endifMartin Pieuchot
requested by sashan@
2015-11-21Use if_get() rather than dereferencing rt_ifp directly.Martin Pieuchot
Inputs from and ok florian@, ok sthen@, visa@, sashan@
2015-11-21Use if_get() rather than dereferencing rt_ifp directly.Martin Pieuchot
ok sthen@, visa@, sashan@, florian@
2015-11-21Prevent disabling vmm mode if a VM is still running.Martin Pieuchot
Return EAGAIN in this case: # vmmctl -d vmmctl: disable VMM command failed (35) - Resource temporarily unavailable ok mlarkin@
2015-11-21Do not create a VM if vmm mode hasn't been enable.Martin Pieuchot
Currently one MUST do "vmmctl -e" before creating a vm with "vmm -S ...". Lately this could be done automagically by vmd(8) but the kernel should not allow things that wont fly. While here, disable vmm mode in error path if at least one of the CPUs failed to enable it. ok mlarkin@
2015-11-21Do not use boolean_t outside of /sys/uvmMartin Pieuchot
ok mlarkin@
2015-11-21dont check IFF_OACTIVE to see if the port is busy.David Gwynne
dont check if its busy at all, actually. fine with reyk@
2015-11-21remove completely pledge_socket() from listen(2) and accept(2).Sebastien Marie
with pledge_socket(p, -1, state) we only check for "dns" promise against SS_DNS socket. But it isn't possible to pass a SS_DNS socket to listen(2) or accept(2) (EINVAL). So this deeper check is a bit useless... ok deraadt@
2015-11-21Add V4L2_FMT_FLAG_EMULATEDIngo Feinerer
2015-11-21Drop sysctl leftovers.Visa Hankala
2015-11-21simplify ifq_deq_rollback by only having it unlock.David Gwynne
hfsc needed a rollback ifqop to requeue the mbuf because it used ml_dequeue in the begin op. now it uses MBUF_LIST_FIRST to get a ref to the first mbuf in deq_begin. now the disciplines dont need a rollback op, so ifq_deq_rollback can be simplified to just releasing the mutex. based on a discussion with kenjiro cho
2015-11-21error: too many arguments to function 'ifq_deq_begin'David Gwynne
found by deraadt@
2015-11-21provide MBUF_LIST_FIRST and MBUF_LIST_NEXT for iterating over an mbuf_list.David Gwynne
MBUF_LIST_FOREACH is then rewritten on top of those. this makes it easier to get at the head of a list too, which may make the hfsc ifq backend nicer. based on a discussion with kenjiro cho ok mpi@
2015-11-20Neuter the pledge domain checking for listen, getpeername, and getsocknameTheo de Raadt
also. The idea is much like rpath is with files, you get an fd and then you can play with it somewhat. In the socket space once you have a fd, you can play with it somewhat. So you cannot bind, but you can accept. You can listen, getpeername, getsockname, and of course set/getsockopt is somewhat available.. yes, this makes pledge the anti-capsicum, kind of like salt from Secovlje.. reasoning due to a conversation with tedu
2015-11-20Permit msync(2) in the "stdio" set; only a few programs use it relatedTheo de Raadt
to mmap, but thinking about it nothing feels risky Long discussions with florian
2015-11-20Add pledge "disklabel", which allows sysctl kern.rawpartition, aTheo de Raadt
few disklabel ioctls, and the DIOCMAP ioctl against /dev/diskmap used to translate duid numbers into partitions. This will allow pledging of at least 12 disk/filesystem aware programs; due to the negative impact that diff will wait a bit so everyone has a chance to update their kernels. ok semarie
2015-11-20Make cnmac compile again after IF_DROP() removal. Just bail out if theVisa Hankala
link is down. ok mpi@
2015-11-20Missed in previous, pointed by benoit@Martin Pieuchot
2015-11-20Initialise the ifidx to 0 (no interface) in rtredirect() to avoid usingJonathan Gray
ifidx uninitialised for the gateway not directly reachable case. ok mpi@
2015-11-20Revert all the changes to run the tx completion path wihtout holding theMartin Pieuchot
KERNE_LOCK. A piece is still not right as many peole reported a "watchdog timeout" problem. This basically brings us back to r1.305. ok dlg@, jmatthew@
2015-11-20Check for space on the ring before dequeuing packets.Martin Pieuchot
Allows us to get rid of mq_requeue(9) and IFQ_POLL(9) because wireless drivers use a special queue for management frames. Tested by stsp@, ok dlg@, stsp@
2015-11-20Keep if_ref() private, if_get() is what you want to use before if_put().Martin Pieuchot
The thread detaching an interface will sleep until all references to this interface have been released. So we decided to only keep references for a short period of time. Keeping if_ref() private will hopefully help preserve this goal as long as it makes sense. Calling if_get()/if_put() in the same function also allows us to make use of static analysis tools (thanks jsg@!) to catch our errors. ok dlg@
2015-11-20Prefer if_get() over if_ref() when checking if the interface has beenMartin Pieuchot
destroyed during our sleep. No objection from the slackers.
2015-11-20sppp(4) is now only used for pppoe(4) which doesn't use framing, so removeStuart Henderson
support for sppp with framing, simplifying things. Remove unused ifdefs while there. "sppp will go away before it gets used for something else" dlg@
2015-11-20avoid a use after enqueue, which is like a use after free.David Gwynne
once you enqueue an mbuf, you no longer own it. therefore you cant read the length out of it. this reads the length first, then tries to enq it. also, call if_start instead of a bare call to the underlying start routine. ok mpi@ sthen@
2015-11-20i made a mistake. rename ifq_enq and ifq_deq to ifq_enqueue and ifq_dequeueDavid Gwynne
fixing it now before i regret it more.
2015-11-20This no longer depends on bridge.h, fewer "#ifdef NBRIDGE", say yeah!Martin Pieuchot
2015-11-20Fewer uses of rt_ifp.Martin Pieuchot
Tested by and ok sthen@,
2015-11-20Make use if_get() and get rid of rt_ifp.Martin Pieuchot
Tested by and ok sthen@, ok visa@
2015-11-20Make use if_get() and get rid of rt_ifp.Martin Pieuchot
While here keep carp(4) bits under NCARP. Tested by and ok sthen@, ok visa@
2015-11-20fix prio KASSERT, it should be <= not <. ok dlg@Stuart Henderson
2015-11-20Exempt accept(2) from the pledge_socket() check part of the "domain"Theo de Raadt
check. You cannot open a socket in a domain unless permitted -- but you need to be able to accept one if the code flow asks for that to happen. The most recent check is too tight. We may need to iterate the policy here until we hit the right vibe...
2015-11-20VISTTY check in revoke() is not working well for the non-indirectedTheo de Raadt
/dev/console case, so go back to doing the direct D_TTY check. signed over a few times with guenther
2015-11-20Fix whitespace. No binary change.Jonathan Gray
2015-11-20correctly indent a line to make the intent clearJonathan Gray
ok dlg@
2015-11-20dont needlessly clear IFF_OACTIVE.David Gwynne
only a driver sets or clears OACTIVE. clearing it without setting it is a waste of time.
2015-11-20dont play with IFF_OACTIVE needlessly.David Gwynne
only a driver sets or clears it, and trunk never sets it. therefore it never needs to clear it.
2015-11-20dont check for IFF_OACTIVEDavid Gwynne
only a driver sets or clears this flag. pppx never sets it, so it will never be set when it checks it.
2015-11-20dont check for OACTIVEDavid Gwynne
only a driver sets or clears this flag. gif never sets it, so it wont be set when it checks it.
2015-11-20if we deq m0, we should probably send it to bpf, not m.David Gwynne
found by and ok jsg@
2015-11-20shuffle struct ifqueue so in flight mbufs are protected by a mutex.David Gwynne
the code is refactored so the IFQ macros call newly implemented ifq functions. the ifq code is split so each discipline (priq and hfsc in our case) is an opaque set of operations that the common ifq code can call. the common code does the locking, accounting (ifq_len manipulation), and freeing of the mbuf if the disciplines enqueue function rejects it. theyre kind of like bufqs in the block layer with their fifo and nscan disciplines. the new api also supports atomic switching of disciplines at runtime. the hfsc setup in pf_ioctl.c has been tweaked to build a complete hfsc_if structure which it attaches to the send queue in a single operation, rather than attaching to the interface up front and building up a list of queues. the send queue is now mutexed, which raises the expectation that packets can be enqueued or purged on one cpu while another cpu is dequeueing them in a driver for transmission. a lot of drivers use IFQ_POLL to peek at an mbuf and attempt to fit it on the ring before committing to it with a later IFQ_DEQUEUE operation. if the mbuf gets freed in between the POLL and DEQUEUE operations, fireworks will ensue. to avoid this, the ifq api introduces ifq_deq_begin, ifq_deq_rollback, and ifq_deq_commit. ifq_deq_begin allows a driver to take the ifq mutex and get a reference to the mbuf they wish to try and tx. if there's space, they can ifq_deq_commit it to remove the mbuf and release the mutex. if there's no space, ifq_deq_rollback simply releases the mutex. this api was developed to make updating the drivers using IFQ_POLL easy, instead of having to do significant semantic changes to avoid POLL that we cannot test on all the hardware. the common code has been tested pretty hard, and all the driver modifications are straightforward except for de(4). if that breaks it can be dealt with later. ok mpi@ jmatthew@
2015-11-19The CIRCLEQ_* macros have been deprecated and removed from queue.3Todd C. Miller
over a year ago. It's now time to remove them from queue.h. OK krw@ guenther@ deraadt@