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 (4h)  netbsd-8 (5d)  netbsd-10 (5d)  netbsd-9 (11d)  thorpej-ifq (175d)  thorpej-altq-separation (178d) 

2024-05-10 03:13:22 UTC Now

2022-04-09 23:38:33 UTC MAIN commitmail json YAML

2022-04-09 23:36:22 UTC MAIN commitmail json YAML

alpha: Omit needless membar in pmap_reference.

If the pmap is published enough for us to obtain a reference to it
then there's no membar needed.  If it's not then something else is
wrong and we can't use pmap_reference here anyway.  Membars are
needed only on the destruction side to make sure all use, by any
thread, happens-before all freeing in the last user thread.

(riastradh)

2022-04-09 23:35:58 UTC MAIN commitmail json YAML

audio(4): Use membar_acquire, not membar_enter.

Cheaper and adequate to make an atomic_swap into a load-acquire.

(riastradh)

2022-04-09 23:34:50 UTC MAIN commitmail json YAML

mips/rmixl: Insert appropriate membars around IPIs.

(riastradh)

2022-04-09 23:34:40 UTC MAIN commitmail json YAML

mips/cavium: Insert appropriate membars around IPIs.

(riastradh)

2022-04-09 23:34:30 UTC MAIN commitmail json YAML

atomic_loadstore(9): Use membar_acquire/release.

(riastradh)

2022-04-09 23:32:53 UTC MAIN commitmail json YAML

Introduce membar_acquire/release.  Deprecate membar_enter/exit.

The names membar_enter/exit were unclear, and the documentation of
membar_enter has disagreed with the implementations on sparc,
powerpc, and even x86(!) for the entire time it has been in NetBSD.

The terms `acquire' and `release' are ubiquitous in the literature
today, and have been adopted in the C and C++ standards to mean
load-before-load/store and load/store-before-store, respectively,
which are exactly the orderings required by acquiring and releasing a
mutex, as well as other useful applications like decrementing a
reference count and then freeing the underlying object if it went to
zero.

Originally I proposed changing one word in the documentation for
membar_enter to make it load-before-load/store instead of
store-before-load/store, i.e., to make it an acquire barrier.  I
proposed this on the grounds that

(a) all implementations guarantee load-before-load/store,
(b) some implementations fail to guarantee store-before-load/store,
and
(c) all uses in-tree assume load-before-load/store.

I verified parts (a) and (b) (except, for (a), powerpc didn't even
guarantee load-before-load/store -- isync isn't necessarily enough;
need lwsync in general -- but it _almost_ did, and it certainly didn't
guarantee store-before-load/store).

Part (c) might not be correct, however: under the mistaken assumption
that atomic-r/m/w then membar-w/rw is equivalent to atomic-r/m/w then
membar-r/rw, I only audited the cases of membar_enter that _aren't_
immediately after an atomic-r/m/w.  All of those cases assume
load-before-load/store.  But my assumption was wrong -- there are
cases of atomic-r/m/w then membar-w/rw that would be broken by
changing to atomic-r/m/w then membar-r/rw:

https://mail-index.netbsd.org/tech-kern/2022/03/29/msg028044.html

Furthermore, the name membar_enter has been adopted in other places
like OpenBSD where it actually does follow the documentation and
guarantee store-before-load/store, even if that order is not useful.
So the name membar_enter currently lives in a bad place where it
means either of two things -- r/rw or w/rw.

With this change, we deprecate membar_enter/exit, introduce
membar_acquire/release as better names for the useful pair (r/rw and
rw/w), and make sure the implementation of membar_enter guarantees
both what was documented _and_ what was implemented, making it an
alias for membar_sync.

While here, rework all of the membar_* definitions and aliases.  The
new logic follows a rule to make it easier to audit:

membar_X is defined as an alias for membar_Y iff membar_X is
guaranteed by membar_Y.

