Link [ NetBSD | NetBSD OpenGrok source search | PR fulltext-search | Summary of daily snapshot builds | history of daily build result | pkgsrc commit viewer ]


   
        usage: [branch:branch] [user:user] [path@revision] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN sys/arch/arm, if_wm.c@1.234 )




switch to index mode

recent branches: MAIN (3m)  netbsd-8 (6d)  netbsd-10 (6d)  netbsd-9 (12d)  thorpej-ifq (176d)  thorpej-altq-separation (178d) 

2024-05-10 20:11:46 UTC Now

2022-03-07 07:07:55 UTC MAIN commitmail json YAML

enter the bind plugins library dir, and also add missing set lists.

fixes building sets for at least vax.

(mrg)

2022-03-07 04:06:20 UTC MAIN commitmail json YAML

Don't change ifp->if_link_state directly.  Pointed out by yamaguchi@n.o.

(knakahara)

2022-03-06 23:36:50 UTC MAIN commitmail json YAML

s/filered/filtered/ in comment.

(andvar)

2022-03-06 23:36:01 UTC MAIN commitmail json YAML

s/sarch/search/ in commented part.

(andvar)

2022-03-06 18:35:43 UTC MAIN commitmail json YAML

pass errno through switch to protected mode.

(mlelstv)

2022-03-06 17:54:53 UTC MAIN commitmail json YAML

2022-03-06 17:51:42 UTC MAIN commitmail json YAML

add named plugins directory.

(christos)

2022-03-06 17:50:19 UTC MAIN commitmail json YAML

2022-03-06 09:03:42 UTC MAIN commitmail json YAML

usb(4): Use atomics for usb_async_proc.

This is written under proc_lock and read without it in usb_add_event,
so using atomics pacifies the sanitizer.  No memory ordering needed
because the value isn't actually used until the softint runs, using
it under proc_lock.  Kind of a micro-optimization, but let's avoid
contention on proc_lock in the common case of no usb_async_proc set
up (why is this a system global, anyway? and why is there a softint
if usb_add_event always runs at IPL_NONE?).

Reported-by: syzbot+1b2fa68535e5b0f3dcaa@syzkaller.appspotmail.com

(riastradh)

2022-03-06 08:31:54 UTC MAIN commitmail json YAML

2022-03-05 16:53:24 UTC MAIN commitmail json YAML

Slight comment improvement.

(skrll)

2022-03-05 08:53:58 UTC MAIN commitmail json YAML

expat 2.4.7, another security fix release, out

(wiz)

2022-03-05 06:55:58 UTC MAIN commitmail json YAML

usbnet(9): Clarify uno_stop contract in man page.

(riastradh)

2022-03-05 06:55:49 UTC MAIN commitmail json YAML

usbnet(9): uno_init is now optional.

Update assertion and man page accordingly.

(riastradh)

2022-03-04 23:17:16 UTC MAIN commitmail json YAML

2022-03-04 21:12:04 UTC MAIN commitmail json YAML

2022-03-04 08:19:07 UTC MAIN commitmail json YAML

2022-03-04 08:11:48 UTC MAIN commitmail json YAML

Rmmove an incorrect KASSERT.

(skrll)

2022-03-04 05:56:55 UTC MAIN commitmail json YAML

fix calculation for start of off-screen memory in 24bit colour

(macallan)

2022-03-03 21:03:14 UTC MAIN commitmail json YAML

Fix for PR kern/56613

* For trackpads that report max and min coordinates, retrieve these and
  use them as the boundaries instead of the hard coded limits.
* Drop packets that are have x/y values that are outside the limits of
  the trackpad.  Some trackpads report a stream of low values in some
  situations that cause cursor jumping.

(blymn)

2022-03-03 20:20:23 UTC MAIN commitmail json YAML

tests/make: add more comprehensive tests for ':M' and ':N'

(rillig)

2022-03-03 20:03:19 UTC MAIN commitmail json YAML

tests/make: test variant without filemon

(rillig)

2022-03-03 19:55:27 UTC MAIN commitmail json YAML

make: improve comments and a parameter name

No binary change.

(rillig)

2022-03-03 19:52:41 UTC MAIN commitmail json YAML

make: simplify ParseModifier_Match

No functional change.

(rillig)

2022-03-03 19:50:01 UTC MAIN commitmail json YAML

make: make code for string matching syntactically more consistent

No functional change.

(rillig)

2022-03-03 19:46:31 UTC MAIN commitmail json YAML

make: improve comments about parsing and evaluating conditions

No binary change.

(rillig)

2022-03-03 19:40:54 UTC MAIN commitmail json YAML

make: improve local variable name in ParseWord in conditions

That function not only parses function arguments but also bare words, so
the name argBuf didn't match anymore.

No binary change.

(rillig)

2022-03-03 19:36:35 UTC MAIN commitmail json YAML

2022-03-03 07:31:24 UTC MAIN commitmail json YAML

Welcome to NetBSD 9.99.94!

- usbnet(9) overhaul.
- USB host controller interface API and ABI simplifications.
- usbdi(9) additions -- usbd_suspend_pipe, usbd_resume_pipe.
- video(9) change -- video_attach_mi takes explicit cookie argument.
- driver(9) addition -- device_set_private, in preparation for opaque
  struct device.

While here, fix typo noted by pgoyette@ -- `privilege', not
`priviledge'.

(riastradh)

2022-03-03 06:28:26 UTC MAIN commitmail json YAML

2022-03-03 06:28:04 UTC MAIN commitmail json YAML

powerpc: Use device_set_private for e500 cpuN.

(riastradh)

2022-03-03 06:27:41 UTC MAIN commitmail json YAML

mips: Carefully use device_set_private for cpuN.

But don't do it in cpu_attach_common because the callers aren't set
up right -- instead leave a comment about what's wrong, to be dealt
with later.

(riastradh)

2022-03-03 06:27:21 UTC MAIN commitmail json YAML

2022-03-03 06:27:03 UTC MAIN commitmail json YAML

2022-03-03 06:26:29 UTC MAIN commitmail json YAML

2022-03-03 06:26:14 UTC MAIN commitmail json YAML

arc: Use device_set_private for cpuN.

(riastradh)

2022-03-03 06:26:06 UTC MAIN commitmail json YAML

arm: Use device_set_private for cpuN.

For cpu at fdt, nix the fdt softc -- this was leaked and never used
for anything.  The device's private storage is the cpu_info.

(riastradh)

2022-03-03 06:25:46 UTC MAIN commitmail json YAML

driver(9): New device_set_private.

Used to initialize a device_t's private pointer at most once.  Only
for drivers with zero cfattach size so autoconf doesn't preallocate;
KASSERT checks for this mistake.

