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 (1h)  netbsd-8 (5d)  netbsd-10 (6d)  netbsd-9 (12d)  thorpej-ifq (176d)  thorpej-altq-separation (178d) 

2024-05-10 16:27:36 UTC Now

2022-08-20 18:36:17 UTC MAIN commitmail json YAML

gpn_ifstart(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".

(thorpej)

2022-08-20 18:35:50 UTC MAIN commitmail json YAML

gmc_ifstart(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".

(thorpej)

2022-08-20 16:47:01 UTC MAIN commitmail json YAML

esstart(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".

(thorpej)

2022-08-20 15:12:27 UTC MAIN commitmail json YAML

config cosmetics (avoid a warning from config(1):
no need to repeat COMPAT_NETBSD32, we get that from GENERIC.common
already (where it is used for aout support, but here it means elf32
support). Add a comment explaining what goes on.

(martin)

2022-08-20 15:11:27 UTC MAIN commitmail json YAML

ifnet(9): Make sure to use if_timer and if_watchdog at IPL_NET.

(riastradh)

2022-08-20 14:17:36 UTC MAIN commitmail json YAML

mutex(9): Note counterintuitive IPL change releasing spin locks.

No functional change -- documentation only.

Details:

https://mail-index.netbsd.org/tech-kern/2010/11/12/msg009203.html

(riastradh)

2022-08-20 14:09:21 UTC MAIN commitmail json YAML

udav(4): Prune dead branch: legacy IFF_ALLMULTI is never set here.

(riastradh)

2022-08-20 14:09:10 UTC MAIN commitmail json YAML

cue(4): Prune dead branch: IFF_BROADCAST is always set here.

(riastradh)

2022-08-20 14:08:59 UTC MAIN commitmail json YAML

2022-08-20 14:08:47 UTC MAIN commitmail json YAML

usbnet(9): Rename core lock -> mii lock.

No functional change intended.

(riastradh)

2022-08-20 14:08:38 UTC MAIN commitmail json YAML

usbnet(9): Limit scope of core lock to mii and tick scheduling.

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.

(riastradh)

2022-08-20 14:08:27 UTC MAIN commitmail json YAML

usbnet(9): Call mii_down once we've finished with mii_tick.

(riastradh)

2022-08-20 14:08:17 UTC MAIN commitmail json YAML

usbnet(9): Simplify core lock use in usbnet_tick_task.

(riastradh)

2022-08-20 14:08:05 UTC MAIN commitmail json YAML

usbnet(9): Call uno_tick before mii stuff.

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.

(riastradh)

2022-08-20 14:07:53 UTC MAIN commitmail json YAML

usbnet(9): Assert core lock is held on usbnet_set_link.

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.)

(riastradh)

2022-08-20 14:06:21 UTC MAIN commitmail json YAML

usbnet(9): Split unp_stopping into stopped/txstopped/rxstopped.

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.

(riastradh)

2022-08-20 14:06:09 UTC MAIN commitmail json YAML

usbnet(9): Don't touch unp_stopping in usbnet_pipe_intr.

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.

(riastradh)

2022-08-20 14:05:58 UTC MAIN commitmail json YAML

usbnet(9): Omit needless un->un_intr test in usbnet_pipe_intr.

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.

(riastradh)

2022-08-20 14:05:22 UTC MAIN commitmail json YAML

ifnet(9): On if_deactivate, don't make null if_slowtimo nonnull.

Fixes crash on detach.

(riastradh)

2022-08-20 12:42:51 UTC MAIN commitmail json YAML

ifnet(9): Kernel lock for struct ifnet::if_timer.

(riastradh)

2022-08-20 12:30:00 UTC MAIN commitmail json YAML

usbnet(9): Revert previous -- usbnet_media_upd does have IFNET_LOCK.

Not sure why I thought otherwise.

(riastradh)

2022-08-20 12:28:25 UTC MAIN commitmail json YAML

usbnet(9): Avoid ether_mediachange if stopped.

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

(riastradh)

2022-08-20 11:42:50 UTC MAIN commitmail json YAML

sys/dev/Makefile: Split INCS onto separate lines for ease of sorting.

Also sort.

(riastradh)

2022-08-20 11:34:08 UTC MAIN commitmail json YAML

fpu_kern_enter/leave: Disable IPL assertions.

These don't work because mutex_enter/exit on a spin lock may raise an
IPL but not lower it, if another spin lock was already held.  For
example,

mutex_enter(some_lock_at_IPL_VM);
printf("foo\n");
fpu_kern_enter();
...
fpu_kern_leave();
mutex_exit(some_lock_at_IPL_VM);

will trigger the panic, because printf takes a lock at IPL_HIGH where
the IPL wil remain until the mutex_exit.  (This was a nightmare to
track down before I remembered that detail of spin lock IPL
semantics...)

(riastradh)

2022-08-20 11:32:20 UTC MAIN commitmail json YAML

usbdi(9): Nix resurrected usbd_request_async.

We killed this back in 2013, but it came back from the dead on a
driver imported from OpenBSD.

(riastradh)

2022-08-20 11:32:08 UTC MAIN commitmail json YAML

umb(4): Use usbd_do_request as drivers are intended to do.

(riastradh)

2022-08-20 11:31:39 UTC MAIN commitmail json YAML

nvme(4): Read cqe flags and cid in that order.

(riastradh)

2022-08-20 11:27:09 UTC MAIN commitmail json YAML

sys/uuid.h: sys/stdint.h suffices for uintN_t.

(riastradh)

2022-08-20 11:12:46 UTC MAIN commitmail json YAML

mii(4): Make mii_down wait for concurrent mii_phy_auto to finish.

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.

(riastradh)

2022-08-20 11:09:41 UTC MAIN commitmail json YAML

ifnet(9): Add sysctl net.interaces.ifN.watchdog.trigger.

For interfaces that use if_watchdog, this forces it to be called at
the next tick.

(riastradh)

2022-08-20 11:09:24 UTC MAIN commitmail json YAML

ifnet(9): Defer if_watchdog (a.k.a. if_slowtimo) to workqueue.

This is necessary to make mii_down and the *_init/stop routines that
call it to sleep waiting for MII callouts on other CPUs.

Mark the workqueue and callout MP-safe; only take the kernel lock
around the callback.

No kernel bump despite change to struct ifnet because the change is
ABI-compatible and using the callout outside net/if.c has never been
kosher.

(riastradh)

2022-08-20 10:55:28 UTC MAIN commitmail json YAML

2022-08-20 10:55:03 UTC MAIN commitmail json YAML

ia64/efi.h: Make st_rt/st_cfgtbl pointers, not uint64_t, per spec.

(riastradh)

2022-08-20 10:54:53 UTC MAIN commitmail json YAML

x86/efi.h: Assert size of struct efi_systbl.

(riastradh)

2022-08-20 10:54:44 UTC MAIN commitmail json YAML

arm/efi.h: Add explicit padding to efi_systbl.

(riastradh)

2022-08-20 10:54:34 UTC MAIN commitmail json YAML

arm/efi.h: Assert size of struct efi_systbl.

(riastradh)

2022-08-20 10:54:25 UTC MAIN commitmail json YAML

ia64: Make ct_data void *, not uint64_t, as in spec.

(riastradh)

2022-08-20 10:35:50 UTC MAIN commitmail json YAML

ia64: Use uint64_t, not void *, for EFI virtual addresses, as in spec.

(riastradh)

2022-08-20 09:43:27 UTC MAIN commitmail json YAML

arm/efi.h, x86/efi.h: Fix whitespace around RCS id.

No functional change intended.

(riastradh)

2022-08-20 09:40:22 UTC MAIN commitmail json YAML

ia64/efi.h: Fix whitespace.  No functional change intended.

(riastradh)

2022-08-20 09:40:13 UTC MAIN commitmail json YAML

arm/efi.h: Fix whitespace.  No functional change intended.

(riastradh)

2022-08-20 09:40:04 UTC MAIN commitmail json YAML

x86/efi.h: Fix whitespace.  No functional change intended.

(riastradh)

2022-08-20 09:09:07 UTC MAIN commitmail json YAML

2022-08-20 06:47:28 UTC MAIN commitmail json YAML

It is possible to overflow the (low 32bit) HPET counter between hpet_attach
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.

(mlelstv)

2022-08-20 01:02:44 UTC MAIN commitmail json YAML

wsfb: Disable broken DGA support:
- dga(1) crashes X server since pScrn->AdjustFrame is NULL.
- If nop is provided as pScrn->AdjustFrame, dga(1) crashes X server *AND*
  kernel. This is because DGA uses physical address of framebuffer via
  /dev/mem (oops!), but we provide only mmap(2)'ed virtual address.

(rin)

2022-08-19 21:37:12 UTC MAIN commitmail json YAML

gcc-12.2.0 out

(wiz)

2022-08-19 19:40:39 UTC MAIN commitmail json YAML

2022-08-19 19:13:04 UTC MAIN commitmail json YAML

tests/lint: demonstrate wrong warning about bit-shift

(rillig)

2022-08-19 15:55:37 UTC MAIN commitmail json YAML

xdm: Include "sbin" directories (and games) in DEF_USER_PATH.

Upstream's configure.ac picks a DEF_USER_PATH on a per-OS basis.

Most of these include the "sbin" directories, with NetBSD being the
(only?) exception.

However, this is inconsistent with the way a typical login shell is
initialized (when using the default skeleton files).  To avoid user
confusion, harmonize DEF_USER_PATH with our other defaults and with
other OSes.

PR xsrc/54851

(nia)

2022-08-19 13:37:03 UTC MAIN commitmail json YAML

Improve the description of the read builtin command.

(kre)

2022-08-19 12:52:32 UTC MAIN commitmail json YAML

Don't output the error for bad usage (no var name given)
after already writing the prompt (set with the -p option).

That results in nonsense like:

$ read -p foo
fooread: arg count

While here, improve the error message so it means something.

Now we will get:

$ read -p foo
read: variable name required
Usage: read [-r] [-p prompt] var...

[Detected by code reading while doing the work for the previous fix]

(kre)

2022-08-19 12:49:55 UTC MAIN commitmail json YAML

sys/uuid.h: Need sys/types.h for uintN_t.

(riastradh)

2022-08-19 12:17:18 UTC MAIN commitmail json YAML

PR bin/56972  Fix escape ('\') handling in sh read builtin.

In 1.35 (March 2005) (the big read fixup), most escape handling and IFS
processing in the read builtin was corrected.  However 2 cases were missed,
one is a word (something to be assigned to any variable but the last) in
which every character is escaped (the code was relying on a non-escaped char
to set the "in a word" status), and second trailing IFS whitespace at
the end of the line was being deleted, even if the chars had been escaped
(the escape chars are no longer present).

See the PR for more details (including the case that detected the problem).

After fixing this, I looked at the FreeBSD code (normally might do it
before, but these fixes were trivial) to check their implementation.
Their code does similar things to ours now does, but in a completely
different way, their read builtin is more complex than ours needs to
be (they handle more options).  For anyone tempted to simply incorporate
their code, note that it relies upon infrastructure changes elsewhere
in the shell, so would not be a simple cut and drop in exercise.

This needs pullups to -3 -4 -5 -6 -7 -8 and -9 (fortunately this is
happening before -10 is branched, so will never be broken this way there).

(kre)

2022-08-19 08:17:32 UTC MAIN commitmail json YAML

Fixed a bug that pte's __BIT(63,48) could be set when accessing addresses above 0x0001000000000000 in /dev/mem with mmap().

(ryo)

2022-08-19 07:52:22 UTC MAIN commitmail json YAML

2022-08-19 07:48:43 UTC MAIN commitmail json YAML

softc member naming consistency with wm(4). (Taylor made me do it... not
really)

(skrll)

2022-08-19 07:45:50 UTC MAIN commitmail json YAML

When accessed in mmap by the device pager, pmap_enter() may be called with prot == PROT_WRITE.

(ryo)

2022-08-19 07:43:54 UTC MAIN commitmail json YAML

Should be checking ifp->if_flags in bge_init and not sc->bge_if_flags.

Spotted by Taylor.

(skrll)

2022-08-19 00:50:09 UTC MAIN commitmail json YAML

installboot(8): Note relation to UEFI boot and hybrid images.

(riastradh)

2022-08-19 00:45:55 UTC MAIN commitmail json YAML

installboot(8): Fix capitalization of U-Boot.

(riastradh)

2022-08-19 00:40:20 UTC MAIN commitmail json YAML

ching(6): Fix formatting.  .Pp is not .br

The man returns to the proper path.  Auspicious.

(uwe)

2022-08-18 14:10:05 UTC MAIN commitmail json YAML

sh(1): Allow an explicit set -o vi or set -o emacs to override ~/.editrc

(nia)

2022-08-18 12:25:32 UTC MAIN commitmail json YAML

Use NULL instead of 0.

(msaitoh)

2022-08-18 11:05:02 UTC MAIN commitmail json YAML

fix whitespace prefix behavior

(christos)

2022-08-18 05:37:05 UTC MAIN commitmail json YAML

tests/make: fix test for option '-q' in ATF mode

When running 'make test' in usr.bin/make, MAKE is set to '$PWD/make',
and when that file is used as a dependency, everything works as
expected.

When running the tests via ATF, MAKE is set to simply 'make', based on
argv[0].  Using 'make' as a dependency searches in the current directory
but not in /usr/bin, so the file is not found, which makes the
"up-to-date" target out of date.

Switch the dependeny from ${MAKE} to ${MAKEFILE}, as that file does not
involve any $PATH magic and is also guaranteed to be older than the
'up-to-date' file that is created while running the test.

(rillig)

2022-08-17 23:36:48 UTC MAIN commitmail json YAML

Revert to previous as the atf tests are still failing.

(nat)

2022-08-17 22:27:17 UTC MAIN commitmail json YAML

sh(1): Assign the tab completion key binding last so a user having
"bind -v" or "bind -e" in ~/.editrc doesn't cause tab completion
to no longer function.

(nia)

2022-08-17 20:10:29 UTC MAIN commitmail json YAML

2022-08-17 20:05:41 UTC MAIN commitmail json YAML

tests/make: demonstrate wrong exit status for '-q' (since 1994)

Reported by Jeroen Ruigrok van der Werven via private mail.

(rillig)

2022-08-17 20:03:05 UTC MAIN commitmail json YAML

uhci(4): Fix wrong lock in callout_halt in uhci_suspend.

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...

(riastradh)

2022-08-17 19:56:28 UTC MAIN commitmail json YAML

if.c: fix typo in comment

(rillig)

2022-08-17 19:13:05 UTC MAIN commitmail json YAML

Add bwtwo0 config on P4 cgfour overlay plane on 3/80, as 3/60 in bw2.sun3.

Note the ancient Xsun server supports multiple framebuffers with both
cgfour (at DISPLAY :0) and overlay bwtwo (at DISPLAY :0.1).

(tsutsui)

2022-08-17 16:43:50 UTC netbsd-9 commitmail json YAML

2022-08-17 16:43:01 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by chs in ticket #1501):

sys/kern/uipc_sem.c: revision 1.60

when updating the per-uid "semcnt", decrement the counter for the uid
that created the ksem, not the uid of the process freeing the ksem.
fixes PR 55509.

(martin)

2022-08-17 14:32:34 UTC MAIN commitmail json YAML

Add support for fetching and using the Global Time Zone fork of tzdata
in addition to the older (Eggert) version.  The GTZ vesion is the one
we're currently using, so automating its use helps.

While here, correctly compare version numbers, correctly handling the
almost unthinkable need for a multi-char suffix after the year as the
version ID.  This was almost correct before, but would have failed in
the case that 9999za was being updated to 10000a

And add the ability (should not be needed often) to fetch one version
but claim to be using another (this was useful this time, as 2022c
followed quickly on the heels of 2022b - but made no changes at all
to the data, just some of the build infrastructure we don't use).
The GTZ version hadn't been updated (there was no real need, since the
data, which is all that it alters, had not changed) at the time, so
we updated to 2022c using the gtz data file for 2022b.  (The 2022cgtz
data file now exists - but didn't then).

(kre)

2022-08-17 14:03:05 UTC MAIN commitmail json YAML

Add Europe/Kyiv to the sets list - fix the builds.  Apologies...

(kre)

2022-08-17 12:35:11 UTC MAIN commitmail json YAML

Use existing address when setting parameters.

No need to specify address every time when setting broadcast address or
netmask.

Hopefully successfully re addresses PR bin/10911.

(nat)

2022-08-17 12:25:47 UTC MAIN commitmail json YAML

Balance the parentheses in the previous update...

(kre)

2022-08-17 12:24:42 UTC MAIN commitmail json YAML

2022-08-17 12:19:41 UTC MAIN commitmail json YAML

2022-08-17 09:32:56 UTC MAIN commitmail json YAML

PR/56967: John Zaitseff: Reduce diff with FreeBSD, fixes various bugs.

(christos)

2022-08-16 22:44:06 UTC MAIN commitmail json YAML

2022-08-16 22:31:24 UTC MAIN commitmail json YAML

Revert to previous as atf tests were failing.

(nat)

2022-08-16 21:52:00 UTC MAIN commitmail json YAML

move \n where it's supposed to be
now fonts wider than 8 are dumped correctly

(macallan)

2022-08-16 21:32:21 UTC MAIN commitmail json YAML

fix tpyo - now we draw characters with a smaller bounding box than the
character cell correctly, like term14.bdf

(macallan)

2022-08-16 21:28:53 UTC MAIN commitmail json YAML

add -d option to dump rendered characters to the console

(macallan)

2022-08-16 21:23:37 UTC MAIN commitmail json YAML

KERNEL_LOCK(9): Fix previous for non-LOCKDEBUG builds.

(riastradh)

2022-08-16 20:27:33 UTC MAIN commitmail json YAML

- convert remaining error output to err()
- suppress console output unless -v is specified

(macallan)

2022-08-16 18:13:09 UTC MAIN commitmail json YAML

KERNEL_LOCK(9): Record kernel lock holder in fast path too.

(riastradh)

2022-08-16 16:25:17 UTC MAIN commitmail json YAML

KERNEL_LOCK(9): Need kpreempt_disable to ipi_send, oops.

(riastradh)

2022-08-16 14:09:27 UTC netbsd-6 commitmail json YAML

Remove commits to wrong branch.

(skrll)

2022-08-16 14:00:03 UTC MAIN commitmail json YAML

2022-08-16 13:59:18 UTC MAIN commitmail json YAML

Multiple inclusion protection.

(skrll)

2022-08-16 13:57:29 UTC MAIN commitmail json YAML

2022-08-16 13:55:15 UTC netbsd-6 commitmail json YAML

Multiple inclusion protection.

(skrll)

2022-08-16 13:52:58 UTC netbsd-6 commitmail json YAML

2022-08-16 13:50:55 UTC MAIN commitmail json YAML

2022-08-16 13:23:12 UTC MAIN commitmail json YAML

Change the NEWS parser to handle the more recent (as in going back several
years now) format (wording) that is used there, rather than that which
preceded it.  With this we get the intended "what changed" in the generated
CVS commit message, rather than lots of emptiness.

(kre)

2022-08-16 13:19:42 UTC MAIN commitmail json YAML

Correct a typo in a comment.  NFC.

(kre)

2022-08-16 11:09:08 UTC MAIN commitmail json YAML

2022-08-16 11:07:40 UTC MAIN commitmail json YAML

Welcome to tzcode-2022c

Work around a bug in onetrueawk that broke commands like
'make traditional_tarballs' on FreeBSD, macOS, etc.
(Problem reported by Deborah Goldsmith.)

Add code to tzselect that uses experimental structured comments in
zone1970.tab to clarify whether Zones like Africa/Abidjan and
Europe/Istanbul cross continent or ocean boundaries.
(Inspired by a problem reported by Peter Krefting.)

Fix bug with 'zic -d /a/b/c' when /a is unwritable but the
directory /a/b already exists.

Remove zoneinfo2tdf.pl, as it was unused and triggered false
malware alarms on some email servers.

(christos)

2022-08-16 10:56:22 UTC MAIN commitmail json YAML

Welcome to 2022b:

zic has a new option '-R @N' to output explicit transitions < N.
(Need suggested by Almaz Mingaleev.)

'zic -r @N' no longer outputs bad data when N < first transition.
(Problem introduced in 2021d and reported by Peter Krefting.)

zic now checks its input for NUL bytes and unterminated lines, and
now supports input line lengths up to 2048 (not 512) bytes.

gmtime and related code now use the abbreviation "UTC" not "GMT".
POSIX is being revised to require this.

When tzset and related functions set vestigial static variables
like tzname, they now prefer specified timestamps to unspecified ones.
(Problem reported by Almaz Mingaleev.)

zic no longer complains "can't determine time zone abbreviation to
use just after until time" when a transition to a new standard
time occurs simultanously with the first DST fallback transition.

(christos)

2022-08-16 10:47:11 UTC MAIN commitmail json YAML

No need address every time to specify broadcast and netmask.

Previously ifconfig would fail silently.

Addresses PR bin/10911.

(nat)

2022-08-16 10:24:17 UTC MAIN commitmail json YAML

crashme(9): New kernel_lock_spinout crasher.

This assumes that something will eventually try to take the kernel
lock and, after spinning for a while, spin out and crash -- so for
now it's only enabled under LOCKDEBUG, without which the kernel lock
spins forever.

(riastradh)

2022-08-16 09:03:04 UTC MAIN commitmail json YAML

whitespace changes from tzcode2022a->tzcode2022b

(christos)

2022-08-16 08:42:25 UTC MAIN commitmail json YAML

Provide pci_intr_setattr (which does nothing atm)

(skrll)

2022-08-16 08:40:34 UTC MAIN commitmail json YAML

Use designated initializers for hppa_pci_chipset_tag structs.

(skrll)

2022-08-16 08:35:38 UTC MAIN commitmail json YAML

Trailing whitespace

(skrll)

2022-08-16 04:35:57 UTC MAIN commitmail json YAML

micro optimaize for pfil_run_hooks(), ok'ed by ozaki-r@n.o and ryo@n.o.

That can improve IPv4 forwarding throughput 5% - 10%.

(knakahara)

2022-08-16 00:44:20 UTC MAIN commitmail json YAML

usbnet(9): Omit needless usbnet_core_mutex function.

While here, use inline, not __inline__, since this is not a header
file where inline might be redefined by the user.

(riastradh)

2022-08-16 00:26:40 UTC MAIN commitmail json YAML

KERNEL_LOCK(9): Send an IPI to print holder's stack trace on spinout.

(riastradh)

2022-08-15 18:06:04 UTC MAIN commitmail json YAML

Remove stray debug line (already commented out)

(pgoyette)

2022-08-15 12:16:25 UTC MAIN commitmail json YAML

Rework avdma to fix PR port-mac68k/56131 as well as add synchronous
transfer support.

According to analysis by Michael Zucca, PSC (DMAC for Quadra/Centris AV)
seems to require that DMA buffer is
  (1) aligned to 16-byte boundaries, and
  (2) multiple of 16 bytes in size.
If the buffer does not satisfy these constraints, esp.c rev 1.63 and
prior carry out partial PIO to align or shave off it.

However, partial PIO does not always work correctly for combination of
NCR53C94 and PSC, which results in failures observed as port-mac68k/56131.

Also, PIO spoils synchronous transfer, which is timing critical.

Therefore, for buffers that do not satisfy the boundary conditions,
completely stop using PIO and use DMA with ``bounce'' buffers.

This fixes port-mac68k/56131 and enables sync transfer as a big bonus.

Note that bounce DMA does not hurt performance at all. For filesystem
and swap I/O, buffers always satisfy the constraints above, and bounce
DMA is necessary only
  (a) when disk is attached, or
  (b) for special utilities like fsck(8) or fdisk(8),
as far as I can tell.

Also:

- Stop providing ``DMA-friendly'' sc_imess and sc_omess; transfer for
  MSGIN or MSGOUT does not almost certainly satisfy boundary condition
  (2). Again, this does not affect performance at all.

- SCSI bus frequency is 20MHz (i.e., 5MB/s for sync transfer) for AV
  models, according to ``Quadra 840AV Service Source''.

(rin)

2022-08-15 11:55:52 UTC MAIN commitmail json YAML

nuke pasto in gffb_init()

(macallan)

2022-08-15 11:43:56 UTC MAIN commitmail json YAML

workqueue(9): workqueue_wait and workqueue_destroy may sleep.

But might not, so assert sleepable up front.

(riastradh)

2022-08-15 11:29:53 UTC MAIN commitmail json YAML

Remove stray newline. No binary changes.

(rin)

2022-08-15 11:22:45 UTC MAIN commitmail json YAML

For avdma, bus_dmamap_create(9) with nsegments = 1, as PSC supports
only one physically contiguous segment in a single DMA transaction.

Slightly improves performance.

(rin)

2022-08-15 11:18:12 UTC MAIN commitmail json YAML

Minor cosmetic changes. NFC.

- Use switch instead of if-else-if chain.
- Dedup codes a bit.

(rin)

2022-08-15 10:15:59 UTC MAIN commitmail json YAML

nvme(4): KASSERT(A && B) -> KASSERT(A); KASSERT(B)

(riastradh)

2022-08-15 10:06:00 UTC MAIN commitmail json YAML

build.sh: improve help and usage

Split help into synopsis and help.
Only display the synopsis for usage errors (not the full help).
Print usage errors to stderr not stdout.
Don't print a usage error for -? before the help message.
Improve error messages for unknown options and missing arguments.
Remove trailing "." present in some error messages.
Alway use 'quote' instead of `quote' in some error messages.

(lukem)

2022-08-15 09:44:19 UTC MAIN commitmail json YAML

force software fallback for drawing rectangles into offscreen memory only
on NV_ARCH_40 and up

(macallan)

2022-08-15 08:28:41 UTC MAIN commitmail json YAML

Fix stall on PPPOE_STATE_PADR_SENT, suggested by martin@n.o, thanks.

Just drop such large PADO frames, ok'ed by yamaguchi@n.o.

I left if_pppoe.c:r1.182 code because that fixes other issues such as
pppoe(4) stall in PPPOE_STATE_PADR_SENT when the PADO sender never
replys.

(knakahara)

2022-08-15 04:58:52 UTC MAIN commitmail json YAML

Regen from MILAN.in rev 1.30.

> Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.

(tsutsui)

2022-08-15 04:40:20 UTC MAIN commitmail json YAML

Specify options FONT_VT220L8x16 to get similar glyphs as past font_8x16.c.

(tsutsui)

2022-08-15 04:37:47 UTC MAIN commitmail json YAML

Improve VGA console settings for Milan, especially for sysinst.

- use explicit WSDISPLAY_FONTENC_IBM font that MI vga(4) assumes
  (so that box drawing characters are rendered properly)
- set ATC and DAC palette settings for proper colors
  (copied from MI vga_subr.c for now because HADES doesn't use mi vga(4))

Tested on Milan with S3 Trio64.  (XXX: needs working HADES with ET4000)

(tsutsui)

2022-08-14 23:09:30 UTC MAIN commitmail json YAML

x86/genfb: Disable shadowfb by default.

The motivation for this was obviated by mapping the framebuffer
write-combining instead of uncacheable.

If this still appears to be needed, most likely the mapping is still
wrong and that should be fixed directly, or this should be enabled
only in the circumstances where the mapping can't be made right.

(riastradh)

2022-08-14 22:11:20 UTC MAIN commitmail json YAML

make(1): mark up the variable expansion example

(uwe)

2022-08-14 21:57:27 UTC MAIN commitmail json YAML

make(1): use .Dl for .MAKE.JOB.PREFIX examples

(uwe)

2022-08-14 21:53:58 UTC MAIN commitmail json YAML

make(1): prettify .for index variable example

(uwe)

2022-08-14 21:48:05 UTC MAIN commitmail json YAML

make(1): more .Va fixes

(uwe)

2022-08-14 20:34:26 UTC MAIN commitmail json YAML

mii(4): Wait for MIIF_DOINGAUTO to clear with MIIF_AUTOTSLEEP too.

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 *.

(riastradh)

2022-08-14 20:33:57 UTC MAIN commitmail json YAML

mii(4): Sprinkle assertions in mii phy auto timeout.

(riastradh)

2022-08-14 20:19:28 UTC MAIN commitmail json YAML

make(1): mark up FRC in BUGS

(uwe)

2022-08-14 20:07:18 UTC MAIN commitmail json YAML

make(1): Use .Dq instead of literal ASCII quotes

(uwe)

2022-08-14 20:04:07 UTC MAIN commitmail json YAML

make(1): Be consistent about using .Va for make variables

(uwe)

2022-08-14 19:26:39 UTC MAIN commitmail json YAML

make.1: fix accidental removal of the directive 'export'

(rillig)

2022-08-14 19:12:23 UTC MAIN commitmail json YAML

usbd_do_request_async got deleted back in 2013 so remove the commented out
reference to it here.

(skrll)

2022-08-14 12:08:57 UTC MAIN commitmail json YAML

nvme: Make sure that q_ccb_list is always accessed with the q lock held.

(jmcneill)

2022-08-14 11:26:41 UTC MAIN commitmail json YAML

2022-08-14 10:14:58 UTC MAIN commitmail json YAML

make(1): more .Ar fixes

(uwe)

2022-08-14 10:13:06 UTC MAIN commitmail json YAML

Add bge(4) to the list of drivers that take advantage of NET_MPSAFE

(nia)

2022-08-14 10:07:58 UTC MAIN commitmail json YAML

doc: Recent changes from various

(nia)

2022-08-14 10:06:54 UTC MAIN commitmail json YAML

virtio(4): Print numeric device type, even if unrecognized.

(riastradh)

2022-08-14 09:47:29 UTC MAIN commitmail json YAML

make(1): ".../" in -m option description is literal ".../"

(uwe)

2022-08-14 09:11:33 UTC MAIN commitmail json YAML

make(1): Consistent formatting for -i and -s descriptions.

(uwe)

2022-08-14 09:08:29 UTC MAIN commitmail json YAML

make(1): Fix markup of the -d[flags] section.

The debug flags are literals, not syntactic variables (.Ar).
While here use .Dq for quoted words in the text.

(uwe)

2022-08-14 09:04:17 UTC MAIN commitmail json YAML

bge: Use BUS_DMA_WAITOK in attach routines.

(skrll)

2022-08-14 09:03:05 UTC MAIN commitmail json YAML

bge: Mirror the bus_dma RX buffer changes in the OpenBSD driver

This change reduces the amount of work done in the interrupt handler.

(skrll)

2022-08-14 09:01:25 UTC MAIN commitmail json YAML

Make bge(4) MP safe

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.

(skrll)

2022-08-14 08:51:41 UTC MAIN commitmail json YAML

build.sh: improve help versus usage

Rework help / usage semantics:
- send help to stdout, exit 0.
- send usage to stderr, exit 1.

(lukem)

2022-08-14 08:49:00 UTC MAIN commitmail json YAML

make(1): Fix some obviously wrong uses of .Va

(uwe)

2022-08-14 08:45:56 UTC MAIN commitmail json YAML

2022-08-14 08:42:33 UTC MAIN commitmail json YAML

bge: Fix bge_ring_map bus_dmamap_sync POST{READ,WRITE} operations.

When the range of ring entries wraps around sync from the start of the
ring to the last entry.

(skrll)

2022-08-14 07:49:33 UTC MAIN commitmail json YAML

Split TSC calibtration into many small steps and disable interrupts
for each step. Also add debug messages.

(mlelstv)

2022-08-14 04:17:09 UTC MAIN commitmail json YAML

make.1: clean up formatting and grammar, be more accurate

(rillig)

2022-08-14 04:12:29 UTC MAIN commitmail json YAML

make.1: not every '-' is a flag

(rillig)

2022-08-13 21:51:33 UTC MAIN commitmail json YAML

pciconf: Skip callbacks for reserved ranges if resource allocation fails.

In the event that a BAR write is ignored, no need to notify the callback
of any changes.

(jmcneill)

2022-08-13 20:08:36 UTC MAIN commitmail json YAML

Add "nopcimsi" boot option to force legacy INTx only mode.

(jmcneill)

2022-08-13 20:07:13 UTC MAIN commitmail json YAML

arm: acpi: Improve legacy INTx support.

For devices on a bus with no direct _PRT, use the raw intr pin with the
parent bridge's slot number to derive a pin number that can be used to
lookup the pin -> irq mapping in the parent bus's _PRT.

(jmcneill)

2022-08-13 17:46:26 UTC MAIN commitmail json YAML

When run from py-anita/amd64 this test fails with:

  cgdconfig: getfsspecname failed: no match for `wd0e'

as the virtual machine has root on dk0, dk0 at wd0 and trying to
open wd0e fails.

This tests runs without a rump kernel and therefore should not
even try to open configured devices on the host.  Replace the
disks "wd0e" and "ld1e" with non-existant disks "dska" and "dskb".

(hannken)

2022-08-13 17:31:32 UTC MAIN commitmail json YAML

viocon(4): Omit unused sc_dmamap.

(riastradh)

2022-08-13 17:31:21 UTC MAIN commitmail json YAML

viocon(4): Fix bus_dmamap_sync after tx: POSTWRITE, not POSTREAD.

(riastradh)

2022-08-13 17:06:55 UTC MAIN commitmail json YAML

Remove Li without effect.

(wiz)

2022-08-13 17:06:38 UTC MAIN commitmail json YAML

2022-08-13 17:02:53 UTC MAIN commitmail json YAML

viocon(4): Fix $NetBSD$ rcsid.

(riastradh)

2022-08-13 17:02:10 UTC MAIN commitmail json YAML

Fix Dd argument.

(wiz)

2022-08-13 16:55:10 UTC MAIN commitmail json YAML

aarch64: Add tpm driver to GENERIC64 kernel.

(jmcneill)

2022-08-13 16:52:29 UTC MAIN commitmail json YAML

viocon(4): Fix tty device number.

(riastradh)

2022-08-13 16:44:11 UTC MAIN commitmail json YAML

acpipchb: Add a kernel cmdline option to skip PCI resource assignment.

Passing "nopciconf" to the kernel will force acpipchb to skip PCI
resource assignment.

(jmcneill)

2022-08-13 16:01:35 UTC MAIN commitmail json YAML

Process "ranges" property even when linux,pci-probe-only is set.

When the linux,pci-probe-only flag is set, we still need to process the
ranges property to determine whether or not to set PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_OKAY flags on the bus.

(jmcneill)

2022-08-13 10:53:38 UTC MAIN commitmail json YAML

Update comment about X11 support

(jandberg)

2022-08-13 09:34:47 UTC MAIN commitmail json YAML

Do not try to create a fake MBR disklabel from the PMBR of a GPT disk.

(martin)

2022-08-13 07:22:41 UTC MAIN commitmail json YAML

audiotest: Add two tests for AUDIO_SETINFO after mmap.
These tests affect only standalone test, not atf.

(isaki)

2022-08-13 07:19:16 UTC MAIN commitmail json YAML

audiotest: Fix typo in comments.

(isaki)

2022-08-13 07:14:40 UTC MAIN commitmail json YAML

audiotest: Separate mmap_len test by parameters.
This change affects only standalone test, not atf.

(isaki)

2022-08-13 06:59:56 UTC MAIN commitmail json YAML

Fix an inverted KASSERTMSG test from the #ifdef DIAGNOSTIC panic -> KASSERT
conversion.

(skrll)

2022-08-13 06:47:41 UTC MAIN commitmail json YAML

audio: Rework about usrbuf allocation.
- 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.

(isaki)

2022-08-12 21:25:39 UTC MAIN commitmail json YAML

specfs: Refuse to open a closing-in-progress block device.

We could wait for close to complete, but if this happened ever so
slightly earlier it would lead to EBUSY anyway, so there's no point
in adding logic for that -- either way the caller neglected to wait
for the last close to finish before trying to open it the device
again.

https://mail-index.netbsd.org/current-users/2022/08/09/msg042800.html

Reported-by: syzbot+4388f20706ec8a4c8db0@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=47c67ab6d3a87514d0707882a9ad6671beaa8642

Reported-by: syzbot+0f1756652dce4cb341ed@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=a632ce762d64241fc82a9bc57230b7b7c7095d1a

(riastradh)

2022-08-12 19:13:36 UTC MAIN commitmail json YAML

rum(4): Avoid uninitialized garbage in failed register read.

Reported-by: syzbot+f2cba71b1b1bc91029b3@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=7a01863d0fe34a4946516388c436991ba2beaa63

(riastradh)

2022-08-12 17:06:01 UTC MAIN commitmail json YAML

specfs: Assert !closing on successful open.

- If there's a prior concurrent close, it must have interrupted this
  open.

- If there's a new concurrent close, it must wait until this open has
  released device_lock before it can revoke.

(riastradh)

2022-08-12 17:05:49 UTC MAIN commitmail json YAML

specfs: Assert opencnt>0 on successful open.

(riastradh)

2022-08-12 16:21:41 UTC MAIN commitmail json YAML

thinkpad(4): Don't detach on shutdown.

There's no important state that needs to be recorded, or resources
that need to be relinquished, so detach-on-shutdown isn't necessary.

At the moment, detach-on-shutdown is actually harmful here: if
shutdown is triggered by a sysmon power switch event, then
config_detach will be called from the sysmon taskqueue, but
thinkpad_detach has to wait for ACPI notifiers to finish running
which means waiting for the sysmon taskqueue -> deadlock or crash.

We should maybe arrange to do config_detach from a thread other than
the sysmon taskqueue thread to avoid this class of problems -- but
for now, thinkpad(4) has no reason to detach on shutdown anyway, so
let's take the easy path.

Note: There are many drivers that set DVF_DETACH_SHUTDOWN which
probably shouldn't; the flag means the kernel _will_ detach on
shutdown, not that it _may_.  Even those that do need to record state
or relinquish resources might be better served by pmf shutdown hooks
which can skip freeing software resources for faster shutdown.

(riastradh)

2022-08-12 16:16:12 UTC MAIN commitmail json YAML

autoconf(9): Provide diagnostics for config_detach_* misuse.

(riastradh)

2022-08-12 15:43:38 UTC MAIN commitmail json YAML

module(9), sysctl(7): Document kern.module.autounload_unsafe.

(riastradh)

2022-08-12 15:30:41 UTC MAIN commitmail json YAML

usbnet(9): Tidy up language about init/rx/tx/stop in man page.

(riastradh)

2022-08-12 15:20:07 UTC netbsd-8 commitmail json YAML

2022-08-12 15:19:24 UTC netbsd-9 commitmail json YAML

2022-08-12 15:18:13 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by mrg in ticket #1500):

sys/dev/raidframe/rf_driver.c: revision 1.140 (patch)
sys/dev/raidframe/rf_disks.c: revision 1.93 (patch)
sys/dev/raidframe/rf_netbsdkintf.c: revision 1.408 (patch)

raidframe: reject invalid values for numCol and numSpares

numCol and numSpares are "int" so they can be "-1" internally,
which means negative values need to be rejected, as well as
values higher than RF_MAXCOL/RF_MAXSPARES.
explicitly nul-terminate all strings coming from userland.

some minor CSE that avoids signed arith.

this fixes issues in the RAIDFRAME_ADD_HOT_SPARE,
RAIDFRAME_CONFIGURE, RAIDFRAME_DELETE_COMPONENT,
RAIDFRAME_INCORPORATE_HOT_SPARE, and RAIDFRAME_REBUILD_IN_PLACE
ioctl commands.

ok oster@ riastradh@

(martin)

2022-08-12 15:17:10 UTC MAIN commitmail json YAML

module(9): Don't autounload unaudited modules by default.

Modules that have not been audited for autounload safety don't
recognize the command MODULE_CMD_AUTOUNLOAD and return ENOTTY.  These
modules are not safe to autounload, so don't autounload them.  Since
unload is risky business (if not careful, can lead to use-after-free,
kernel memory corruption, &c.), it needs to be opt-in by default, not
opt-out.

Modules that have been audited can return 0 or EBUSY to explicitly
allow or deny autounload.  Users who want to live on the edge to try
to exercise module autounload even for unaudited modules -- and are
willing to accept the consequences, and maybe contribute to auditing!
-- can set the new sysctl knob kern.module.autounload_unsafe=1.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2022/08/08/msg028282.html

(riastradh)

2022-08-12 15:13:46 UTC netbsd-8 commitmail json YAML

Pull up following revision(s) (requested by sekiya in ticket #1755):

sys/dev/ic/dwc_gmac.c: revision 1.76-1.77

Turn off AWIN_GMAC_MAC_CONF_ACS, so that all received packets retain FCS
bytes.
ether_input() can now trust M_HASFCS to accurately represent the packet
contents.

Discussed on tech-net@

(martin)

2022-08-12 15:12:29 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by sekiya in ticket #1499):

sys/dev/ic/dwc_gmac.c: revision 1.76-1.77

Turn off AWIN_GMAC_MAC_CONF_ACS, so that all received packets retain FCS
bytes.
ether_input() can now trust M_HASFCS to accurately represent the packet
contents.

Discussed on tech-net@

(martin)

2022-08-12 15:01:26 UTC MAIN commitmail json YAML

x86/bus_dma: #ifdef DIAGNOSTIC panic -> KASSERT

While here, use some better types and avoid integer overflow in the
diagnostic tests.

No functional change intended except in the case of bugs anyway.

(riastradh)

2022-08-12 13:44:12 UTC MAIN commitmail json YAML

x86: Adjust fences issued in bus_dmamap_sync after bouncing.

And expand the comment on the lfence for POSTREAD before bouncing.

Net change:

op                      before bounce      after bounce
                                        old            new
PREREAD                nop            lfence          sfence
PREWRITE                nop            mfence          sfence
PREREAD|PREWRITE        nop            mfence          sfence
POSTREAD                lfence          lfence          nop[*]
POSTWRITE              nop            mfence          nop
POSTREAD|POSTWRITE      lfence          mfence          nop[*]

The case of PREREAD is as follows:

1. loads and stores before DMA buffer may be allocated for the purpose
2. bus_dmamap_sync(BUS_DMASYNC_PREREAD)
3. store to register or DMA descriptor to trigger DMA

The register or DMA descriptor may be in any type of memory (or I/O).

lfence at (2) is _not enough_ to ensure stores at (1) have completed
before the store in (3) in case the register or DMA descriptor lives
in wc/wc+ memory, or the store to it is non-temporal: in that case,
it may executed early before all the stores in (1) have completed.

On the other hand, lfence at (2) is _not needed_ to ensure loads in
(1) have completed before the store in (3), because x86 never
reorders load;store to store;load.  So we may need to enforce
store/store ordering, but not any other ordering, hence sfence.

The case of PREWRITE is as follows:

1. stores to DMA buffer (and loads from it, before allocated)
2. bus_dmamap_sync(BUS_DMASYNC_PREWRITE)
3. store to register or DMA descriptor to trigger DMA

Ensuring prior loads have completed is not necessary because x86
never reorders load;store to store;load (and in any case, the device
isn't changing the DMA buffer, so it's safe to read over and over
again).  But we must ensure the stores in (1) have completed before
the store in (3).  So we need sfence, in case either the DMA buffer
or the register or the DMA descriptor is in wc/wc+ memory or either
store is non-temporal.  But we don't need mfence.

The case of POSTREAD is as follows:

1. load from register or DMA descriptor notifying DMA completion
2. bus_dmamap_sync(BUS_DMASYNC_POSTREAD)
  (a) lfence [*]
  (b) if bouncing, memcpy(userbuf, bouncebuf, ...)
  (c) ???
3. loads from DMA buffer to use data, and stores to reuse buffer

This certainly needs an lfence to prevent the loads at (3) from being
executed early -- but bus_dmamap_sync already issues lfence in that
case at 2(a), before it conditionally loads from the bounce buffer
into the user's buffer.  So we don't need any _additional_ fence
_after_ bouncing at 2(c).

The case of POSTWRITE is as follows:

1. load from register or DMA descriptor notifying DMA completion
2. bus_dmamap_sync(BUS_DMASYNC_POSTWRITE)
3. loads and stores to reuse buffer

Stores at (3) will never be executed early because x86 never reorders
load;store to store;load for any memory types.  Loads at (3) are
harmless because the device isn't changing the buffer -- it's
supposed to be fixed from the time of PREWRITE to the time of
POSTWRITE as far as the CPU can witness.

Proposed on port-amd64 last month:

https://mail-index.netbsd.org/port-amd64/2022/07/16/msg003593.html

Reference:

AMD64 Architecture Programmer's Manual, Volume 2: System Programming,
24593--Rev. 3.38--November 2021, Sec. 7.4.2 Memory Barrier Interaction
with Memory Types, Table 7-3, p. 196.
https://www.amd.com/system/files/TechDocs/24593.pdf

(riastradh)

2022-08-12 13:24:37 UTC MAIN commitmail json YAML

bus_space(9): Update barrier semantics to match reality and sense.

As proposed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2022/07/16/msg028249.html

tl;dr:
- bus_space_barrier is needed only with prefetchable/cacheable.
- BUS_SPACE_BARRIER_READ is like membar_acquire.
- BUS_SPACE_BARRIER_WRITE is like membar_release.
- READ|WRITE is like membar_sync.

(riastradh)

2022-08-12 11:25:46 UTC MAIN commitmail json YAML

usbnet(9): Fix mbuf alignment and narrow bounds check.

In usbnet.c rev. 1.16, usbnet_newbuf was first passed a buffer length
to verify it fits within MCLBYTES.  It also changed m_adj to go
before, not after, setting m_len and m_pkthdr.len -- which had the
effect of making the m_adj a no-op, because after MGETHDR the mbuf
has zero length and m_adj stops at the length of the mbuf, so nothing
was aligned as intended.

To make this aligned as intended, we require the buffer length to be
_below_ MCLBYTES, by ETHER_ALIGN, so there's room for the ethernet
header in a maximum-length payload.  Once we do that, it is safe to
initialize m_len = m_pkthdr.len = ETHER_ALIGN + buflen, which is
below the actual size of the mbuf (MHLEN or MCLBYTES, depending), and
_then_ do m_adj to align the pointer.

(riastradh)

2022-08-12 11:21:44 UTC MAIN commitmail json YAML

membar(3): Fix t_spinlock for machines with hash-locked atomics.

Regular stores don't participate in the hash-locking scheme, so use
atomic_swap instead of a regular store here.

(riastradh)

2022-08-12 11:15:42 UTC MAIN commitmail json YAML

viocon(4): New virtio tty driver imported from OpenBSD.

viocon* at virtio?

/dev/ttyVI??

Tested under qemu with:

qemu-system-aarch64 ... \
  -device virtio-serial \
  -chardev socket,path=/tmp/ttyVI00,server=on,wait=off,id=ttyVI00 \
  -device virtconsole,chardev=ttyVI00,name=org.NetBSD.dev.ttyVI00 \
  ...

I updated MAKEDEV.conf to create /dev/ttyVI?? on all ports where it
looks likely to work based on:
(a) having pci or a non-pci virtio attachment,
(b) `qemu-system-$ARCH -M ?' mentioned something resembling the port,
    and
(c) `qemu-system-$ARCH -device virtio-serial' launched without
    complaining about the virtio-serial device.

(Criterion (c) excluded sparc and sparc64.)

(riastradh)

2022-08-12 10:59:42 UTC MAIN commitmail json YAML

wm(4): Remove the non-MP-safe scaffolding.

- Where we had #ifndef WM_MPSAFE splnet(), we also had WM_CORE_LOCK,
  which implies splnet, so just remove the conditional splnet.

- Make the core lock unconditional and remove macro indirections.

- Pass CALLOUT_MPSAFE, SOFTINT_MPSAFE, and WQ_MPSAFE directly without
  macro indirections.

(riastradh)

2022-08-12 10:58:45 UTC MAIN commitmail json YAML

wm(4): Audit sc->phy.acquire and sc->nvm.acquire.

The return value must be used, because some of the acquire/release
pairs hold a mutex from acquire to release, and failing to call
release, or calling release twice, leads to an inconsistent state.

(riastradh)

2022-08-12 10:58:21 UTC MAIN commitmail json YAML

wm: use a workqueue to reset the interface when wm_watchdog determines it needs a reset.

Author: Nick Hudson <skrll@netbsd.org>
Committer: Taylor R Campbell <riastradh@NetBSD.org>

(riastradh)