The `no stronger than' relation is (the transitive closure of):

- membar_consumer (r/r) is guaranteed by membar_acquire (r/rw)
- membar_producer (w/w) is guaranteed by membar_release (rw/w)
- membar_acquire (r/rw) is guaranteed by membar_sync (rw/rw)
- membar_release (rw/w) is guaranteed by membar_sync (rw/rw)

And, for the deprecated membars:

- membar_enter (whether r/rw, w/rw, or rw/rw) is guaranteed by
  membar_sync (rw/rw)
- membar_exit (rw/w) is guaranteed by membar_release (rw/w)

(membar_exit is identical to membar_release, but the name is
deprecated.)

Finally, while here, annotate some of the instructions with their
semantics.  For powerpc, leave an essay with citations on the
unfortunate but -- as far as I can tell -- necessary decision to use
lwsync, not isync, for membar_acquire and membar_consumer.

Also add membar(3) and atomic(3) man page links.

(riastradh)

2022-04-09 22:53:53 UTC MAIN commitmail json YAML

riscv/membar_ops: Upgrade membar_enter from W/RW to RW/RW.

This will be deprecated soon but let's avoid leaving rakes to trip on
with it arising from disagreement over the documentation (W/RW) and
implementation and usage (R/RW).

(riastradh)

2022-04-09 22:53:45 UTC MAIN commitmail json YAML

x86_64/membar_ops: Upgrade membar_enter from R/RW to RW/RW.

This will be deprecated soon but let's avoid leaving rakes to trip on
with it arising from disagreement over the documentation (W/RW) and
implementation and usage (R/RW).

(riastradh)

2022-04-09 22:53:36 UTC MAIN commitmail json YAML

i386/membar_ops: Upgrade membar_enter from R/RW to RW/RW.

This will be deprecated soon but let's avoid leaving rakes to trip on
with it arising from disagreement over the documentation (W/RW) and
implementation and usage (R/RW).

(riastradh)

2022-04-09 22:53:25 UTC MAIN commitmail json YAML

sparc64/membar_ops: Upgrade membar_enter from R/RW to RW/RW.

This will be deprecated soon but let's avoid leaving rakes to trip on
with it arising from disagreement over the documentation (W/RW) and
implementation and usage (R/RW).

(riastradh)

2022-04-09 22:53:17 UTC MAIN commitmail json YAML

sparc/membar_ops: Upgrade membar_enter from R/RW to RW/RW.

This will be deprecated soon but let's avoid leaving rakes to trip on
with it arising from disagreement over the documentation (W/RW) and
implementation and usage (R/RW).

(riastradh)

2022-04-09 22:26:49 UTC MAIN commitmail json YAML

lint: ensure that lint itself compiles without lint warnings

It would be a pity if lint didn't even survive its own style checks.

(rillig)

2022-04-09 21:19:52 UTC MAIN commitmail json YAML

lint: rename dinfo_t.d_offset to d_offset_in_bits

Most often, offsets are measured in bytes, so better embed the unit in
the variable name.

No functional change.

(rillig)

2022-04-09 19:59:08 UTC MAIN commitmail json YAML

nouveau: Omit needless local patch.

This code probably once called ioread32/iowrite32 or something, but
no longer.

(riastradh)

2022-04-09 16:02:14 UTC MAIN commitmail json YAML

2022-04-09 15:43:42 UTC MAIN commitmail json YAML

2022-04-09 14:50:18 UTC MAIN commitmail json YAML

lint: split CTCONST into BOOL_CONST and ENUM_CONST

Having a unified compile-time constant "storage class" made the code
more difficult to understand.

No functional change.

(rillig)

2022-04-09 14:38:47 UTC MAIN commitmail json YAML

makefs(8): Needs -lm for ceil in udf as a host tool too.

(riastradh)

2022-04-09 14:09:32 UTC MAIN commitmail json YAML

mips/rmi: Hack to get XLSATX64.MP kernel building again.

Using <mips/asm.h> in a .c file is kinda grody but CALLFRAME_SIZ
doesn't seem to be defined anywhere else.  Not sure how this was ever
supposed to work...

(riastradh)

2022-04-09 13:38:17 UTC MAIN commitmail json YAML

lint: inline member access macros for sym_t

Having the 'u.' explicitly in the code serves as a reminder that these
members are only defined under certain conditions.

No functional change.

(rillig)

2022-04-09 13:38:15 UTC MAIN commitmail json YAML

sys/lwp.h: Nix trailing whitespace.

(riastradh)

2022-04-09 13:22:05 UTC MAIN commitmail json YAML

2022-04-09 12:49:37 UTC MAIN commitmail json YAML

ena: Fix rmb/wmb/mb to match Linux on x86 and aarch64.

This is not right but it's not worse than it was before.

(riastradh)

2022-04-09 12:07:37 UTC MAIN commitmail json YAML

aarch64/membar_ops: Fix wrong symbol end.

(riastradh)

2022-04-09 12:07:29 UTC MAIN commitmail json YAML

2022-04-09 12:07:18 UTC MAIN commitmail json YAML

x86: Omit needless store in membar_producer/exit.

On x86, every store is a store-release, so there is no need for any
barrier.  But this wasn't a barrier anyway; it was just a store,
which was redundant with the store of the return address to the stack
implied by CALL even if issuing a store made a difference.

(riastradh)

2022-04-09 12:07:01 UTC MAIN commitmail json YAML

x86: Every load is a load-acquire, so membar_consumer is a noop.

lfence is only needed for MD logic, such as operations on I/O memory
rather than normal cacheable memory, or special instructions like
RDTSC -- never for MI synchronization between threads/CPUs.  No need
for hot-patching to do lfence here.

(The x86_lfence function might reasonably be patched on i386 to do
lfence for MD logic, but it isn't now and this doesn't change that.)

(riastradh)

2022-04-09 12:06:48 UTC MAIN commitmail json YAML

sparc64: Fix membar_sync by issuing membar #StoreLoad.

In TSO this is the only memory barrier ever needed, and somehow we
got this wrong and instead issued an unnecessary membar #LoadLoad --
not needed even in PSO let alone in TSO.

XXX Apparently we may run userland programs with PSO or RMO, in which
case all of these membars need fixing:

                        PSO                    RMO
membar_consumer        nop                    membar #LoadLoad
membar_producer        membar #StoreStore      membar #StoreStore
membar_enter            nop                    membar #LoadLoad|LoadStore
membar_exit            membar #StoreStore      membar #LoadStore|StoreStore
membar_sync            membar #StoreLoad|StoreStore
                                                membar #...everything...

But at least this fixes the TSO case in which we run the kernel.
Also I'm not sure there's any non-TSO hardware out there in practice.

(riastradh)

2022-04-09 12:06:39 UTC MAIN commitmail json YAML

sparc: Fix membar_sync with LDSTUB.

membar_sync is required to be a full sequential consistency barrier,
equivalent to MEMBAR #StoreStore|LoadStore|StoreLoad|LoadLoad on
sparcv9.  LDSTUB and SWAP are the only pre-v9 instructions that do
this and SWAP doesn't exist on all v7 hardware, so use LDSTUB.

Note: I'm having a hard time nailing down a reference for the
ordering implied by LDSTUB and SWAP.  I'm _pretty sure_ SWAP has to
imply store-load ordering since the SPARCv8 manual recommends it for
Dekker's algorithm (which notoriously requires store-load ordering),
and the formal memory model treats LDSTUB and SWAP the same for
ordering.  But the v8 and v9 manuals aren't clear.

GCC issues STBAR and LDSTUB, but (a) I don't see why STBAR is
necessary here, (b) STBAR doesn't exist on v7 so it'd be a pain to
use, and (c) from what I've heard (although again it's hard to nail
down authoritative references here) all actual SPARC hardware is TSO
or SC anyway so STBAR is a noop in all the silicon anyway.

Either way, certainly this is better than what we had before, which
was nothing implying ordering at all, just a store!

(riastradh)

2022-04-09 10:05:35 UTC MAIN commitmail json YAML

2022-04-09 09:59:16 UTC MAIN commitmail json YAML

fsck_udf(8): Nix trailing whitespace.

No functional change intended.

(riastradh)

2022-04-09 09:58:12 UTC MAIN commitmail json YAML

2022-04-08 23:48:05 UTC MAIN commitmail json YAML

fsck_udf(8): Mark vat_length as ignored.

(riastradh)

2022-04-08 23:47:19 UTC MAIN commitmail json YAML

fsck_udf(8): Sprinkle __printflike and omit self-assignment.

(riastradh)

2022-04-08 23:35:52 UTC MAIN commitmail json YAML

membar_ops(3): Add some automatic tests.

These tests run two threads for five seconds each to try to trigger
races in the event of broken memory barriers.  They run only on
machines with at least two CPUs; on uniprocessor systems there's no
point -- the membars can correctly just be (instruction barrier)
no-ops.

(riastradh)

2022-04-08 23:14:21 UTC MAIN commitmail json YAML

rk_v1crypto(4): Fix missing `error =' assignment.