(riastradh)

2022-03-03 06:23:25 UTC MAIN commitmail json YAML

video(9): Make softc argument mandatory for video_attach_mi.

No separate video_attach_mi_softc function any more.

(riastradh)

2022-03-03 06:22:53 UTC MAIN commitmail json YAML

uvideo(4): Attach one video(4) per independent stream.

(riastradh)

2022-03-03 06:22:40 UTC MAIN commitmail json YAML

uvideo(4): Fix zero initialization of uvideo_stream.

Just use kmem_zalloc; don't memset it to zero, especially not after
we just inserted it into the list, with the side effect of deleting
the rest of the list!

(riastradh)

2022-03-03 06:22:23 UTC MAIN commitmail json YAML

video(4): Allow drivers to pass the softc explicitly.

This way one device driver can have multiple video0, video1, &c.,
interfaces attached, using independent state and a common parent.

(riastradh)

2022-03-03 06:22:03 UTC MAIN commitmail json YAML

uvideo(4): Sprinkle debug messages.

(riastradh)

2022-03-03 06:21:50 UTC MAIN commitmail json YAML

uvideo(4): Use __nothing for empty DPRINTF, not actually empty.

(riastradh)

2022-03-03 06:13:35 UTC MAIN commitmail json YAML

usbdi(9): Suspend control pipe on detach.

The device is gone so control transfers won't complete anyway.  This
obviates the need to wait for usbd_do_request to time out.

Seems like maybe we should make _all_ xfers fail with USBD_CANCELLED
when the device is detached, but there's no list of pipes we can just
walk down to suspend them, so we'd have to find another way to do so.
For now, we'll just keep having drivers suspend/abort pipes other
than the control pipe.

(riastradh)

2022-03-03 06:13:23 UTC MAIN commitmail json YAML

usbdi(9): dtrace probes for USB control requests.

(riastradh)

2022-03-03 06:12:49 UTC MAIN commitmail json YAML

usb: Assert hci doesn't synchronously complete async xfers.

The xfer callback must not be invoked synchronously, because it might
need to take a lock that the caller holds.

However, the hci might return failure to the caller, meaning the xfer
callback will not be invoked at all.

(riastradh)

2022-03-03 06:12:11 UTC MAIN commitmail json YAML

2022-03-03 06:09:57 UTC MAIN commitmail json YAML

usb: In usbd_transfer, test whether aborting under the lock.

Otherwise this test is racy and can cause the bad state of a pipe
with a transfer that will never be completed in a pipe that's about
to close under the expectation that the pipe is empty.

(riastradh)

2022-03-03 06:09:44 UTC MAIN commitmail json YAML

usb: Inline usb_insert_transfer.

