Age | Commit message (Collapse) | Author |
|
|
|
OK dlg@
|
|
tun_dev_open and tun_dev_close were being optmistic.
|
|
it only works on struct ifnet data, so passing ifp makes it clearer
what's actually being manipulated. also fix tun_dev_open so
tun_link_state is called before if_put instead of immediately after.
|
|
ok deraadt@ guenther@
|
|
posix requires a byte to be 8 bits
|
|
in sleep_resume(), which seems sensible for other future systems also
|
|
steps, so shuffle the MD steps to reinforce the order.
|
|
inst_trap_return() was checking for rfir by masking with 0xfc001fc0
which made it impossible to match rfir (0xca0)
rfi: return from interruption
00 rv rv rv 60 0
6 5 5 3 8 5
rfir: return from interruption and restore
00 rv rv rv 65 0
6 5 5 3 8 5
from "PA-RISC 1.1 Architecture and Instruction Set Reference Manual"
where rv indicates reserved bits
change the mask to only mask out reserved bits and check for rfi
in addition to rfir
ok miod@
|
|
accidentally broken with the reorganization of the suspend/resume code that
was committed a few days ago.
ok deraadt@
|
|
ok miod@
|
|
ok claudio@ deraadt@
|
|
This is an updated version of uvm_map.c r1.283 "Unwire with map lock held".
The previous version introduced a use-after-free by not unlocking vm_map
locks in uvm_map_teardown(), resulting in dangling references on the
reaper's lock list (thanks visa!).
Lock and unlock the map in around uvm_map_teardown() instead.
This code path holds the last reference, hence the lock isn't strictly
needed except for satisfying upcoming locking assertions.
Tested on amd64, arm64, i386, macppc, octeon, sparc64.
This time also with WITNESS enabled (except on sparc64 which builds but does
not boot with WITNESS; this is a known issue).
OK mpi visa
|
|
|
|
Ok deraadt
|
|
match the device.
ok visa@
|
|
ok visa@
|
|
This prevents errors on luna88k in src/usr.sbin/fw_update/pattern.c
which includes dev/pci/pcivar.h, which includes machine/bus.h.
Suggested by miod@
|
|
spotted by and ok tb@, ok tobhe@
|
|
from cursig() to postsig() or the caller itself. This will simplify locking.
Also alter sigactsfree() a bit and move it into process_zap() so ps_sigacts
is always a valid pointer.
OK semarie@
|
|
|
|
adapted from a diff by Ted Bullock
|
|
|
|
from Ted Bullock who tested on sparc64 with xvr-100
|
|
previously sbchecklowmem() (and sonewconn()) would look at the mbuf
and mbuf cluster pools to see if they were approaching their hard
limits. based on how many mbufs/clusters were allocated against the
limits, socket operations would start to fail with ENOBUFS until
utilisation went down.
mbufs and clusters have changed a lot since then though. there are
now many mbuf cluster pools, not just one for 2k clusters. because
of this the mbuf layer now limits the amount of memory all the mbuf
pools can allocate backend pages from rather than limit the individual
pools. this means sbchecklowmem() ends up looking at the default
pool hard limit, which is UINT_MAX, which in turn means means
sbchecklowmem() probably never applies backpressure. this is made
worse on multiprocessor systems where per cpu caches of mbuf and
cluster pool items are enabled because the number of in use pool
items is distorted by the cpu caches.
this switches sbchecklowmem to looking at the page allocations made
by all the pools instead. the big benefit of this is that the page
allocations are much more representative of the overall mbuf memory
usage in the system. the downside is is that the backend page
allocation accounting does not see idle memory held by pools. pools
cannot release partially free pages to the page backend (obviously),
and pools cache idle items to avoid thrashing on the backend page
allocator. this means the page allocation level is higher than the
memory used by actual in-flight mbufs.
however, this can also be a benefit. the backend page allocation is a
kind of smoothed out "trend" line. mbuf utilisation over short periods
can be extremely bursty because of things like rx ring dequeue and fill
cycles, or large socket sends. if you're trying to grow socket
buffers while these things are happening, luck becomes an important
factor in whether it will work or not. because pools cache idle items,
the backend page utilisation better represents the overall trend
of activity in the system and will give more consistent behaviour here.
this diff is deliberately simple. we're basically going from "no
limits" to "some sort of limit" for sockets again, so keeping the
code simple means it should be easy to understand and tweak in the
future.
ok djm@ visa@ claudio@
|
|
from Ted Bullock
|
|
ok deraadt@ gnezdo@
|
|
ok kettenis@
|
|
and then rounded before checking. Put the same check before the
calculations to avoid overflow.
Reported-by: syzbot+6f29d23eca959c5a9705@syzkaller.appspotmail.com
OK claudio@
|
|
|
|
in the device tree -1 is returned, causing a panic in the following malloc
call.
ok kn@ patrick@ kettenis@
|
|
ok kettenis
|
|
the interrupt controller, the second method used implementation-specific
CPU registers. The M1 Pro/Max SoCs use a modified interrupt controller
that no longer provides the first method. So switch to the second method
in preparation for adding M1 Pro/Max support to OpenBSD. As a bonus this
mechanism seems to be faster (which may be why Apple calls these "fast"
IPIs).
ok patrick@
|
|
|
|
These new functions, knote_modify() and knote_process(), implement
the logic that is common to most f_modify and f_process instances.
The code is inlined so as to not add yet another call frame on the
already towering stack of kqueue functions. Also, the _fn versions
allow direct calling of an event function when there is only one
filter type to handle.
|
|
This avoids verb overlap with f_modify.
|
|
(most notably the WiFi chip). This is done through a GPIO controlled by
the SMC. Add support for this and make sure we wait for the 100ms required
by the PCIe standard when we use that GPIO to turn on power. This makes sure
these devices are available even if U-Boot doesn't turn them on for us.
ok patrick@
|
|
ok patrick@
|
|
|
|
|
|
|
|
|
|
Use the f_event callback for checking event state within the pipe
event filters. This enables the same f_modify and f_process functions
to handle the different filter types.
OK anton@
|
|
From Alf Schlichting
|
|
WITNESS builds broke^W^Wkernels panic on boot as reported by anton and bluhm.
Booting bsd.mp in single-user mode inside VMM shows:
root on sd0a (5f9e458ed30b39ab.a) swap on sd0b dump on sd0b
Enter pathname of shell or RETURN for sh:
witness: lock order reversal:
1st 0xfffffd801f8ce468 vmmaplk (&map->lock)
2nd 0xfffffd801b8162c0 inode (&ip->i_lock)
lock order "&ip->i_lock"(rrwlock) -> "&map->lock"(rwlock) first seen at:
#0 rw_enter_read+0x38
#1 uvmfault_lookup+0x8a
#2 uvm_fault_check+0x32
#3 uvm_fault+0xfb
#4 kpageflttrap+0x12c
#5 kerntrap+0x91
#6 alltraps_kern_meltdown+0x7b
#7 copyout+0x53
#8 ffs_read+0x1f6
#9 VOP_READ+0x41
#10 vn_rdwr+0xa1
#11 vmcmd_map_readvn+0xa0
#12 exec_process_vmcmds+0x88
#13 sys_execve+0x732
#14 start_init+0x26f
#15 proc_trampoline+0x1c
lock order data w1 -> w2 missing
# exit
kernel: protection fault trap, code=0
Stopped at witness_checkorder+0x312: movl 0x10(%r14),%ecx
gkoehler reported faults on poisened addresses on macppc dual G5.
|
|
WITNESS builds broke as reported by anton and bluhm:
root on sd0a (5ec49b3ad23eb2d4.a) swap on sd0b dump on sd0b
kernel: protection fault trap, code=0
Stopped at witness_checkorder+0x4ec: movl 0x10(%r12),%ecx
https://syzkaller.appspot.com/bug?id=be02b290a93c648986c35370a271aad4135a5044
https://syzkaller.appspot.com/text?tag=CrashLog&x=136e9aa4700000
|
|
OK mpi@
|
|
All callers of KNOTE() supply a non-NULL klist argument. Replace the
NULL pointer check with klist emptiness check as a small optimization.
OK mpi@
|
|
OK mpi@
|
|
need to do this can do it a few moments later in a different hook
|