This is not likely to fail, but let's avoid suppressing an unlikely
error.

(riastradh)

2022-04-08 23:14:11 UTC MAIN commitmail json YAML

etc: Sort NetBSD.dist.tests.

(riastradh)

2022-04-08 21:48:19 UTC MAIN commitmail json YAML

lint: fix undefined behavior on enum overflow (since 1995)

GCC had optimized the check away, due to the obvious integer overflow 'x
- 1 == INT_MAX'.  To prevent further bugs like this, compile with
-ftrapv.

(rillig)

2022-04-08 21:29:29 UTC MAIN commitmail json YAML

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

PR/56778: Detlev Casanova: Missing rl_initialize call in rl_copy_text

(christos)

2022-04-08 14:33:24 UTC MAIN commitmail json YAML

s/postions/positions/

(andvar)

2022-04-08 10:27:04 UTC MAIN commitmail json YAML

2022-04-08 10:17:55 UTC MAIN commitmail json YAML

2022-04-08 05:47:34 UTC MAIN commitmail json YAML

openssh-9.0 out

(wiz)

2022-04-07 21:47:02 UTC MAIN commitmail json YAML

ucom(4): Use tty_unit -- save a couple lines of code.

(riastradh)

2022-04-07 21:46:52 UTC MAIN commitmail json YAML

tty(9): New function tty_unit for struct cdevsw::d_devtounit.

(riastradh)

2022-04-07 20:28:49 UTC MAIN commitmail json YAML

Do not attempt to trap SIGKILL

(nia)

2022-04-07 20:23:44 UTC MAIN commitmail json YAML

2022-04-07 19:33:39 UTC MAIN commitmail json YAML

2022-04-07 17:35:31 UTC MAIN commitmail json YAML

ucom(4): Fix unit numbering for devsw/autoconf cross-wiring.

Should introduce a tty_unit function to use here but this'll do for
now to fix the bug I introduced in ucom(4).

(riastradh)

2022-04-07 13:57:44 UTC MAIN commitmail json YAML

Note that biosboot without -A clears the PMBR "active" flag.
While here, fix some grammar and make the selection options
for biosboot a little clearer.

Ride nia@'s Dd bump.

(kre)

2022-04-07 09:06:01 UTC MAIN commitmail json YAML

gpt.8: Clarify that "windows" partition types are also used for FAT32
("msdos" in NetBSD terms), and UDF partitions. Use the same name as
Wikipedia, "Microsoft basic data".

(nia)

2022-04-06 22:48:22 UTC MAIN commitmail json YAML

sparc64/pmap: Nix trailing whitespace.

(riastradh)

2022-04-06 22:48:09 UTC MAIN commitmail json YAML

mvxpsec(4): Nix trailing whitespace.

(riastradh)

2022-04-06 22:47:58 UTC MAIN commitmail json YAML

Nix trailing whitespace in files of membars, atomics, and lock stubs.

Will be touching many of these files soon for functional changes.

No functional change intended.

(riastradh)

2022-04-06 22:25:00 UTC MAIN commitmail json YAML

udf.c uses math library functions.

(hauke)

2022-04-06 22:01:45 UTC MAIN commitmail json YAML

2022-04-06 21:51:29 UTC MAIN commitmail json YAML

2022-04-06 17:37:31 UTC MAIN commitmail json YAML

2022-04-06 17:14:43 UTC MAIN commitmail json YAML

we've been using the power key for its intended purpose for yesrs, which
makes breaking into DDB awkward, so let's do what everyone else does and
use Ctrl-Alt-Escape / Cmd-Escape depending on the layout variant

(macallan)

2022-04-06 16:01:07 UTC MAIN commitmail json YAML

Use PRI macros for uint64_t printf formats, %zu for size_t.

(martin)

2022-04-06 14:47:54 UTC MAIN commitmail json YAML

Keep UDF commented out by default

(reinoud)

2022-04-06 14:28:44 UTC MAIN commitmail json YAML

Add fsck_udf to the debug sets