This makes it clearer which part happens irrespective of error
(putting it on the queue -- unconditional, not rolled back by
usb_insert_transfer) and what the possible `errors' mean (neither of
which is an error, per se).

(riastradh)

2022-03-03 06:09:33 UTC MAIN commitmail json YAML

usbdi(9): New usbd_suspend_pipe, usbd_resume_pipe.

- New usbd_suspend_pipe to persistently stop transfers on a pipe and
  cancel pending ones or wait for their callbacks to finish.
  Idempotent.

- New usbd_resume_pipe to allow transfers again.  Idempotent, but no
  new xfers may be submitted before repeating this.

  This way it is safe to usbd_abort_pipe in two threads concurrently,
  e.g. if one thread is closing a device while another is revoking it
  -- but the threads have to agree on when it is done being aborted
  before starting to use it again.

- Existing usbd_abort_pipe now does suspend then resume.  No change
  in semantics so drivers that relied on being able to submit
  transfers again won't be broken any worse than the already are
  broken.

This allows drivers to avoid races such as:

/* read */
if (sc->sc_dying)
return ENXIO;
/* (*) */
err = usbd_bulk_transfer(...);

/* detach or or close */
sc->sc_dying = true;
usbd_abort_pipe(...);
wait_for_io_to_drain(...);

The detach or close logic might happen at the same time as (*), with
no way to stop the bulk transfer before it starts, leading to
deadlock when detach/close waits for I/O operations like read to
drain.  Instead, the close routine can use usbd_suspend_pipe, and the
usbd_bulk_transfer is guaranteed to fail.

But some drivers such as ucom(4) don't close and reopen pipes after
aborting them -- they open on attach and close on detach, and just
abort when the /dev node is closed, expecting that xfers will
continue to work when next opened.  These drivers can instead use
usbd_suspend_pipe on close and usbd_resume_pipe on open.  Perhaps it
would be better to make them open pipes on open and close pipes on
close, but these functions make for a less intrusive transition.

(riastradh)

2022-03-03 06:09:20 UTC MAIN commitmail json YAML

usb: Update tables of bus/pipe method locking rules.

No functional change.

(riastradh)

2022-03-03 06:09:11 UTC MAIN commitmail json YAML

usb: Add missing includes in usb_mem.h.

(riastradh)

2022-03-03 06:09:03 UTC MAIN commitmail json YAML

xhci(4): Add missing includes to xhcivar.h.

(riastradh)

2022-03-03 06:08:50 UTC MAIN commitmail json YAML

2022-03-03 06:07:11 UTC MAIN commitmail json YAML

usb: usbd_free_xfer never fails.  Make it return void.

(riastradh)

2022-03-03 06:06:52 UTC MAIN commitmail json YAML

2022-03-03 06:05:38 UTC MAIN commitmail json YAML

2022-03-03 06:04:31 UTC MAIN commitmail json YAML

usb: Factor usb_insert_transfer out of upm_transfer and make private.

Almost every upm_transfer function starts with:

mutex_enter(&sc->sc_lock);
err = usb_insert_transfer(xfer);
mutex_exit(&sc->sc_lock);
if (err)
return err;

Some of them have debug messages sprinkled in here too, or assert
that err == USBD_NORMAL_COMPLETION (alternative is USBD_IN_PROGRESS,
only for pipes with up_running or up_serialise, presumably not
applicable for these types of pipes).  Some of them also assert
xfer->ux_status == USBD_NOT_STARTED, which is guaranteed on entry and
preserved by usb_insert_transer.

Exceptions:

- arch/mips/adm5120/dev/ahci.c ahci_device_isoc_transfer just returns
  USBD_NORMAL_COMPLETION, but I'm pretty sure this is and always has
  been broken anyway, so won't make anything worse (if anything, might
  make it better...)

- external/bsd/dwc2/dwc2.c dwc2_device_bulk_transfer and
  dwc2_device_isoc_transfer _also_ issue dwc2_device_start(xfer)
  under the lock.  This is probably a better way to do it, but let's
  do it uniformly across all HCIs at once.

- rump/dev/lib/libugenhc/ugenhc.c rumpusb_device_bulk_transfer
  sometimes returns USBD_IN_PROGRESS _without_ queueing the transfer,
  in the !rump_threads case.  Not really sure how this is supposed to
  work...  If it actually breaks anything, we can figure it out.

(riastradh)

2022-03-03 05:57:05 UTC MAIN commitmail json YAML

usbnet(9): Update man page.

(riastradh)

2022-03-03 05:56:58 UTC MAIN commitmail json YAML

urndis(4): Simplify circuitous initialization logic.

(riastradh)

2022-03-03 05:56:51 UTC MAIN commitmail json YAML

usbnet: Update some comments.

(riastradh)

2022-03-03 05:56:44 UTC MAIN commitmail json YAML

usbnet: On if_stop, abort xfers before resetting hardware.

uno_stop is supposed to have exclusive access to the hardware; this
ensures that any concurrent uno_rx_loop has completed before we enter
uno_stop.

(riastradh)

2022-03-03 05:56:36 UTC MAIN commitmail json YAML

usbnet: Fix type of struct usbnet::un_ed according to plan.

(riastradh)

2022-03-03 05:56:28 UTC MAIN commitmail json YAML

2022-03-03 05:56:19 UTC MAIN commitmail json YAML

2022-03-03 05:56:10 UTC MAIN commitmail json YAML

2022-03-03 05:56:00 UTC MAIN commitmail json YAML

2022-03-03 05:55:52 UTC MAIN commitmail json YAML

usbnet: Handle usbnet_set_link for drivers with no media detect.

(riastradh)

2022-03-03 05:55:45 UTC MAIN commitmail json YAML

url(4): Inline call to url_uno_stop -- alias for url_reset.

(riastradh)

2022-03-03 05:55:38 UTC MAIN commitmail json YAML

usbnet drivers: Omit redundant device reset via *_uno_stop on init.

Only those drivers where *_uno_stop is just *_reset, and *_uno_init
immediately calls *_reset afterward, are affected.

(riastradh)

2022-03-03 05:55:29 UTC MAIN commitmail json YAML

usbnet drivers: From *_uno_init, call *_uno_stop, not usbnet_stop.

Make usbnet_stop private now that no drivers use it.

None of the driver-independent logic in usbnet_stop has any effect at
this point because we are guaranteed not to be running, so only the
driver-dependent logic in *_uno_stop (at most) is needed.

For drivers with no *_uno_stop, just omit the call to usbnet_stop
altogether.

Some of this logic is obviously redundant with the subsequent call to
*_reset -- to be addressed in a subsequent commit.

(riastradh)

2022-03-03 05:55:19 UTC MAIN commitmail json YAML

usbnet drivers: Prune dead IFF_RUNNING branches in *_uno_init.

usbnet(9) guarantees !IFF_RUNNING now before calling it.

(riastradh)

2022-03-03 05:55:10 UTC MAIN commitmail json YAML

usbnet: Do nothing on if_init/stop if already in the target state.

The network stack _shouldn't_ ever call us if so, but I'm not yet
sure it _won't_.

(riastradh)

2022-03-03 05:55:01 UTC MAIN commitmail json YAML

2022-03-03 05:54:52 UTC MAIN commitmail json YAML

usbnet: Delete the core lock from the API.

Init/stop and ioctl happen under IFNET_LOCK.  Multicast updates only
happen after init and before stop.  Core lock is no longer a relevant
part of the API.  Internally, it serves essentially just to lock out
asynchronous mii activity during init/stop.

(riastradh)

2022-03-03 05:54:45 UTC MAIN commitmail json YAML

urndis(4): Delete some crazy logic that I think is unnecessary.

XXX definitely need to test this one

(riastradh)

2022-03-03 05:54:37 UTC MAIN commitmail json YAML

usbnet drivers: Omit needless usbnet core lock and assertions.

During attach, the caller has exclusive access to the usbnet until
usbnet_attach_ifp.  At other times, register access is serialized
either by the usbnet multicast lock or by IFNET_LOCK.

(riastradh)

2022-03-03 05:54:28 UTC MAIN commitmail json YAML

usbnet: Make usbnet_mii_readreg/writereg/statchg private to usbnet.c.

No drivers need to use these.

(riastradh)

2022-03-03 05:54:21 UTC MAIN commitmail json YAML

usbnet drivers: Avoid undefined behaviour if read reg fails.

Some callers don't check the error code, e.g. ~all the mii phy
drivers using PHY_READ.  Just return zero if the device is gone or
the xfer fails for any other reason.

(riastradh)

2022-03-03 05:54:11 UTC MAIN commitmail json YAML

axen(4): Use axen mii read/write reg routines, not usbnet ones.

The usbnet wrappers don't add anything important.  We already test
usbnet_isdying in axen_cmd, and that's already a best-effort thing
(which should probably be done better by having usbd_do_request fail
promptly if detaching anyway).

(riastradh)

2022-03-03 05:54:03 UTC MAIN commitmail json YAML

usbnet drivers: Assert IFNET_LOCKED in if ioctl routines.

These only happen either during the transition up or down (init or
stop), or while that transition is excluded (ioctl).

This may be called from ioctl or from init, which both hold the ifnet
lock.

XXX smsc_setoe_locked should maybe trigger reinit because the rx loop
behaves differently depending on whether checksumming is enabled.

XXX mue_sethwcsum_locked needs to exclude mcast updates.

(riastradh)

2022-03-03 05:53:56 UTC MAIN commitmail json YAML

udav(4): Stop asserting !usbnet_isdying.

This can change at any moment; no software lock can prevent the
device from being detached.  Any test of it is necessarily
best-effort just to avoid wasting time later on waiting for requests
to fail or time out.

(riastradh)

2022-03-03 05:53:49 UTC MAIN commitmail json YAML

aue(4): Simplify.  No functional change.

(riastradh)

2022-03-03 05:53:41 UTC MAIN commitmail json YAML

aue(4): Enable rx/tx registers on init before usbnet_init_rx_tx.

This way, we still have exclusive access to the registers before
calls to aue_uno_mcast can start happening without the usbnet core
lock.

(riastradh)

2022-03-03 05:53:33 UTC MAIN commitmail json YAML

2022-03-03 05:53:23 UTC MAIN commitmail json YAML

usbnet: Apply hardware multicast filter updates synchronously again.

To make this work:

1. Do it only under a new lock, unp_mcastlock.  This lock lives at
  IPL_SOFTCLOCK so it can be taken from network stack callouts.  It
  is forbidden to acquire the usbnet core lock under unp_mcastlock.

2. Do it only after usbnet_init_rx_tx and before usbnet_stop; if
  issued at any other time, drop the update on the floor.

3. Make usbnet_init_rx_tx apply any pending multicast filter updates
  under the lock before setting the flag that allows SIOCADDMULTI or
  SIOCDELMULTI to apply the updates.

4. Remove core lock asserts from various drivers' register access
  routines.  This is necessary because the multicast filter updates
  are done with register reads/writes, but _cannot_ take the core
  lock when the caller holds softnet_lock.

This now programs the hardware multicast filter redundantly in many
drivers which already explicitly call *_uno_mcast from the *_uno_init
routines.  This is probably harmless, but it will likely be better to
remove the explicit calls.

(riastradh)

2022-03-03 05:53:14 UTC MAIN commitmail json YAML

usbnet drivers: Stop abusing ifp->if_flags & IFF_ALLMULTI.

This legacy flag is a figment of userland's imagination.  The actual
kernel state is ec->ec_flags & ETHER_F_ALLMULTI, protected by the
ETHER_LOCK, so that multicast filter updates -- which run without
IFNET_LOCK -- need not attempt to write racily to ifp->if_flags.

(riastradh)

2022-03-03 05:53:04 UTC MAIN commitmail json YAML

2022-03-03 05:52:55 UTC MAIN commitmail json YAML

aue(4): Reduce aue_uno_mcast from aue_uno_init to aue_setiff_locked.

This operation only needs to update the hardware to reflect
SIOCADDMULTI/SIOCDELMULTI.  Not clear that everything in aue(4) needs
to be reset -- in fact I'm pretty sure that's undesirable!

WARNING: I have not tested this with a real aue(4) device.

(riastradh)

2022-03-03 05:52:46 UTC MAIN commitmail json YAML

usbnet: Take the core lock around uno_mcast.

Every driver does this already.  This will enable us to change the
lock that serializes access to the registers so we can go back to
doing this synchronously in SIOCADDMULTI/SIOCDELMULTI.

(riastradh)

2022-03-03 05:52:36 UTC MAIN commitmail json YAML

2022-03-03 05:52:27 UTC MAIN commitmail json YAML

usbnet: No need for the core lock in usbnet_ifflags_cb.

The only state this touches is unp_if_flags, and all paths touching
it also hold IFNET_LOCK -- not to mention this is the only path that
touches unp_if_flags in the first place!

(riastradh)

2022-03-03 05:52:20 UTC MAIN commitmail json YAML

usbnet: Make the tx/rx locks private to usbnet.c.

Suffice it for the drivers to know that uno_tx_prepare and
uno_rx_loop have exclusive access to the chain, and, for tx,
exclusive access to the mbuf.

(riastradh)

2022-03-03 05:52:11 UTC MAIN commitmail json YAML

usbnet: usbnet_busy is no longer referenced; release it!

(riastradh)

2022-03-03 05:52:04 UTC MAIN commitmail json YAML

usbnet: No need for usbnet_busy in mii callbacks.

After mii_detach, these have all completed and no new ones can be
made, and detach doesn't start destroying anything until after
mii_detach has returned, so there is no need to hang onto a reference
count here.

(riastradh)

2022-03-03 05:51:56 UTC MAIN commitmail json YAML

usbnet: No need for usbnet_busy in usbnet_init_rx_tx or usbnet_stop.

These run with IFNET_LOCK held, and the interface cannot be detached
until the IFNET_LOCK is released, so there is no need to hang onto a
reference count here.

(riastradh)

2022-03-03 05:51:44 UTC MAIN commitmail json YAML

usbnet drivers: No need for usbnet_busy during attach.

usbnet_detach cannot run until the attach routine has finished
(unless a driver goes out of its way to tie its shoelaces together
and explicitly call it during the attach routine, which none of them
do), so there is no need to hang onto a reference count that we
release before attach returns.

(riastradh)

2022-03-03 05:51:36 UTC MAIN commitmail json YAML

usbnet drivers: No need for usbnet_busy in uno_ioctl.

This callback always runs with the IFNET_LOCK held, and the interface
cannot be detached until the IFNET_LOCK is released, so there is no
need to hang onto a reference count here.  (None of the subnet
drivers touch the IFNET_LOCK except to verify it is held sometimes.)

(riastradh)

2022-03-03 05:51:27 UTC MAIN commitmail json YAML

usbnet drivers: No need for usbnet_busy in uno_mcast.

This callback always runs with IFNET_LOCK held, and during a task
that usbnet_detach prevents scheduling anew and waits for finishing
before completing the detach, so there is no need to hang onto a
reference count here.

(riastradh)

2022-03-03 05:51:17 UTC MAIN commitmail json YAML

usbnet drivers: No need for usbnet_busy in uno_init.

This callback always runs with the IFNET_LOCK held, and the interface
cannot be detached until the IFNET_LOCK is released, so there is no
need to hang onto a reference count here.  (None of the usbnet
drivers touch the IFNET_LOCK except to verify it is held sometimes.)

(riastradh)

2022-03-03 05:51:06 UTC MAIN commitmail json YAML

2022-03-03 05:50:57 UTC MAIN commitmail json YAML

2022-03-03 05:50:47 UTC MAIN commitmail json YAML

usbnet: Omit needless locking around usbnet_isdying.

Now that is tested and set with atomic_load/store, there is no need
to hold the lock -- which means we can set it while the core lock is
held during, e.g., a reset sequence, and use that to interrupt the
sequence so it doesn't get stuck waiting to time out when the device
is physically removed.

(riastradh)

2022-03-03 05:50:40 UTC MAIN commitmail json YAML

usbnet: Use atomic_load/store_relaxed for unp_dying.

This way we don't need to hold the core lock to avoid upsetting
sanitizers (which probably find the current code upsetting), and we
can use it to exit early from timeout loops that run under the core
lock (which is probably not necessary for them to do anyway, but
let's worry about that later).

(riastradh)

2022-03-03 05:50:31 UTC MAIN commitmail json YAML

usbnet: Print diagnostic about refcnt stragglers.

I don't think there can be any, but this message, if printed, would
falsify my hypothesis!

(riastradh)

2022-03-03 05:50:22 UTC MAIN commitmail json YAML

usbnet: Enter uno_init with the core lock held.

This reduces code in all drivers except urndis(4) and aue(4).

However, it's still safe for urndis to drop the core lock because the
ifnet is locked, and the ifnet lock covers the DOWN->UP (uno_init)
and UP->DOWN (uno_stop) transitions.

(riastradh)

2022-03-03 05:50:13 UTC MAIN commitmail json YAML

usbnet: Assert ioctl locking.

(riastradh)

2022-03-03 05:50:06 UTC MAIN commitmail json YAML

usbnet: Impart blame on whose ifnet is unlocked in uno_init.

(riastradh)

2022-03-03 05:49:58 UTC MAIN commitmail json YAML

usbnet: Don't waste time calling uno_stop if device is detaching.

The hardware is most likely gone, so trying to write to its registers
(and, in some cases, wait until a timeout for a device to reset) is a
waste of time.  Even if it was detached only in software with drvctl,
reattaching it will reset the device anyway.

(riastradh)

2022-03-03 05:49:51 UTC MAIN commitmail json YAML

cue(4): Return real error code, not -1, on init when detaching.

(riastradh)

2022-03-03 05:49:44 UTC MAIN commitmail json YAML

usbnet: Avoid IFNET_LOCK on detach if we never attached the ifp.

(riastradh)

2022-03-03 05:49:37 UTC MAIN commitmail json YAML

usbnet: Clear watchdog timer before stopping hardware.

No need to take the lock again -- which might not be necessary
because the callout and task have completed, but let's obviate the
need to think about that.

(riastradh)

2022-03-03 05:49:29 UTC MAIN commitmail json YAML

usbnet: Omit needless locking/busying/testing in usbnet_tick_task.

usbnet_stop waits for the task to complete before resetting the
hardware, and usbnet_detach waits for usbnet_stop to complete before
destroying anything, so there's no need for any of this.

(riastradh)

2022-03-03 05:49:22 UTC MAIN commitmail json YAML

usbnet: Omit needless tests in usbnet_tick.

It's harmless for us to schedule the tick task even if unp_dying or
unp_stopping is set by now, because usbnet_stop will just wait for it
to finish anyway, and the callout can't be scheduled again until the
interface is done stopping and is brought back up again.

No need for unp == NULL test -- un->un_pri is initialized well before
this callout can be scheduled, and is nulled out only at the end of
usbnet_detach, at which point we have already halted this callout.

(riastradh)

2022-03-03 05:49:15 UTC MAIN commitmail json YAML

usbnet: Uncomment and fix assertion for ifp->if_flags |= IFF_RUNNING.

We always hold IFNET_LOCK for ioctls that end up here -- the ones
that don't hold it are only SIOCADDMULTI/SIOCDELMULTI, which don't
end up here.  However, urndis(4) throws a spanner in the works by
doing weird device initialization.

(riastradh)

2022-03-03 05:49:08 UTC MAIN commitmail json YAML

usbnet: Don't issue a detach event if we never issued an attach one.

(riastradh)

2022-03-03 05:49:00 UTC MAIN commitmail json YAML

usbnet: Make detach order reverse attach order, for unp_stat_ch.

No functional change intended.

(riastradh)

2022-03-03 05:48:52 UTC MAIN commitmail json YAML

usbnet: Detach interface and mii before waiting for refcnt to drain.

All outstanding software activity under usbnet's control -- which is
all that participates in the refcnting -- should be quiesced by
stopping and detaching everything.

(riastradh)

2022-03-03 05:48:45 UTC MAIN commitmail json YAML

usbnet: Omit needless callout_halt and usb_rem_task_wait.

The callout and tasks cannot be pending at this point -- it is a bug
if usbnet_if_stop failed to quiesce everything, so turn these into
KASSERTs.

(riastradh)

2022-03-03 05:48:37 UTC MAIN commitmail json YAML

usbnet: Refuse to bring interfaces back up once dying.

Make this happen uniformly across all usbnet drivers, not on a
per-driver basis.

This ensures new activity on the interface can't happen by the time
we have stopped existing activity and waited for it to complete.

(riastradh)

2022-03-03 05:48:30 UTC MAIN commitmail json YAML

usbnet: Assert IFNET_LOCKED in usbnet_media_upd.

This ensures, if the device is being initialized or stopped,
usbnet_media_upd will not run until it's done, so the reset sequence
has exclusive access to the device registers used by mii.

(riastradh)

2022-03-03 05:48:23 UTC MAIN commitmail json YAML

usbnet: Fix ordering of actions in usbnet_stop.

Make sure all software activity is quiescent (callouts and tasks,
including ifmedia and mii callbacks -- anything that might trigger
register access) before asking the driver to stop the hardware.  This
way, the driver uno_stop routine is guaranteed exclusive access to
the registers.

This will also enable us to simplify the callouts and tasks so they
don't have to check the software state -- to be done in a separate
commit.

(riastradh)

2022-03-03 05:48:14 UTC MAIN commitmail json YAML

usbnet: Remove usbnet_set_dying.

Not necessary for the one caller that did it (url(4)): usbnet_detach
handles failed attach just fine without it.

(riastradh)

2022-03-03 05:48:06 UTC MAIN commitmail json YAML

axen(4), mue(4), smsc(4): Omit irrelevant cases in ioctl.

SIOCSIFFLAGS and SIOCSETHERCAP always end up in ether_ioctl_reinit,
which triggers the same logic to reprogram the multicast filters
anyway.

(riastradh)

2022-03-03 05:47:58 UTC MAIN commitmail json YAML

usbnet: Omit needless unp == NULL test in usbnet_tick_task.

The task is never scheduled until after un->un_pri is initialized,
and un->un_pri isn't nulled until after the callout and task are
quiescent.

(riastradh)

2022-03-03 05:47:50 UTC MAIN commitmail json YAML

usbnet: Don't check if_flags for IFF_RUNNING in usbnet_pipe_intr.

The one user of this interface in tree, aue(4), doesn't care --
if_statinc is safe whether IFF_RUNNING or not.

(riastradh)

2022-03-03 05:47:43 UTC MAIN commitmail json YAML

usbnet: Don't check if_flags for IFF_RUNNING in usbnet_rxeof.

This can only run after we start the pipes in usbnet_init_rx_tx, and
before we abort the pipes in usbnet_stop, during which time if_flags
& IFF_RUNNING is stably set.

(riastradh)

2022-03-03 05:47:36 UTC MAIN commitmail json YAML

usbnet: Assert IFNET_LOCKED in usbnet_init_rx_tx, usbnet_stop.

Exception: urndis(4) abuses this API to start this logic before the
ifp is actually initialized.  So for the sake of urndis(4), until
sense can be beaten into it, allow the !unp_ifp_attached case to run
without IFNET_LOCK.

(riastradh)

2022-03-03 05:47:28 UTC MAIN commitmail json YAML

usbnet: Assert IFNET_LOCKED on if_flags change callbacks.

- if_init
- if_stop
- ethersubr(9) ifflags_cb

(riastradh)

2022-03-03 05:47:21 UTC MAIN commitmail json YAML

usbnet: Ensure access to unp_timer is protected by unp_txlock.

(riastradh)

2022-03-03 05:47:14 UTC MAIN commitmail json YAML

usbnet: Ensure ifp->if_softc is initialized _before_ publishing ifp.

Otherwise other parts of the system might start using ifp the moment
we if_register it, and trip over null if_softc.

(riastradh)

2022-03-03 05:47:06 UTC MAIN commitmail json YAML

usbnet: Take IFNET_LOCK around access to if_flags in usbnet_detach.

This is not stable without IFNET_LOCK.  Extraneous calls to
usbnet_stop arising from this race might be harmless, but let's
render it unnecessary to even think about that.

(riastradh)

2022-03-03 05:46:58 UTC MAIN commitmail json YAML

usbnet: Set and clear IFF_RUNNING slightly earlier and later.

- Set IFF_RUNNING before any calls to usbnet_rxeof are possible.
- Don't clear IFF_RUNNING until all transfers have been aborted.

(riastradh)

2022-03-03 05:46:50 UTC MAIN commitmail json YAML

usbnet: Simplify usbnet_isdying.

usbnet_detach (or its caller) stops all users before it returns.

If un->un_pri is null at this point, there's a bug -- something
didn't wait for everything to finish before calling usbnet_detach.

(riastradh)

2022-03-02 19:32:16 UTC MAIN commitmail json YAML

Add nofilemon to meta mode tests

The unit-tests for meta mode do not depend on filemon.
Adding nofilemon to .MAKE.MODE allows these to pass on
a system that would use filemon_dev but does not have
the module loaded.

(sjg)

2022-03-02 07:48:20 UTC MAIN commitmail json YAML

mount_9p: check returned type for Tread

(ozaki-r)

2022-03-02 04:11:41 UTC MAIN commitmail json YAML

mount_9p: fix writing to a file opened with write-only mode

With the page cache, writing data to a file may demand to read contents
from a storage to fill a page in the page cache first.

Opening a file with write-only mode by a user lets a mount_9p process
open a file with write-only mode too at a 9p server.  Thus, a read
request to the file from the page cache fails.

So we need to open a file always with read mode (internally) even if it
is opened with write-only mode by a user.

Note that the change doesn't mean that mount_9p allows users to read
contents from a file that is opened with write-only mode.

(ozaki-r)

2022-03-02 01:55:19 UTC MAIN commitmail json YAML

LOGIN: fix typo in description

(gutteridge)

2022-03-01 20:00:48 UTC MAIN commitmail json YAML

lint: remove redundant assignments to string buffer length

No functional change.

(rillig)

2022-03-01 06:41:27 UTC MAIN commitmail json YAML

Add the -F flag to the getopt string, it was there in the help and
in the arguments handling but getopt was not told about it.

(blymn)

2022-03-01 00:17:12 UTC MAIN commitmail json YAML

lint: add debug logging for symbols and the symbol table

This logging is not active by default, the functions debug_sym and
debug_symtab can be called as needed during a debug session.

(rillig)

2022-02-28 22:41:07 UTC MAIN commitmail json YAML

lint: constify lexer keywords

No functional change.

(rillig)

2022-02-28 17:15:30 UTC MAIN commitmail json YAML

2022-02-28 16:39:22 UTC netbsd-9 commitmail json YAML

2022-02-28 16:37:34 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by gdt in ticket #1430):

include/math.h: revision 1.66

Correct C99 / C++11 feature testing. Document remaining missing symbols.

(martin)

2022-02-28 16:30:10 UTC MAIN commitmail json YAML

When MKDEBUG is use, build LLVM with -g1 to significantly reduce debug
information. This still includes types and line tables, but skips e.g.
local variables and inline tracking.

(joerg)

2022-02-28 13:49:50 UTC MAIN commitmail json YAML

seq(1): add more examples, improve wording

From OpenBSD via jmc@OpenBSD

(wiz)

2022-02-28 08:45:36 UTC MAIN commitmail json YAML

Revert the hack from the last commit now that VOP_UNLOCK()
no longer may hold v_interlock or vmobjlock.

(hannken)

2022-02-28 08:44:04 UTC MAIN commitmail json YAML

vrelel(): no VOP_UNLOCK() with v_interlock or vmobjlock held.

(hannken)

2022-02-27 22:46:04 UTC MAIN commitmail json YAML

lint: reorganize lexer functions

Move the keywords table to the top, reduce forward declarations.

No functional change.

(rillig)

2022-02-27 22:26:12 UTC MAIN commitmail json YAML

lint: group symbol table functions

No functional change.

(rillig)

2022-02-27 21:23:39 UTC MAIN commitmail json YAML

i915: Disable PSR for now.

Something seems to be wrong with it, causing the display to get
stuck.  To be diagnosed -- this is a performance optimization, but
it's better to work than to fail to work even if failing to work
costs a little less energy!

(riastradh)

2022-02-27 21:22:10 UTC MAIN commitmail json YAML

acpi: Assert acpi_register_notify is not called twice.

(riastradh)

2022-02-27 21:22:01 UTC MAIN commitmail json YAML

2022-02-27 21:21:51 UTC MAIN commitmail json YAML

acpivga(4): Provide hooks for ACPI display notifications.

The Intel i915 graphics driver needs to receive ACPI VGA 0x80
notifications, but with NetBSD's ACPI API, each ACPI node -- such as
the VGA node -- can only have one notifier attached, and acpivga(4)
already uses it.

(riastradh)

2022-02-27 21:05:11 UTC MAIN commitmail json YAML

2022-02-27 20:02:44 UTC MAIN commitmail json YAML

2022-02-27 19:32:51 UTC MAIN commitmail json YAML

lint: concatenate string literals from left to right

Previously, the string literals "1" "2" "3" "4" were concatenated in the
order "23", "234", "1234".  This influenced the location of the
diagnostics for traditional C (which doesn't know concatenation at all)
and for mixing regular strings and wide strings.

Now the diagnostics occur exactly where they are expected.  The first
string literal defines whether the whole string is regular or wide, and
any further string literals must match it.

In traditional C mode, there are more diagnostics than before, but that
doesn't hurt since they are still correct and nobody uses lint in
traditional C mode anyway.

(rillig)

2022-02-27 19:22:29 UTC MAIN commitmail json YAML

mips: Issue a sync plunger at the end of mutex_spin_exit.

Same as mutex_exit.  Relevant only on cnMIPS where the store buffers
get clogged.  Recommended by the Cavium documentation.  No semantic
change, only performance -- this only adds a barrier in some cases
where there was none before, so it can't hurt correctness.

(riastradh)

2022-02-27 19:22:20 UTC MAIN commitmail json YAML

mips: Redefine LLSCSYNC as empty on non-Octeon MP.

This change deletes memory barriers on non-Octeon MP.  However, all
the appropriate acquire and release barriers are already used in
mutex stubs, and no barriers are needed in atomic_* unless we set
__HAVE_ATOMIC_AS_MEMBAR which we don't on MIPS.  So this should be
safe.

Unclear whether we need this even on Octeon -- don't have a clear
reference on why it's here.

(riastradh)

2022-02-27 19:22:12 UTC MAIN commitmail json YAML

mips: Redefine BDSYNC as sync on Octeon, not syncw.

BDSYNC is used for membar_sync, which is supposed to be a full
sequential consistency barrier, which is not provided by syncw, so
this is necessary for correctness.

BDSYNC is not used for anything else, so this can't hurt performance,
except where it was necessary for correctness anyway or where the
semantic choice of membar_sync was too strong anyway.

(riastradh)

2022-02-27 19:22:03 UTC MAIN commitmail json YAML

mips: Omit needless SYNC in mutex_exit.

This change deletes a memory barrier.  However, it should be safe:
The semantic requirement for this is already provided by the SYNC_REL
above, before the ll.  And as currently defined, SYNC_REL is at least
as strong as SYNC, so this change can't hurt correctness on its own
(barring CPU errata, which would apply to other users of SYNC_REL and
can be addressed in the definition of SYNC_REL).

Later, perhaps we can relax SYNC_REL to syncw on Octeon if we prove
that it is correct (e.g., if Octeon follows the SPARCv9 partial store
order semantics).

Nix now-unused SYNC macro in asm.h.

(riastradh)

2022-02-27 19:21:54 UTC MAIN commitmail json YAML

mips: Membar audit.

This change should be safe because it doesn't remove or weaken any
memory barriers, but does add, clarify, or strengthen barriers.

Goals:

- Make sure mutex_enter/exit and mutex_spin_enter/exit have
  acquire/release semantics.

- New macros make maintenance easier and purpose clearer:

  . SYNC_ACQ is for load-before-load/store barrier, and BDSYNC_ACQ
    for a branch delay slot -- currently defined as plain sync for MP
    and nothing, or nop, for UP; thus it is no weaker than SYNC and
    BDSYNC as currently defined, which is syncw on Octeon, plain sync
    on non-Octeon MP, and nothing/nop on UP.

    It is not clear to me whether load-then-syncw or ll/sc-then-syncw
    or even bare load provides load-acquire semantics on Octeon -- if
    no, this will fix bugs; if yes (like it is on SPARC PSO), we can
    relax SYNC_ACQ to be syncw or nothing later.

  . SYNC_REL is for load/store-before-store barrier -- currently
    defined as plain sync for MP and nothing for UP.

    It is not clear to me whether syncw-then-store is enough for
    store-release on Octeon -- if no, we can leave this as is; if
    yes, we can relax SYNC_REL to be syncw on Octeon.

  . SYNC_PLUNGER is there to flush clogged Cavium store buffers, and
    BDSYNC_PLUNGER for a branch delay slot -- syncw on Octeon,
    nothing or nop on non-Octeon.

    => This is not necessary (or, as far as I'm aware, sufficient)
      for acquire semantics -- it serves only to flush store buffers
      where stores might otherwise linger for hundreds of thousands
      of cycles, which would, e.g., cause spin locks to be held for
      unreasonably long durations.

  Newerish revisions of the MIPS ISA also have finer-grained sync
  variants that could be plopped in here.

Mechanism:

Insert these barriers in the right places, replacing only those where
the definition is currently equivalent, so this change is safe.

- Replace #ifdef _MIPS_ARCH_OCTEONP / syncw / #endif at the end of
  atomic_cas_* by SYNC_PLUNGER, which is `sync 4' (a.k.a. syncw) if
  __OCTEON__ and empty otherwise.

  => From what I can tell, __OCTEON__ is defined in at least as many
    contexts as _MIPS_ARCH_OCTEONP -- i.e., there are some Octeons
    with no _MIPS_ARCH_OCTEONP, but I don't know if any of them are
    relevant to us or ever saw the light of day outside Cavium; we
    seem to buid with `-march=octeonp' so this is unlikely to make a
    difference.  If it turns out that we do care, well, now there's
    a central place to make the distinction for sync instructions.

- Replace post-ll/sc SYNC by SYNC_ACQ in _atomic_cas_*, which are
  internal kernel versions used in sys/arch/mips/include/lock.h where
  it assumes they have load-acquire semantics.  Should move this to
  lock.h later, since we _don't_ define __HAVE_ATOMIC_AS_MEMBAR on
  MIPS and so the extra barrier might be costly.

- Insert SYNC_REL before ll/sc, and replace post-ll/sc SYNC by
  SYNC_ACQ, in _ucas_*, which is used without any barriers in futex
  code and doesn't mention barriers in the man page so I have to
  assume it is required to be a release/acquire barrier.

- Change BDSYNC to BDSYNC_ACQ in mutex_enter and mutex_spin_enter.
  This is necessary to provide load-acquire semantics -- unclear if
  it was provided already by syncw on Octeon, but it seems more
  likely that either (a) no sync or syncw is needed at all, or (b)
  syncw is not enough and sync is needed, since syncw is only a
  store-before-store ordering barrier.

- Insert SYNC_REL before ll/sc in mutex_exit and mutex_spin_exit.
  This is currently redundant with the SYNC already there, but
  SYNC_REL more clearly identifies the necessary semantics in case we
  want to define it differently on different systems, and having a
  sync in the middle of an ll/sc is a bit weird and possibly not a
  good idea, so I intend to (carefully) remove the redundant SYNC in
  a later change.

- Change BDSYNC to BDSYNC_PLUNGER at the end of mutex_exit.  This has
  no semantic change right now -- it's syncw on Octeon, sync on
  non-Octeon MP, nop on UP -- but we can relax it later to nop on
  non-Cavium MP.

- Leave LLSCSYNC in for now -- it is apparently there for a Cavium
  erratum, but I'm not sure what the erratum is, exactly, and I have
  no reference for it.  I suspect these can be safely removed, but we
  might have to double up some other syncw instructions -- Linux uses
  it only in store-release sequences, not at the head of every ll/sc.

(riastradh)

2022-02-27 19:21:44 UTC MAIN commitmail json YAML

mips: Make sure that mutex_spin_exit works even if !DIAGNOSTIC.

The critical store has been under #ifdef DIAGNOSTIC since, uh, 2011.

(riastradh)

2022-02-27 19:00:46 UTC MAIN commitmail json YAML

vmstat: unexport file-scope variable numdisks

There is no need to make this variable externally visible.  There are
several more variables in this file that could be unexported, leave
these for someone who knows whether vmstat.c is used by other parts of
the tree as well.

No functional change, OK mrg.

(rillig)

2022-02-27 18:57:16 UTC MAIN commitmail json YAML

tests/lint: test where exactly lint complains about concatenation

This only applies to traditional C and ensures that the behavior is
preserved when rearranging the C parser to evaluate string concatenation
from left to right.

(rillig)

2022-02-27 18:51:21 UTC MAIN commitmail json YAML

tests/lint: demonstrate unexpected ordering of string concatenations

When lint concatenates the strings "1" "2" "3" "4", it first
concatenates "23", then "234" and finally "1234".

(rillig)

2022-02-27 18:29:14 UTC MAIN commitmail json YAML

lint: merge duplicate code for handling plain and wide strings

No functional change.  As before, the string literals "1" "2" "3" are
not concatenated from left to right, instead concatenation starts with
"23" and then proceeds to "123".

(rillig)

2022-02-27 17:12:06 UTC MAIN commitmail json YAML

lint: clean up code for handling filenames

No functional change.

(rillig)

2022-02-27 15:02:58 UTC MAIN commitmail json YAML

only build linux_acpi.c if we have acpi(4) in the kernel

(jakllsch)

2022-02-27 14:24:27 UTC MAIN commitmail json YAML

2022-02-27 14:24:11 UTC MAIN commitmail json YAML

vmem(9): Assert addresses are quantum-aligned.

(riastradh)

2022-02-27 14:23:24 UTC MAIN commitmail json YAML

amdgpu: Make amdgpu_bios.c ACPI stuff build.

(riastradh)

2022-02-27 14:23:17 UTC MAIN commitmail json YAML

radeon: Make radeon_bios.c ACPI stuff build.

(riastradh)

2022-02-27 14:23:08 UTC MAIN commitmail json YAML

linux: Define PCI_CLASS_DISPLAY_OTHER, wanted by radeon/amdgpu.

(riastradh)

2022-02-27 14:22:50 UTC MAIN commitmail json YAML

linux: Define acpi_size as alias for ACPI_SIZE.

(riastradh)

2022-02-27 14:22:42 UTC MAIN commitmail json YAML

2022-02-27 14:22:30 UTC MAIN commitmail json YAML

2022-02-27 14:22:21 UTC MAIN commitmail json YAML

2022-02-27 14:20:30 UTC MAIN commitmail json YAML

i915: Omit needless ifdefs around ACPI API.

(riastradh)

2022-02-27 14:19:35 UTC MAIN commitmail json YAML

2022-02-27 14:19:20 UTC MAIN commitmail json YAML

drm: Deconditionalize pci_get_segment.

(riastradh)

2022-02-27 14:19:08 UTC MAIN commitmail json YAML

acpi: Nix conditional pci_get_segment use.

New MI default of 0 serves.

(riastradh)

2022-02-27 14:18:52 UTC MAIN commitmail json YAML

pci(9): Provide default definition of pci_get_segment, always zero.

pci_machdep.h can define __HAVE_PCI_GET_SEGMENT to provide a nonzero
definition.

(riastradh)

2022-02-27 14:18:42 UTC MAIN commitmail json YAML

i915: Use new rb_move to relocate the active tree.

(riastradh)

2022-02-27 14:18:34 UTC MAIN commitmail json YAML

linux: New rb_move(&to, &from) to replace `to = from'.

