| Age | Commit message (Collapse) | Author |
|
This way pmap.h only contains the MD definition of the MI pmap(9)
API, which loads of things in the kernel rely on, so changing x86
pmap internals no longer requires recompiling the entire kernel every
time.
Callers needing these internals must now use machine/pmap_private.h.
Note: This is not x86/pmap_private.h because it contains three parts:
1. CPU-specific (different for i386/amd64) definitions used by...
2. common definitions, including Xenisms like xpmap_ptetomach,
further used by...
3. more CPU-specific inlines for pmap_pte_* operations
So {amd64,i386}/pmap_private.h defines 1, includes x86/pmap_private.h
for 2, and then defines 3. Maybe we should split that out into a new
pmap_pte.h to reduce this trouble.
No functional change intended, other than that some .c files must
include machine/pmap_private.h when previously uvm/uvm_pmap.h
polluted the namespace with pmap internals.
Note: This migrates part of i386/pmap.h into i386/vmparam.h --
specifically the parts that are needed for several constants defined
in vmparam.h:
VM_MAXUSER_ADDRESS
VM_MAX_ADDRESS
VM_MAX_KERNEL_ADDRESS
VM_MIN_KERNEL_ADDRESS
Since i386 needs PDP_SIZE in vmparam.h, I added it there on amd64
too, just to keep things parallel.
|
|
|
|
"IFQ_POLL() -> IFQ_DEQUEUE() on success".
(This one was an even worse anti-pattern than the others!)
|
|
"IF_POLL() -> IF_DEQUEUE() on success".
|
|
"IF_POLL() -> IF_DEQUEUE() on success".
|
|
|
|
|
|
Replaces ifp->if_flags & IFF_PROMISC in multicast filter updates.
|
|
No functional change intended.
|
|
Bringing the interface up or down is serialized by IFNET_LOCK, and we
prevent further mii callbacks with mii_down, so there's no need for
another lock to serialize uno_init, uno_stop, and the mii callbacks.
|
|
|
|
|
|
The one driver that uses it, cue(4), uses it just for statistics
gathering; hard to imagine that order could be important here. But
this will allow for some simplification of the surrounding code.
|
|
This is only allowed to be called via the uno_statchg callback, which
in turn is called only with the core lock held. (usbnet_set_link is
also called internally in usbnet(9) with the core lock held.)
|
|
In practical terms this could be done with one variable and an atomic
store, but serializing all access with a lock makes reasoning easier,
and the locks have to be taken by the logic that queries the
variables anyway, and the variables are set only under heavy-weight
configuration changes anyway.
What this accomplishes is disentangling lock order between rxlock and
txlock: they are never taken at the same time, so no order is needed.
I renamed unp_stopping to unp_stopped for a compiler-assisted audit
to make sure I reviewed every case of it.
|
|
This access was unprotected by a lock, but it's not necessary anyway:
usbnet_stop aborts the pipes, and the xfer doesn't call usbd_transfer
to reschedule itself -- it's an intr pipe, so it's rescheduled
internally by usbdi(9) in a way that usbd_abort_pipe atomically
prevents.
|
|
un->un_intr can't change after attach, and we don't open the pipe if
it's null. So no need to test it.
|
|
Not sure why I thought otherwise.
|
|
We are called without IFNET_LOCK held here, so touching ifp->if_flags
is forbidden, but that's the first thing ether_mediachange does.
XXX not right either, need to eliminate the check from
ether_mediachange
|
|
Also sort.
|
|
We killed this back in 2013, but it came back from the dead on a
driver imported from OpenBSD.
|
|
|
|
|
|
This is important for callers in if_stop routines to guarantee that
all concurrent access to the mii registers has ended.
Drivers must not call this from softint context. Drivers with custom
watchdog timers (not if_watchdog) that do if_stop from callout must
defer to thread context instead, e.g. via workqueue(9) -- as they
should be doing anyway for heavyweight operations like if_stop.
|
|
|
|
and TSC calibration if the boot is delayed for more than ~430 seconds (or
less, depending on HPET frequency). The result is a badly misconfigured
timecounter.
Change the measurement interval to ~1e6 HPET ticks (<100ms) during
the calibration to avoid the overflow. This introduces an error of
1ppm, compared to the previous unspecified but typical error of 0.1ppm.
But this is still much less than the guaranteed maximum frequency drift
of the HPET counter itself, which is 500ppm.
|
|
|
|
really)
|
|
Spotted by Taylor.
|
|
Maybe this should just be unconditional and outside the lock to make
it simpler.
Found by code inspection. Maybe someone should test uhci suspend
resume...
|
|
While here, use inline, not __inline__, since this is not a header
file where inline might be redefined by the user.
|
|
|
|
|
|
|
|
Otherwise mii_phy_detach may return while mii_phy_auto_timeout_locked
is still in progress in another thread.
Reuse the storage for mii_nway_ch, which is unused if MIIF_AUTOTSLEEP
is set, for a new condvar in a union. This doesn't change the kernel
ABI because sizeof(struct kcondvar) <= sizeof(struct callout) and
both have the same alignment, for an array of void *.
|
|
|
|
|
|
|
|
|
|
This change reduces the amount of work done in the interrupt handler.
|
|
This started out as a fix so that LOCKDEBUG wouldn't explode with kernel
lock spinout. LOCKDEBUG is too aggressive now and really should be
relaxed.
|
|
|
|
When the range of ring entries wraps around sync from the start of the
ring to the last entry.
|
|
In the event that a BAR write is ignored, no need to notify the callback
of any changes.
|
|
|
|
|
|
|
|
|
|
- Allocate the usrbuf from kmem(9) instead of uvm(9). The usrbuf has used
uvm(9), in case mmap(2) might be issued later. However, despite the most
apps don't use mmap(2), allocating (and reallocating) uvm(9) every time
would be expensive. In addition, uvm(9) for recording usrbuf was totally
pointless now.
- For playback, the usrbuf memory will be allocated in pages. Because the
usrbuf for playback is mostly near 64KB for backward compatibility.
This will reduce reallocation especially from the initial ulaw to the most
commonly used format like slinear16/2ch/48kHz.
- When mmap(2) is called, it will replace the playback usrbuf from kmem(9) to
uvm(9).
- Prohibit changing playback format once mmap(2) is called.
It follows netbsd-7.
- For recording, the usrbuf memory will be allocated in the requested size
every time as before. Because the usrbuf for recording is only one block
and is enough small to the page in the most case.
Inspired by PR kern/56947.
|
|
Reported-by: syzbot+f2cba71b1b1bc91029b3@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=7a01863d0fe34a4946516388c436991ba2beaa63
|