(reinoud)

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

2022-04-06 13:59:22 UTC MAIN commitmail json YAML

UDF has been around for more than a decade in the kernel. Now with a
fsck_udf(8) it is not making sense to keep it calling `experimental'.

(reinoud)

2022-04-06 13:44:25 UTC MAIN commitmail json YAML

2022-04-06 13:43:24 UTC MAIN commitmail json YAML

Added fsck_udf(8) and upgraded newfs_udf/makefs for UDF

(reinoud)

2022-04-06 13:42:40 UTC MAIN commitmail json YAML

fsck_udf: match usage to man page; fix typos

(wiz)

2022-04-06 13:41:14 UTC MAIN commitmail json YAML

New sentence, new line. Sort options.

(wiz)

2022-04-06 13:39:06 UTC MAIN commitmail json YAML

new sentence, new line

(wiz)

2022-04-06 13:35:50 UTC MAIN commitmail json YAML

Initial commit of the fsck_udf(8) utility that checks and repairs UDF
filesystems on optical media as well as on disc images, harddisc partitions
and wedges.

(reinoud)

2022-04-06 13:29:16 UTC MAIN commitmail json YAML

Refactor and rewrite of newfs_udf(8) and makefs(8) (-t udf) with a shared
section for fsck_udf(8).

Newfs_udf and makefs support predefined disc image profiles, harddisc
partitions (disklabel and wedges on all generic block devices) and all optical
media types on CD/DVD/BD writers.

Newfs_udf and makefs now also support formatting of UDF 2.50 with a metadata
partition.

(reinoud)

2022-04-06 10:02:55 UTC MAIN commitmail json YAML

Add a regression test for PR kern/52239, "Changing protections of
already mmap'ed region can fail", based on the test program in the PR.

(gson)

2022-04-06 03:23:38 UTC MAIN commitmail json YAML

makemandb.c: fail sooner if man page dirs can't be found

There's no point initializing database state if we're then going to
fail to locate any man page sources. Make all the initial state checks
contiguous for simplicity and readability. Also, free the variable
"command" on the error path, and correct the error message.

(gutteridge)

2022-04-05 23:13:57 UTC MAIN commitmail json YAML

lint: remove unused message 40

I had not been used since 1995, when lint was imported to NetBSD.

(rillig)

2022-04-05 23:09:19 UTC MAIN commitmail json YAML

2022-04-05 15:59:22 UTC MAIN commitmail json YAML

In the mmap_err test case, mmap the address, not the address of the address.
Should fix PR kern/56780.

(gson)

2022-04-05 13:09:54 UTC MAIN commitmail json YAML

When the t_mmap:mmap_err test fails due to errno not having the expected
value of EINVAL, print the actual value.

(gson)

2022-04-05 06:43:54 UTC MAIN commitmail json YAML

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

2022-04-05 04:33:36 UTC MAIN commitmail json YAML

2022-04-04 19:33:46 UTC MAIN commitmail json YAML

2022-04-04 09:59:42 UTC MAIN commitmail json YAML

Avoid signed/unsigned comparision by casting the sizeof expression.

(martin)

2022-04-04 07:04:21 UTC MAIN commitmail json YAML

Use the original right boundary when calculating the vertical scroll
region so the boundary does not creep left on each subsequent setting.
Thanks to Martin@ for the report.

(blymn)

2022-04-04 06:12:27 UTC MAIN commitmail json YAML

Fix missing m_reset_rcvif for allocated mbuf

(yamaguchi)

2022-04-04 06:10:00 UTC MAIN commitmail json YAML

Move input processing of lagg(4) before ether_input
to get rid of dependence.

This implementation is similar with that of bridge(4).

(yamaguchi)

2022-04-03 14:17:53 UTC MAIN commitmail json YAML

Improve wording to avoid confusion about the return value of {v,}asprintf(3)

(christos)

2022-04-03 10:05:23 UTC MAIN commitmail json YAML

2022-04-03 09:49:37 UTC MAIN commitmail json YAML

efi_rtcopy is only used on little endian kernels.

(martin)

2022-04-03 09:34:46 UTC MAIN commitmail json YAML

2022-04-03 01:12:48 UTC MAIN commitmail json YAML

2022-04-03 01:11:00 UTC MAIN commitmail json YAML

2022-04-03 00:39:32 UTC MAIN commitmail json YAML

2022-04-02 22:38:45 UTC MAIN commitmail json YAML

lint: clean up style

Remove outdated ARGSUSED (the one in tree.c had been wrong since 1995),
remove unused argument.

No functional change.

(rillig)

2022-04-02 22:15:57 UTC MAIN commitmail json YAML

lint: use appropriate alignment on both the host and target platform

(rillig)

2022-04-02 21:47:04 UTC MAIN commitmail json YAML

2022-04-02 20:12:46 UTC MAIN commitmail json YAML

lint: try harder to recover after syntax errors

lint: assertion "false" failed in declarator_name at decl.c:1596
    near msg_022.c:22

(rillig)

2022-04-02 19:19:12 UTC MAIN commitmail json YAML

Don't attach Yubikeys as console keyboard.

(mlelstv)

2022-04-02 19:16:49 UTC MAIN commitmail json YAML

Avoid integer overflow on systems with 32bit disk addresses.

(mlelstv)

2022-04-02 19:15:09 UTC MAIN commitmail json YAML

Avoid crashes with invalid or tiny sector sizes.

(mlelstv)

2022-04-02 18:15:43 UTC MAIN commitmail json YAML

lint: extract type creation into separate functions

No functional change.

(rillig)

2022-04-02 17:28:06 UTC MAIN commitmail json YAML

2022-04-02 16:27:03 UTC MAIN commitmail json YAML

lint: untangle nested variable assignments

The code is buggy (see decl_direct_abstract.c), so at least make it
readable, making it hopefully easier to fix the bugs.

Before decl.c 1.18 from 2000-07-05, lint crashed when it parsed
'sizeof(int(double))', since that commit it has been hiding the bugs,
working with wrong type information instead.

Fix the logged type in add_function (had been wrong since today).

(rillig)

2022-04-02 14:35:47 UTC MAIN commitmail json YAML

lint: do not log dinfo_t pointers in debug mode

Before the addition of debug_dinfo from today, this had been the only
way to notice changes to the global 'dcs' variable.  Since the content
of that variable is now logged, the pointer is not needed anymore.

(rillig)

2022-04-02 14:28:31 UTC MAIN commitmail json YAML

lint: rename dinfo_t.d_next to d_enclosing

The name d_next gave the wrong impression that the declaration infos
would be independent of each other, but they are nested.

No functional change.

(rillig)

2022-04-02 12:24:55 UTC MAIN commitmail json YAML

2022-04-02 11:16:08 UTC MAIN commitmail json YAML

Update to support EFI runtime outside the kernel virtual address space
by creating an EFI RT pmap that can be activated / deactivated when
required.

Adds support for EFI RT to ARM_MMU_EXTENDED (ASID) 32-bit Arm machines.

On Arm64 the usage of pmapboot_enter is reduced and the mappings are
created much later in the boot process -- now in cpu_startup_hook.
Backward compatiblity for KVA mapped RT from old bootaa64.efi is
maintained.

Adding support to other platforms should be easier as a result.

(skrll)

2022-04-02 09:53:20 UTC MAIN commitmail json YAML

cgd(4): Omit technically-correct-but-broken adiantum dependency again.

It is true that cgd_crypto.c depends on sys/crypto/adiantum now, and
transitively on sys/crypto/aes.

However, there's a problem with the cgd module having a formal
(transitive) module dependency on the aes module.

Yesterday I thought the problem with this was that fpu_kern_enter was
artificially restricted while cold -- to detect, and noisily crash
on, reentrance, it raises the IPL to IPL_VM, asserts that the IPL is
not _higher_ (so it can't be re-entered by an IPL_SCHED or IPL_HIGH
interrupt), and asserts that it's not currently in use on the current
CPU.

Early at boot, the IPL is at IPL_HIGH, and no interrupts are possible
anyway, so the assertions tripped for artificial reasons, which I
fixed in:

https://mail-index.netbsd.org/source-changes/2022/04/01/msg137840.html

However, I had forgotten that there's a deeper problem for the cgd
module dependency on aes.  The ordering of events is:

1. Initialize builtin MODULE_CLASS_DRIVER modules -- including cgd.

2. Run configure -- including detecting CPUs, which on aarch64 is
  where the decision of which AES (and ChaCha) implementation to use
  based on supported CPU features.

3. Initialize builtin MODULE_CLASS_MISC modules -- including aes,
  _if_ there are no driver-class modules that depend on it.

There's a tangle of ordering dependencies here:

- MODULE_CLASS_DRIVER modules providing _autoconf_ drivers generally
  have to be initialized _before_ configure, because you need the
  driver to be initialized before configure can attach its devices.

- configure must run _before_ aes is initialized because the decision
  of which AES implementation to choose depends on CPU features
  detected in configure, and the prospect of dynamically changing the
  AES implementation is too painful to contemplate (it may change the
  key schedule, so it would invalidate any existing key schedules
  precomputed by callers like uvm_swap or configured cgd devices,
  which raises a host of painful concurrency issues to invalidate
  these cached key schedules on all CPUs in all subsystems using
  them).

- cgd doesn't figure into the configure stage of autoconf, but it
  nevertheless has to be MODULE_CLASS_DRIVER because specfs autoloads
  MODULE_CLASS_DRIVER modules in case they provide _devsw_ drivers
  (i.e., /dev nodes), as cgd does.  And we don't have a mechanism for
  identifying `autoconf driver modules' separately from `devsw driver
  modules' because some modules provide both and each module can have
  only one class.