NetBSD rbtree(3) is not relocatable, so this extra step is needed.
Unfortunately, there's no easy way to automate detection of where we
need to apply this in ported code...

(riastradh)

2022-02-27 14:18:25 UTC MAIN commitmail json YAML

linux: Actually do post-order tree traversal.

Requires breaking the rbtree(3) abstraction, but this is necessary
because the body of the loop often frees the element, so as is we had
a huge pile of use-after-free going on.

Requires changing struct interval_tree_node's rbnode member to match
the Linux name, since we now use container_of here, and radeon relies
on this.

(riastradh)

2022-02-27 14:17:10 UTC MAIN commitmail json YAML

alpha: Fix placement of membar for sending ICCB message.

While here, reduce it to membar_exit -- it's obviously not needed for
store-before-load here (although alpha doesn't have anything weaker
than the full sequential consistency `mb'), and although we do need a
store-before-load (and load-before-load) to spin waiting for the CPU
to wake up, that already happens a few lines below with alpha_mb in
the loop anyway.  So no need for membar_sync, which is just `mb'
under the hood -- deleting the membar_sync in this place can't hurt.

The membar_sync had been inserted automatically when converting from
an older style of atomic_ops(3) API.

(riastradh)

2022-02-27 14:16:43 UTC MAIN commitmail json YAML

pool(9): Membar audit.

- Use atomic_store_release and atomic_load_consume for associating a
  freshly constructed pool_cache with its underlying pool.  The pool
  gets published in various ways before the pool cache is fully
  constructed.

  => Nix membar_sync -- no store-before-load is needed here.

- Take pool_head_lock around sysctl kern.pool TAILQ_FOREACH.  Then take
  a reference count, and drop the lock, around copyout.

  => Otherwise, pools could be partially initialized or freed while
    we're still trying to read from them -- and in the worst case,
    we might see a corrupted view of the tailq.

  => If we kept the lock around copyout, this could deadlock in memory
    allocation.

  => If we didn't take a reference count while releasing the lock, the
    pool could be destroyed while we're trying to traverse the list,
    sending us into oblivion instead of the next element.

(riastradh)

2022-02-27 14:16:33 UTC MAIN commitmail json YAML

lockstat(4): KNF.  No functional change intended.

(riastradh)

2022-02-27 14:16:12 UTC MAIN commitmail json YAML

lockstat(4): Membar audit.

- Serialize updates to lockstat_enabled, lockstat_dev_enabled, and
  lockstat_dtrace_enabled with a new __cpu_simple_lock.

- Use xc_barrier to obviate any need for additional membars in
  lockstat_event.

- Use atomic_load/store_* for access that might not be serialized by
  lockstat_lock or lockstat_enabled_lock.

(riastradh)

2022-02-27 12:27:22 UTC MAIN commitmail json YAML

Do not assume we have a SYS_getrandom for the tools build.

(martin)

2022-02-27 12:00:27 UTC MAIN commitmail json YAML

2022-02-27 11:49:28 UTC MAIN commitmail json YAML

evbppc/temac(4): Mark unused functions as such.

(riastradh)

2022-02-27 11:40:30 UTC MAIN commitmail json YAML

2022-02-27 11:14:42 UTC MAIN commitmail json YAML

2022-02-27 10:49:15 UTC MAIN commitmail json YAML

lint: remove unused enumeration details from symbol type

No functional change.

(rillig)

2022-02-27 10:44:45 UTC MAIN commitmail json YAML

2022-02-27 10:31:58 UTC MAIN commitmail json YAML