For now, this is breaking boot on several tier I architectures so
let's nix the cgd->adiantum->aes module dependency as a stop-gap
measure.

(riastradh)

2022-04-01 23:16:32 UTC MAIN commitmail json YAML

lint: add type details to message about 'sizeof(function)'

The code in add_function is severely broken, it mixes up the return type
of the function with the argument types.  For now, at least show the
guessed type in the diagnostic, to allow human readers quickly spot the
bug.

Extend the test cases in decl_direct_abstract.c to show that the
behavior differs unreasonably if the first parameter of the function is
equal to its return type.

(rillig)

2022-04-01 22:28:21 UTC MAIN commitmail json YAML

2022-04-01 22:07:23 UTC MAIN commitmail json YAML

2022-04-01 21:53:35 UTC MAIN commitmail json YAML

Remove floppy installation instructions from sparc documentation.

Floppy generation was disabled before NetBSD 6.0 release due to size
constraints and unlikely to be restored soon or at all. PR port-sparc/56776.
ok martin.

(andvar)

2022-04-01 21:12:42 UTC MAIN commitmail json YAML

tests/lint: fix comment about backslash-newline

(rillig)

2022-04-01 21:09:24 UTC MAIN commitmail json YAML

Create a loaable adiantum module, and make cgd require it.

This enablees use of a loadable cgd module, rather thtan requiring
it to be built-in.

Partially resolves kern/56772

(pgoyette)

2022-04-01 20:38:37 UTC MAIN commitmail json YAML

lint: add debug logging for type declarators

This will help in fixing the wrong type in msg_347.c, as well as the
assertion failure for 'sizeof(int())'.

(rillig)

2022-04-01 20:29:37 UTC MAIN commitmail json YAML

lint: fix indentation and spacing, add a missing 'else' to 'else if'

No functional change.

(rillig)

2022-04-01 19:57:22 UTC MAIN commitmail json YAML

x86, arm: Allow fpu_kern_enter/leave while cold.

Normally these are forbidden above IPL_VM, so that FPU usage doesn't
block IPL_SCHED or IPL_HIGH interrupts.  But while cold, e.g. during
builtin module initialization at boot, all interrupts are blocked
anyway so it's a moot point.

Also initialize x86 cpu_info_primary.ci_kfpu_spl to -1 so we don't
trip over an assertion about it while cold -- the assertion is meant
to detect reentrance into fpu_kern_enter/leave, which is prohibited.

Also initialize cpu0's ci_kfpu_spl.

(riastradh)

2022-04-01 19:02:12 UTC MAIN commitmail json YAML

s/potected/protected and s/investication/investigation/ in comments.

(andvar)

2022-04-01 15:49:12 UTC MAIN commitmail json YAML

Split i2c_subr.c into a separate module rather than including it in
the iic module.  There are valid configurations where i2c_subr code
can be both built-in and part of a loaded module (eg, piixpm is in
the kernel, but the iic module is loaded later).  This causes the
in-kernel linker to detect a duplicate symbol.

(pgoyette)

2022-04-01 15:34:34 UTC MAIN commitmail json YAML

Call iic_fini_tag() when the tag is no longer needed.

Without this, a LOCKDEBUG kernel can panic when trying to re-init the tag.

(pgoyette)

2022-04-01 08:26:28 UTC MAIN commitmail json YAML

Fix malformed DPRINTF() macro

(reinoud)

2022-04-01 07:26:51 UTC MAIN commitmail json YAML

lagg(4): reimplement add and delete port

The IFNET_LOCK for the adding or deleting port became to
be held the whole time while the ifnet of the port is changed.

(yamaguchi)

2022-04-01 06:51:12 UTC MAIN commitmail json YAML

Trailing Whitespace

(skrll)

2022-04-01 06:49:17 UTC MAIN commitmail json YAML

2022-04-01 06:32:10 UTC MAIN commitmail json YAML

Update documentation to clean up obsolete settings and add new ones.

(blymn)

2022-04-01 06:31:30 UTC MAIN commitmail json YAML

Fix regression introduced when fixing PR kern/56613 and related tweaks

* A trackpad with external buttons needs to mask a number of lower bits
  of the X and Y coordinates IFF a button is down.  This was not being
  done so a button held down looked like an out of range packet and
  was therefore dropped.

* Now that trackpads are probed for their boundaries make the emulated
  button boundary settable by a percentage, also allow the right and
  bottom boundaries to be adjusted by a percentage to allow for
  horizontal and vertical scroll regions.

(blymn)

2022-04-01 01:06:26 UTC MAIN commitmail json YAML

lint: replace crash with assertion failure

Triggered by 'sizeof(int())'.

GCC evaluates this expression to 1, without any warning.

Clang warns about an "invalid application of 'sizeof' to a function
type".

(rillig)

2022-04-01 01:00:40 UTC MAIN commitmail json YAML

tests/lint2: add missing character in comment

(rillig)

2022-04-01 00:21:19 UTC MAIN commitmail json YAML

cgd(4): Remove recently added dependency on adiantum.

While this dependency is technically correct, it triggers a problem
with module initialization for builtin modules that manifests as an
instant crash on boot for x86 (and likely arm) kernels, and that
problem is not trivial to solve immediately.  See the top of
sys/crypto/aes/aes_impl.c for a summary of the problem and why it's
tricky.

So as a stop-gap measure, we'll remove this dependency for now; we
can reinstate it later once the underlying problem with module
initialization order is resolved.

Reported-by: syzbot+e9b3550af985b6557414@syzkaller.appspotmail.com
(actually first reported, to my knowledge, by pgoyette@, but this
line tells syzkaller that we fixed the problem)

(riastradh)

2022-04-01 00:16:40 UTC MAIN commitmail json YAML

thmap(9): Handle memory allocation failure in root_try_put.

Reported-by: syzbot+8ded6e17a394e39d6291@syzkaller.appspotmail.com

(riastradh)

2022-03-31 19:30:18 UTC MAIN commitmail json YAML

For device modules that provide both auto-config and /dev/xxx
interfaces, make sure that initialization and destruction
follow the proper sequence.  This is triggered by the recent
changes to the devsw stuff; per riastradh@ the required call
sequence is:

devsw_attach()
config_init_component() or config_cf*_attach()
...
config_fini_component() or config_cf*_detach()
devsw_detach()

While here, add a few missing calls to some of the detach
routines.

Testing of these changes has been limited to:
1. compile without build break
2. no related test failures from atf
3. modload/modunload work as well as
  before.

No functional device testing done, since I don't have any
of these devices.  Let me know of any damage I might cause
here!

XXX Some of the modules affected by this commit are already
XXX broken;  see kern/56772.  This commit does not break
any additional modules (as far as I know).

(pgoyette)

2022-03-31 17:43:50 UTC MAIN commitmail json YAML

2022-03-31 07:59:05 UTC MAIN commitmail json YAML

2022-03-31 06:23:18 UTC MAIN commitmail json YAML

call detach functions before stopping the interrupt for atq

(yamaguchi)

2022-03-31 06:21:41 UTC MAIN commitmail json YAML

Use xc_barrier to wait for finish of the interrupt handler

poited out by riastradh@n.o, thanks.

(yamaguchi)

2022-03-31 06:20:14 UTC MAIN commitmail json YAML

ixl(4): remove unnecessary lock acquirement

Running interrupt handlers is finished while accessing to
I40E_Q[TR]X_ENA register. Therefore, it is not need to acquire
locks to wait for the finish.

pointed out by riastradh@n.o, thanks.

(yamaguchi)

2022-03-31 06:17:34 UTC MAIN commitmail json YAML

vioif(4): remove unnecessary lock acquirement

The lock was hold to wait for completion of interrupt handlers.
But, they are already stopped by rxq_stopping and txq_stopping
flags.

pointed out by riastradh@n.o, thanks.

(yamaguchi)

2022-03-31 03:26:33 UTC MAIN commitmail json YAML

Add tests for MTU of lagg(4)

(yamaguchi)

2022-03-31 03:21:33 UTC MAIN commitmail json YAML

Use ether_ioctl to change mtu of lagg(4)

(yamaguchi)

2022-03-31 03:15:15 UTC MAIN commitmail json YAML

2022-03-31 03:12:31 UTC MAIN commitmail json YAML

2022-03-31 03:10:59 UTC MAIN commitmail json YAML

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

Added waiting for distributing state after attaching vlan

A lagg interface is reset on attaching vlan to enable
ETHERCAP_VLAN_MTU if the lagg I/F has it. Therefore,
it is necessary to wait for distributing.

(yamaguchi)

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

Set flags related to MTU on adding l2tp(4) to lagg(4)

(yamaguchi)

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

set active when the port is distributing

(yamaguchi)

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

update state of aggregator on multi-speed changing

(yamaguchi)

2022-03-31 02:07:26 UTC MAIN commitmail json YAML

2022-03-31 02:04:50 UTC MAIN commitmail json YAML

handle LACPDU and MarkerDU in thread context

Those handler move from softint to thread context to
improve throughput in high load, because they hold LACP_LOCK.

pointed out by k-goda@IIJ

(yamaguchi)

2022-03-31 02:00:28 UTC MAIN commitmail json YAML

2022-03-31 01:59:05 UTC MAIN commitmail json YAML

Added length check for safety

pointed out by k-goda@IIJ

(yamaguchi)

2022-03-31 01:57:13 UTC MAIN commitmail json YAML

lagg(4): remove duplicated bpf_mtap

(yamaguchi)

2022-03-31 01:53:22 UTC MAIN commitmail json YAML

Change error code to ENOBUFS on lack of buffer memory

pointed out by k-goda@IIJ

(yamaguchi)

2022-03-31 01:49:02 UTC MAIN commitmail json YAML

Fix missing freeing resource related to protocol

pointed out by k-goda@IIJ

(yamaguchi)

2022-03-31 01:46:25 UTC MAIN commitmail json YAML

Switch ifp->if_output along with configuring ifp->if_lagg

lagg_port_output stored to ifp->if_output uses ifp->if_lagg.
Therefore, ifp->if_output switches to lagg_port_output after
ifp->if_lagg is configured, and restores in reverse order.

This missing order is pointed out by k-goda@IIJ

(yamaguchi)

2022-03-31 01:43:48 UTC MAIN commitmail json YAML

Added missing NULL check

pointed out by k-goda@IIJ

(yamaguchi)

2022-03-31 01:42:40 UTC MAIN commitmail json YAML

lagg(4): commonize the error handling

(yamaguchi)

2022-03-31 01:40:34 UTC MAIN commitmail json YAML

Added missing kmem_free

pointed out by k-goda@IIJ

(yamaguchi)

2022-03-31 01:39:09 UTC MAIN commitmail json YAML

lagg(4): fix typo

pointed out by k-goda@IIJ

(yamaguchi)

2022-03-31 01:36:47 UTC MAIN commitmail json YAML

2022-03-30 22:34:48 UTC MAIN commitmail json YAML

get machine_ledaddr from PDC if we find one
now USELEDS works on my c360

(macallan)

2022-03-30 17:02:02 UTC MAIN commitmail json YAML

kern: Assert softint does not net acquire kernel locks.

This redoes previous change where I mistakenly used the CPU's biglock
count, which is not necessarily stable -- the softint lwp may sleep
on a mutex, and the lwp it interrupted may start up again and release
the kernel lock, so by the time the softint lwp wakes up again and
the softint function returns, the CPU may not be holding any kernel
locks.  But the softint lwp should never hold kernel locks except
when it's in a (usually, non-MPSAFE) softint function.

Same with callout.

(riastradh)

2022-03-30 16:35:28 UTC MAIN commitmail json YAML

remove zfs from the exception list; it now works like the other fs's.

(christos)

2022-03-30 16:34:27 UTC MAIN commitmail json YAML

2022-03-30 14:54:29 UTC MAIN commitmail json YAML

Revert "kern: Sprinkle biglock-slippage assertions."

Got the diagnostic information I needed from this, and it's holding
up releng tests of everything else, so let's back this out until I
need more diagnostics or track down the original source of the
problem.

(riastradh)

2022-03-30 14:24:50 UTC MAIN commitmail json YAML

update copyright.

(christos)

2022-03-30 13:43:42 UTC MAIN commitmail json YAML

skip userlevel filesystems that have their own rules (they depend on the
system setting of the sysctl on NetBSD) and zfs because it implements its
own rules for hardlinks to files (does its own permission checks).

(christos)

2022-03-30 13:24:00 UTC MAIN commitmail json YAML

Fix locking in udf_link(). XXX: udf_symlink is prolly similarly broken.

(christos)

2022-03-30 12:45:58 UTC MAIN commitmail json YAML

fix unlock on error.

(christos)

2022-03-30 10:52:59 UTC MAIN commitmail json YAML

restructure so we abort/unlock properly on failure.

(christos)

2022-03-30 10:34:14 UTC MAIN commitmail json YAML

kern: Sprinkle biglock-slippage assertions.

We seem to have a poltergeist that occasionally messes with the
biglock depth, but it's very hard to reproduce and only manifests as
some other CPU spinning out on the kernel lock which is no good for
diagnostics.

(riastradh)

2022-03-30 08:26:45 UTC MAIN commitmail json YAML

_rtld_map_object(): no need to mmap an empty bss segment.

(hannken)

2022-03-30 02:45:14 UTC MAIN commitmail json YAML

vmxnet3_stop_rendezvous() requires workqueue_wait() to wait workqueue not scheduled yet.

(knakahara)

2022-03-30 00:06:51 UTC MAIN commitmail json YAML

2022-03-29 22:48:04 UTC MAIN commitmail json YAML

2022-03-29 22:30:07 UTC MAIN commitmail json YAML

ignore EOPNOTSUPP errors for fs's that don't support hard links.

(christos)

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

2022-03-29 22:10:42 UTC MAIN commitmail json YAML

gpiopps module requires the gpio module to resolve several symbols

(pgoyette)

2022-03-29 22:09:58 UTC MAIN commitmail json YAML

zlib-1.2.12 out

(wiz)

2022-03-29 09:37:39 UTC MAIN commitmail json YAML

More space for the memory disk image is needed here too (follow the
last change in INSTALL)

(martin)

2022-03-29 09:19:56 UTC MAIN commitmail json YAML

sequencer(4): Don't use mutex_spin_exit on an IPL_NONE lock.

(riastradh)

2022-03-29 09:16:24 UTC MAIN commitmail json YAML

cs4281(4): Fix lock ordering in suspend.

No idea if this code works -- obviously this path has never been
tested in the >decade it's been here!

(riastradh)

2022-03-29 09:08:44 UTC MAIN commitmail json YAML

emdtv(4): Fix issues in detach.

- Use config_detach_children, and do it up front, and handle failure
  (not relevant for yanking usb but relevant for drvctl which doesn't
  pass DETACH_FORCE).

- Fix teardown order: stop interrupts so we stop issuing new work,
  and _then_ wait for pending work to drain and destroy the
  workqueue.

- Omit needless empty  mutex_enter(lock); mutex_exit(lock)  dance
  which probably only appeared necessary because of the wrong
  teardown order.

(riastradh)

2022-03-29 06:59:19 UTC MAIN commitmail json YAML

uhid(4): Make sure error is initialized in uhidkqfilter.

(riastradh)

2022-03-29 06:56:51 UTC MAIN commitmail json YAML

x68k/ite(4): Include <sys/device_impl.h> to abuse autoconf internals.

(riastradh)

2022-03-29 01:57:51 UTC MAIN commitmail json YAML

vioif(4): Added a comment about stopping packet processing

(yamaguchi)

2022-03-28 20:52:17 UTC MAIN commitmail json YAML

2022-03-28 20:51:04 UTC MAIN commitmail json YAML

Add a test for hardlink sysctl limiting.

(christos)

2022-03-28 20:49:52 UTC MAIN commitmail json YAML

2022-03-28 20:49:32 UTC MAIN commitmail json YAML

no need to include suser; it gets autoloaded as a module.

(christos)

2022-03-28 20:00:29 UTC MAIN commitmail json YAML

cgram: define a word as a sequence of letters, not non-whitespace

Pressing Tab or Shift+Tab now advances to the next letter that could be
substituted, it no longer stops at punctuation or digits.  Since only
letters are scrambled, these are most interesting to be edited.

(rillig)

2022-03-28 19:59:36 UTC MAIN commitmail json YAML

arm/cortex: Use container_of, not bespoke offsetof arithmetic.

(riastradh)

2022-03-28 19:59:26 UTC MAIN commitmail json YAML

arm/apple: Use container_of, not bespoke offsetof arithmetic.

Better type-safety this way.

(riastradh)

2022-03-28 19:08:43 UTC MAIN commitmail json YAML

secmodel: fix grammar in description of hardlink_check_gid

(rillig)

2022-03-28 13:07:14 UTC MAIN commitmail json YAML

Restore another historic RCS Id.

(wiz)

2022-03-28 12:48:44 UTC MAIN commitmail json YAML

Provide a bit more space for the ramdisk image (which recently did grow)

(martin)

2022-03-28 12:48:35 UTC MAIN commitmail json YAML

sys/dev/ccd.c: Restore historic RCS id.

This got munged accidentally by `git cvsexportcommit -k' -- taking
that option out of my commitbomb script!

(riastradh)

2022-03-28 12:45:04 UTC MAIN commitmail json YAML

uatp(4): Use usbd_get/set_report for Geyser 3/4 reset.

(riastradh)

2022-03-28 12:44:55 UTC MAIN commitmail json YAML

uatp(4): Fix detach logic.

Let wsmouse child decide whether it's in use or close if mandatory.
If config_detach_children succeeds, this must no longer be open and
we can commit to freeing everything.

(riastradh)

2022-03-28 12:44:45 UTC MAIN commitmail json YAML

uhidev(9): Assert uhidev is open when writing.

(Maybe we could have uhidevs that are output-only, in which case a
driver could, in principle, want to issue writes without getting any
input report interrupts.  But we can cross that bridge when we come
to it.)

(riastradh)