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 (15m)  netbsd-8 (5d)  netbsd-10 (5d)  netbsd-9 (11d)  thorpej-ifq (175d)  thorpej-altq-separation (177d) 

2024-05-09 20:38:02 UTC Now

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

Remove the error condition for these cases; the VAT LVExtension is
missing/corrupt but fsck_udf will reconstruct them anyway.

(reinoud)

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

Prevent reading beyond the early_vat_location

(reinoud)

2022-04-22 20:56:46 UTC MAIN commitmail json YAML

Fix endian issues with fsck_udf/newfs_udf/makefs

(reinoud)

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

Avoid assigned but unused compiler warnings when compiling with clang

(reinoud)

2022-04-22 15:47:03 UTC MAIN commitmail json YAML

Remove the 'tools/lib{elf,dwarf}' directories.

These have been moved to under 'tools/elftoolchain'.

(jkoshy)

2022-04-22 12:41:06 UTC MAIN commitmail json YAML

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

2022-04-22 07:34:56 UTC MAIN commitmail json YAML

Add some Broadcom devices. From OpenBSD.

(skrll)

2022-04-21 21:31:11 UTC MAIN commitmail json YAML

s/substract/subtract/ in comments and error message.
s/obtainted/obtained/ in one comment.

(andvar)

2022-04-21 21:22:25 UTC MAIN commitmail json YAML

2022-04-21 21:09:13 UTC MAIN commitmail json YAML

lint: expand the last remaining __arraycount

For consistency with the other expressions for an array length, which
already use the expanded form.

No functional change.

(rillig)

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

tests/lint: extend test for lossy integer conversion

(rillig)

2022-04-21 19:14:46 UTC MAIN commitmail json YAML

ipsec-tools: in lint mode, keep keyword 'inline'

This avoids hundreds of lint warnings for OpenSSL's stack definitions:

openssl/x509.h(75): warning:
    static function sk_X509_NAME_ENTRY_num unused [236]

(rillig)

2022-04-21 17:30:15 UTC MAIN commitmail json YAML

2022-04-21 12:06:32 UTC MAIN commitmail json YAML

mips/cavium: Take advantage of Octeon's guaranteed r/rw ordering.

(riastradh)

2022-04-21 12:05:13 UTC MAIN commitmail json YAML

futex(9): Convert membar_enter/exit to membar_acquire/release.

No functional change -- this is just in an illustrative comment!

(riastradh)

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

Actually add the bkgrndset test case so it runs plus fix a typo in
the bkgrndset test script.

(blymn)

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

nameser_compat.h: simplify logic to determine byte order

There's really no need for all the complex #ifdefs present and, on top
of that, it didn't even work correctly for all NetBSD architectures.
Simply use endian.h and drop the rest. (Since there is no upstream for
this code anymore, there's no concern about complicating future merges,
either. This change is also consistent with what FreeBSD and OpenBSD
did years ago.)

Addresses PR toolchain/53880 (reported by maya@, originally encountered
by me on macppc when building a package that pulls in nameser_compat.h
before nameser.h by necessity -- necessity, that is, on another OS).

(gutteridge)

2022-04-21 01:15:25 UTC MAIN commitmail json YAML

#if 0 now unused audio_track_is_record() to appease clang

(macallan)

2022-04-20 23:32:17 UTC MAIN commitmail json YAML

the register is only one byte, act like it

(macallan)

2022-04-20 22:50:56 UTC MAIN commitmail json YAML

tests/lint: fix test for message 132 to be platform-independent

On i386, the test failed because the warning in line 101 was not
generated.  This was because size_t on i386 is unsigned int (see
arch/i386/targparam.h, SIZEOF_TSPEC). The result of the multiplication
had type unsigned int, and message 132 does not trigger for a conversion
from unsigned int to signed int because both types have the same size
(see check_integer_conversion, portable_size_in_bits).

Change the involved type from size_t (which the original code used) to
unsigned long long (which is uint64_t on all platforms supported by
lint), so that the warning is generated on all platforms in the same
way.

(rillig)

2022-04-20 22:08:10 UTC MAIN commitmail json YAML

vio9p: avoid null pointer dereference on attach.

Pass "vqs" argument to virtio_child_attach_start().  The virtio API is
not quite clear to me here - there's also a separate setter
virtio_child_attach_set_vqs that performs some additional actions.

Queue setup for Virtio 1.0 accesses virtio_softc::sc_vqs and we didn't
set it.  QEMU exposes only the old virtio interface, so it doesn't
trigger the problem.

(uwe)

2022-04-20 19:06:35 UTC MAIN commitmail json YAML

ddb: guard invocation of db_cmd_on_enter properly.

db_command_loop - do not ignore the return value from setjmp used to
guard db_cmd_on_enter.  We do not want to re-execute the enter command
if it fails.  Note that "fails" includes e.g. aborting long output
from the enter command with "q" at the --db more-- prompt, which is
quite likely as the default enter command is "bt".

While here, don't even bother with the whole song and dance if the
enter command is not set.

(uwe)

2022-04-20 07:43:05 UTC MAIN commitmail json YAML

2022-04-20 07:41:04 UTC MAIN commitmail json YAML

Add test and check file for bkgrndset

(blymn)

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

audio(4): Rework AUDIO_GETOOFFS.
- Count .samples/.deltablks in blocks.  It makes .deltablks integer wrap
  around safe.
- Remove suspicious one block offset from .offset.  I added the offset
  because it was observed so on NetBSD7.  But according to manpage, it
  should not be.  And it looks fine without the offset.
- Related to that, remove a comment in AUDIO_WSEEK.
  Limit the user-visible buffer to usrbuf only.

(isaki)

2022-04-20 06:05:22 UTC MAIN commitmail json YAML

audio(4): Make recording buffer more robust.
Previously, main buffer in recording track was usrbuf, which is the closest
buffer to the userland.  Because, this buffer arrangement was symmetrical
with the playback track, and had affinity with the past implementation.
However, in the current implementation, read(2) (from user application)
takes recorded block out from inputbuf, which is the closest buffer to
rmixer, to usrbuf.  So it was not good way to use the usrbuf as main buffer.
Now, usrbuf in recording track holds only fragment bytes in order to
transfer to the userland, and main buffer in recording track is the inputbuf,
the closest to rmixer.

Buffer size of the inputbuf is also modified.  Previously, it was less than
64KB or at least 4 blocks.  This had affinity with playback track and the
past implementation.  But this was not appropriate for both formats with
too large frames or too small frames.  In large frames (for example,
192kHz/12ch), 184KB buffer would be allocated but it corresponds to only
40msec.  In opposite, in small frames (for example, 8000Hz/1ch), 64KB
buffer would be allocated and it corresponds to 4.1 seconds.  But for such
machines that have 8000Hz/1ch device, in-kernel 64KB memory would probably
be expensive.
Now, inputbuf will always be allocated 16(NBLKIN) blocks, regardless of its
hardware format.  It corresponds to 160msec on modern archs (if blk_ms=10),
or 640msec on antique archs (if blk_ms=40).

(isaki)

2022-04-20 04:41:29 UTC MAIN commitmail json YAML

audio(4): Make debug messages better in audio_ioctl() and mixier_ioctl().
Divide by case.  Reduce to one line if possible.

(isaki)

2022-04-19 23:16:14 UTC MAIN commitmail json YAML

lint: fix integer overflow on seeing -(uint64_t)INT64_MIN

Seen in external/cddl/osnet/dist/lib/libuutil/common/uu_strtoint.c,
which is protected by a NOLINT in ../Makefile.inc.

(rillig)

2022-04-19 22:53:34 UTC MAIN commitmail json YAML

Revert "mmap(2): If we fail with a hint, try again without it."

This doesn't work, because uvm_mmap releases the uobj when it fails.
Should factor this more coherently, but let's just revert for now.

Reported-by: syzbot+d347c8951821b236117a@syzkaller.appspotmail.com
Reported-by: syzbot+7643d1b769fdfa18c3b2@syzkaller.appspotmail.com
Reported-by: syzbot+44f4b39671dd580cba5c@syzkaller.appspotmail.com
Reported-by: syzbot+b5a422299ca4ffe8570c@syzkaller.appspotmail.com
Reported-by: syzbot+22681822db67b6e90cfb@syzkaller.appspotmail.com
Reported-by: syzbot+e59f493ceef72b925a17@syzkaller.appspotmail.com
Reported-by: syzbot+666f3fe8364f47e8641b@syzkaller.appspotmail.com
Reported-by: syzbot+511d4572f52f1fd9b5cc@syzkaller.appspotmail.com

(riastradh)

2022-04-19 22:40:45 UTC MAIN commitmail json YAML

sqlite: suppress a few lint warnings

(rillig)

2022-04-19 22:40:13 UTC MAIN commitmail json YAML

tests/lint: add test case for integer non-constant expression

Seen in sqlite3.c.

(rillig)

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

fix for PR 55496

* Fix bkgrndset so that it actually sets the background character in
  in line with the SUSv2 specification.

* Add an internal function to copy a complex character

* Make the previously static celleq function into a libcurses private
  function so that it can be called in other files.

(blymn)

2022-04-19 22:14:30 UTC MAIN commitmail json YAML

lint: only warn about unsigned constants in C90 migration mode

For C99 code, the difference between traditional C and C90 is not
relevant.

Seen in sqlite3.c line 30448.

(rillig)

2022-04-19 22:00:53 UTC MAIN commitmail json YAML

liblua: ignore a few lint warnings

(rillig)

2022-04-19 20:32:18 UTC MAIN commitmail json YAML

2022-04-19 20:08:52 UTC MAIN commitmail json YAML

lint: do not warn about converting (1234567L & 0xFF) to unsigned char

Due to the '& 0xFF', there is no possible loss of accuracy.

(rillig)

2022-04-19 19:56:30 UTC MAIN commitmail json YAML

tests/lint: demonstrate wrong warnings for conversion from long to char

(rillig)

2022-04-19 09:25:39 UTC MAIN commitmail json YAML

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

audio(4): Wait for opens to drain in detach.

Otherwise detach may barge ahead and start freeing things before open
has finished and is about to use them after free.

Reported-by: syzbot+31d2619e72c2c8436cc9@syzkaller.appspotmail.com

(riastradh)

2022-04-19 01:35:28 UTC MAIN commitmail json YAML

umcs(4): Avoid using uninitialized data if register read fails.

Reported-by: syzbot+511b32f415150b469250@syzkaller.appspotmail.com

(riastradh)

2022-04-19 01:34:52 UTC MAIN commitmail json YAML

mmap(2): If we fail with a hint, try again without it.

`Hint' here means nonzero addr, but no MAP_FIXED or MAP_TRYFIXED.

This is suboptimal -- we could teach uvm_mmap to do a fancier search
using the address as a hint.  But this should do for now.

Candidate fix for PR kern/55533.

ok chs@

(riastradh)

2022-04-18 19:46:35 UTC MAIN commitmail json YAML

Disconnect 'tools/lib{elf,dwarf}' from the build.

These libraries are now built by 'tools/elftoolchain/lib{elf,dwarf}'
respectively.

(jkoshy)

2022-04-18 19:40:07 UTC MAIN commitmail json YAML

Update 'tools/ctf{merge,convert}' to use the new build locations for
'libelf' and 'libdwarf'.

(jkoshy)

2022-04-18 16:09:05 UTC MAIN commitmail json YAML

Comment on interaction of posix.mk with[out] -r

(sjg)

2022-04-18 15:59:39 UTC MAIN commitmail json YAML

Never 'rm -rf ${TMPDIR}' when you cannot be sure what it is

Use a safer variable for a subdir of ${TMPDIR} that we know
we can remove safely.

(sjg)

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

make: only switch to POSIX mode if '.POSIX:' is the first line

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
says that in order to make a makefile POSIX-conforming, its first
non-comment line must be the special dependency line '.POSIX:' without
any source dependencies.

Previously, make switched to POSIX mode even if such a line occurred
anywhere else, which was allowed by POSIX but was deep in the
"unspecified behavior" area.  For NetBSD make, there is no big
difference since it doesn't ship any <posix.mk> file, this change mainly
affects the bmake distribution.

Previously, makefiles that contain '.POSIX:' somewhere in the middle
could fail due to <posix.mk> resetting .SUFFIXES, among other things.

Suggested by Simon J. Gerraty, who also reviewed an earlier version of
this change.

(rillig)

2022-04-18 14:41:42 UTC MAIN commitmail json YAML

tests/make: refine documentation of test for .USEBEFORE

(rillig)

2022-04-18 14:38:24 UTC MAIN commitmail json YAML

2022-04-18 14:11:44 UTC MAIN commitmail json YAML

Build 'libelf' and 'libdwarf' under 'tools/elftoolchain', after
'tools/elftoolchain/common' has been built.

This change aligns the 'tools' build with the regular build.

Subsequent commits will change 'tools/libctf' and
'tools/cft{merge,convert}' to use the new build paths.

(jkoshy)

2022-04-18 10:57:05 UTC netbsd-9 commitmail json YAML

2022-04-18 10:54:21 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by reinoud in ticket #1437):

sys/fs/udf/udf_allocation.c: revision 1.46

Revere modification of initializer; it can lead to race conditions where two
allocation would pick the `empty' space causing a panic later on.

(martin)

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

Do not attach if the parent bus failed to provide an ISA chipset tag.

(jmcneill)

2022-04-18 06:02:27 UTC MAIN commitmail json YAML

Introduce a new macro JNUM to replace the idiom jp-jobtab+1
(the job number, given jp a pointer to a jobs table entry)
used open coded previously in many places (mostly in DEBUG mode
trace messages, so not included in most shells, but there are
a few others).

Make the type of JNUM() be int rather than the ptrdiff_t the
open coded version became ... which when used in some printf()
type function arg list was cast to some other arbitrary (but not
consistent) int type for which there is a standard %Xd type
format conversion.  Now we can (and do) just use %d for this.

If the number of jobs ever exceeds the range of an int, we would
have far more serious problems than the broken output this would
cause.

While here improve a comment or two, and use JOBRUNNING instead
of 0 where the intent is the former (JOBRUNNING is #defined as 0).

NFCI.

(kre)

2022-04-17 21:24:53 UTC MAIN commitmail json YAML

2022-04-17 15:20:36 UTC MAIN commitmail json YAML

Add the missing kpreempt_enable to pmap_deactivate_efirt

(skrll)

2022-04-17 13:17:56 UTC MAIN commitmail json YAML

umb(4): Use memcpy, not potentially unaligned/aliased casts.

(riastradh)

2022-04-17 13:17:40 UTC MAIN commitmail json YAML

umb(4): Validate descriptor lengths.

(riastradh)

2022-04-17 13:17:30 UTC MAIN commitmail json YAML

uvideo(4): Parse descriptors more robustly.

Validate lengths and types before barging ahead.

Not sure exactly which missing validation syzbot tripped on here, but
I'm pretty sure I caught all the cases.

Reported-by: syzbot+60f0a25c077b67547f57@syzkaller.appspotmail.com

(riastradh)

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

uvideo(4): Convert conditional to KASSERT in uvideo_attach.

usb_desc_iter_next_interface no longer returns truncated interface
descriptors, so we no longer have to check for that here.

(riastradh)

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

uvideo(4): Convert conditional to KASSERT in uvideo_unit_alloc.

The one caller guarantees the condition already.

(riastradh)

2022-04-17 13:16:52 UTC MAIN commitmail json YAML

usbdi(9): Make usb_desc_iter_next_interface reject truncated descs.

Currently callers have to check whether the descriptor is truncated,
which is willy.

(riastradh)

2022-04-17 13:16:43 UTC MAIN commitmail json YAML

usbdi(9): Minor KNF and tidying in descriptor iteration.

No functional change intended.

(riastradh)

2022-04-17 13:16:11 UTC MAIN commitmail json YAML

uvideo(4): Use sizeof(*p), not sizeof(T), for kmem_alloc/free.

No functional change intended.

(riastradh)

2022-04-17 13:15:48 UTC MAIN commitmail json YAML

uvideo(4): KNF comment style.

No functional change intended.

(riastradh)

2022-04-17 13:15:37 UTC MAIN commitmail json YAML

usbdi(9): Restore usb_descriptor_t to its correct definition.

Descriptors in the USB spec all start with bLength and
bDescriptorType.  bDescriptorSubtype is only for certain
class-specific descriptors.  Many descriptors, such as
usb_device_descriptor_t, _do not_ have bDescriptorSubtype, so using a
structure that has bDescriptorSubtype for such descrpitors is wrong.

There is some history here:

- Back in 1998, when augustss@ introduced the USB stack, the type
  usb_descriptor_t was erroneously defined with a bDescriptorSubtype
  member.

- In 2007, drochner@ removed this member to accurately reflect the
  USB spec.

- In 2018, khorben@ appeared to have accidentally reintroduced it
  while importing the umb(4) driver from OpenBSD, which still has the
  erroneous bDescriptorSubtype member in usb_descriptor_t.

The umb(4) driver has since been adjusted to correctly use
usb_cdc_descriptor_t instead of usb_descriptor_t (and I have now
restored umidi_cs_descriptor_t which I had removed last month before
I realized this history of usb_descriptor_t), so this member is no
longer necessary.

(riastradh)

2022-04-17 13:15:27 UTC MAIN commitmail json YAML

umb(4): Use usb_cdc_descriptor_t for bDescriptorSubtype.

Note: This needs more length validation!  TBD in a separate commit.

(riastradh)

2022-04-17 13:15:15 UTC MAIN commitmail json YAML

umidi(4): Restore umidi_cs_descriptor_t type.

Had been previously deleted under the misapprehension that
usb_descriptor_t is appropriate here, but it's not -- it should not
have the bDescriptorSubtype member.

(riastradh)

2022-04-17 13:15:05 UTC MAIN commitmail json YAML

uvideo(4): Avoid printing off the end of truncated descriptors.

(riastradh)

2022-04-17 09:25:24 UTC MAIN commitmail json YAML

ucom(4): Make sure rndsource is attached before use and detach.

Reported-by: syzbot+04fb6786e0cf873905e8@syzkaller.appspotmail.com

(riastradh)

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

panic(9): Serialize panicstr access and printing `panic:' message.

This isn't riskier than before -- previously we took kprintf_lock
inside each separate printf/vprintf call here.  Now we just take it
once around access to panicstr and printing the message.

With any luck, this should help avoid interleaving panic messages
with each other and with other output -- and maybe cut down on the
number of syzkaller duplicates.

(riastradh)

2022-04-16 23:20:47 UTC MAIN commitmail json YAML

eqos: Freeze counters to prevent unhandled interrupts

(jmcneill)

2022-04-16 22:21:10 UTC MAIN commitmail json YAML

lint: merge mod_t.m_test_context into m_requires_bool

These two flags mean exactly the same.

No functional change.

(rillig)

2022-04-16 21:22:12 UTC MAIN commitmail json YAML

lint: clean up table with operator properties

Now that lint may use C99, make use of empty macro arguments.

No binary change.

(rillig)

2022-04-16 21:14:33 UTC MAIN commitmail json YAML

lint: rename members of tnode_t to more closely match reality

The flags do not describe the left operand of the node but both, as for
most operators, either none or both operands are in test context or in
value context.

The one exception is the operator '?' from the '?:' conditional, for
which the left operand is in test context and the right operand is in
value context.

No binary change.

(rillig)

2022-04-16 20:57:10 UTC MAIN commitmail json YAML

lint: investigate why lint only warns about some constant conditions

Noticed in lex.c, in the macro kwdef, where lint complains about the
condition containing '||' but not about the conditions containing only
'>' or '=='.

(rillig)

2022-04-16 20:18:52 UTC MAIN commitmail json YAML

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

lint: remove null marker from keyword table

No functional change.

(rillig)

2022-04-16 20:02:55 UTC MAIN commitmail json YAML

lint: prepare keyword table for C11

The C11 keywords had been listed as being C99 keywords.  Instead of
initializing the individual fields separately, merge them by specifying
the year of the standard in which they appeared.

No binary change, except for line numbers in assertions.

(rillig)

2022-04-16 19:18:17 UTC MAIN commitmail json YAML

2022-04-16 18:41:22 UTC MAIN commitmail json YAML

tests/lint: fix tests on platforms other than x86_64

In msg_259_ilp32.c 1.6 from 2022-04-15, I removed the option -S from the
test in order to keep the message 259, but I forgot to fix the C99-style
comment as well.

In platform_int.c, the default lint option -S no longer generated
warning 259, so remove that option.

(rillig)

2022-04-16 18:15:23 UTC MAIN commitmail json YAML

2022-04-16 18:13:54 UTC MAIN commitmail json YAML

lint: clean up keyword definitions for the lexer

There is only one specialized keyword that is also a GCC attribute, it's
"section".  All other keywords passed 0 in that macro argument.

No binary change.

(rillig)

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

2022-04-16 17:34:35 UTC MAIN commitmail json YAML

2022-04-16 16:40:54 UTC MAIN commitmail json YAML

Fix mistake in error branch locking caused by previous changes.
vput(vp) also unlocks vp, thus unlocking happens twice in error flow
causing kernel to panic with failed assertion lktype != LK_NONE
in vfs_vnode.c#778. Thanks riastradh with finding the issue.

(andvar)

2022-04-16 15:55:10 UTC MAIN commitmail json YAML

lint: for gnuism and c99ism, calculate severity

Calculating the severity as a simple sum removes the condition sequence
'a && !b, or else a || !b', which can quickly become a brain twister,
especially when negations are involved.

No functional change.

(rillig)

2022-04-16 14:26:26 UTC MAIN commitmail json YAML

Redo the way the builtin cmd 'ulimit' getopt() (nextopt() really, but it
is essentially the same) arg string is generated, to lessen the chances
that the table of limits, and the arg string that allows limits to be
reported or set will get out of sync.  They weren't (as long as we didn't
grow an RLIMIT_SWAP) this is just tidier.

While here, reorder the limits table fields, and shrink a couple that
were needlessly wasteful, to save some space -- for most architectures
this should save 8 bytes per table entry (there are currently 13).
(Some minor code bloat offsets this slightly because of int type
promotions now required).

NFCI.

(kre)

2022-04-16 14:23:36 UTC MAIN commitmail json YAML

While doing the previous change, I noticed that when used in a
particularly perverse way, the error message for a bad octal
constant as the new umask value could incorrectly claim that the
-S option (which would need to be present to cause this issue)
was the detected bad value.  Fix that to report the actual
incorrect arg.

And while fiddling, also check for args to umask that are too big
to be sane mask values (the biggest permitted is 07777) and use
mode_t as the mask variable type, rather than int.

(kre)

2022-04-16 14:20:45 UTC MAIN commitmail json YAML

Avoid generating error messages implying that user errors are illegal.

(kre)

2022-04-16 14:06:11 UTC MAIN commitmail json YAML

lint: clean up conditions for migration check between trad and C90

No functional change, as each of the conditions was effectively '!tflag
&& !sflag && !Sflag' (even if distributed over several statements).

(rillig)

2022-04-16 13:25:27 UTC MAIN commitmail json YAML

lint: model C language levels in a future-compatible way

The options -t, -s and -S are confusing because they are used
inconsistently.  The option -S enables C99 features, but when using it
instead of -s, it also doesn't enable all checks required by C90 and
later.  Prepare fixing of these inconsistencies by replacing the flag
variables with language levels that can be extended in a
straight-forward way as new C standards arrive.

| option | allow_trad | allow_c90 | allow_c99 | allow_c11 |
|--------|------------|-----------|-----------|-----------|
| -t    | x          | -        | -        | -        |
| (none) | x          | x        | -        | -        |
| -s    | -          | x        | -        | -        |
| -S    | -          | x        | x        | -        |
| -Ac11  | -          | x        | x        | x        |

Each usage of the old flag variables will be inspected and migrated
individually, to clean up the subtle variations in the conditions and to
provide a simpler model.

When lint was created in 1995, its focus was migrating traditional C
code to C90 code.  Lint does not help in migrating from C90 to C99 or
from C99 to C11 since there are only few silent changes, and simply
because nobody took the time to implement these migration aids.  If
necessary, such migration modes could be added separately.

There is a small functional change: when the option -s is combined with
either -S or -Ac11, lint now only keeps the last of these options.
Previously, these options could be combined, leading to a mixture of
language levels, halfway between C90, C99 and C11.  Especially combining
traditional C with C11 doesn't make sense, but xlint currently allows
it.

The 3 tests that accidentally specified multiple language levels have
been adjusted to a single language level.

(rillig)

2022-04-16 12:25:10 UTC MAIN commitmail json YAML

2022-04-16 12:24:06 UTC MAIN commitmail json YAML

hdaudiodevs: Add some ~new Intel devices

(nia)

2022-04-16 11:57:46 UTC MAIN commitmail json YAML

x86: Enable HDAUDIOVERBOSE (as on arm) in order for AUDIO_GETDEV
to return human-readable data.  Especially now that HDMI/DP audio
is enabled by default, it helps to be able to tell two devices
apart in audiocfg/aiomixer.

(nia)

2022-04-16 11:13:10 UTC MAIN commitmail json YAML

sequencer(4): VOP_CLOSE requires vnode lock.

Reported-by: syzbot+877c50d819fea9403247@syzkaller.appspotmail.com

(riastradh)

2022-04-16 11:13:01 UTC MAIN commitmail json YAML

sequencer(4): Convert some #if DIAGNOSTIC to assertions.

(riastradh)

2022-04-16 11:12:21 UTC MAIN commitmail json YAML

sequencer(4): Sprinkle KNF.

- Sort includes.
- Nix trailing whitespace.
- No parens for return.
- Blank line between declarations and statements.
- Note MP bug with unit allocation.

No functional change intended.

(riastradh)

2022-04-16 09:53:13 UTC MAIN commitmail json YAML

telnet.1: update state of the art on Single DES encryption

(nia)

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

lint: in C99 mode, allow trailing comma in enum declarations

Adjust the test to be run in C90 mode instead of traditional mode, since
traditional C didn't have enums.

(rillig)

2022-04-16 09:20:01 UTC MAIN commitmail json YAML

2022-04-16 09:18:33 UTC MAIN commitmail json YAML

2022-04-16 08:00:55 UTC MAIN commitmail json YAML

Unlock vnode for VOP_IOCTL() and wapbl_flush().

(hannken)

2022-04-16 07:59:46 UTC MAIN commitmail json YAML

Take the link count from the inode.

(hannken)

2022-04-16 07:59:02 UTC MAIN commitmail json YAML

Lock vnode for VOP_PATHCONF().

(hannken)

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

Lock vnode for vinvalbuf().

(hannken)

2022-04-16 07:57:33 UTC MAIN commitmail json YAML

Unlock vnode for VOP_IOCTL().

(hannken)

2022-04-16 07:56:45 UTC MAIN commitmail json YAML

2022-04-16 00:15:47 UTC MAIN commitmail json YAML

lint: skip duplicate -llib and -Llibdir options

This removes many of the currently 26.000 'multiply defined' lines from
a typical NetBSD build.  Duplicate libraries happen a lot due to
overlapping transitive dependencies.  An example is usr.bin/telnet,
which links to -lcrypto and several other libraries twice.

(rillig)

2022-04-15 23:25:04 UTC MAIN commitmail json YAML

lint: fix typography in manual page

(rillig)

2022-04-15 23:21:33 UTC MAIN commitmail json YAML

libcrypto: remove lint hack for __int128

That hack was added in March 2018, a few months before lint could handle
int128_t in September 2018.

(rillig)

2022-04-15 22:26:36 UTC MAIN commitmail json YAML

libcrypto: suppress a few unneeded lint warnings

(rillig)

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

lint: in C99 mode, do not warn about non-prototype conversions

Message 259 is "argument #%d is converted from '%s' to '%s' due to
prototype", and it is intended to warn about compatibility between
traditional C where functions had no prototypes and standard C where
functions have prototypes.

Running lint in C99 mode is further away from traditional C than running
lint in C90 mode, so that warning doesn't make sense for C99.  There are
still some inconsistencies in the 5 language version modes that lint
offers:

-t for traditional C
(no option) for migrating traditional C to C90
-s for C90 code
-S for C99 code
-Ac11 for C11 code

By disabling warning 259 in C99 mode, a typical NetBSD build produces
14.500 fewer warnings than before, of about 100.000 total.

Message 259 overlaps with message 298 "conversion from '%s' to '%s' may
lose accuracy, arg #%d", and in some cases of potentially lossy
conversions, lint now produces none of these messages.  In some other
cases, these warnings were reported redundantly.  The cases where
message 298 makes sense will be added back later, as needed.

(rillig)

2022-04-15 17:53:44 UTC MAIN commitmail json YAML

Disable FADT LEGACY_DEVICES flag test.

This test had the unintended side-effect of blocking the lm(4) driver
from attaching on more than one system. Go back to (slow) probing of
ISA devices for now to restore existing functionality.

(jmcneill)

2022-04-15 17:08:21 UTC MAIN commitmail json YAML

lint: merge conditions in check_integer_conversion

No functional change.

(rillig)

2022-04-15 16:38:30 UTC MAIN commitmail json YAML

lint: reduce indentation in check_integer_conversion

No functional change.

(rillig)

2022-04-15 16:30:09 UTC MAIN commitmail json YAML

boot.cfg.5: banner can span up to 12 lines, and not 10 like stated.

For the record, the value is set by the BOOTCFG_MAXBANNER macro defined
in sys/lib/libsa/bootcfg.h.

(fcambus)

2022-04-15 16:18:14 UTC MAIN commitmail json YAML

lint: fix typography in manual page

(rillig)

2022-04-15 16:08:39 UTC MAIN commitmail json YAML

lint: in verbose mode, quote shell commands in output

(rillig)

2022-04-15 14:02:08 UTC MAIN commitmail json YAML

2022-04-15 14:01:19 UTC MAIN commitmail json YAML

2022-04-15 14:00:29 UTC MAIN commitmail json YAML

2022-04-15 14:00:07 UTC MAIN commitmail json YAML

merge conflicts between OpenSSH-8.9 and OpenSSH-9.0

(christos)

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

make: document the available preprocessor definitions for Makefile.boot

(rillig)

2022-04-15 12:28:16 UTC MAIN commitmail json YAML

make: do not use __CONCAT and __STRING in meta_needed

Using __CONCAT for identifiers makes it impossible to find their usages
easily, as could be seen in targ.c 1.22 from 2001-07-03.  It also
requires that the parts of the identifier are not macros themselves.

No binary change.

(rillig)

2022-04-15 12:19:28 UTC MAIN commitmail json YAML

make: add .USEBEFORE to Targ_PrintType

When .USEBEFORE was added in targ.c 1.22 from 2001-07-03, it was not
added to Targ_PrintType, probably because the PRINTBIT macro hid the
identifier OP_USE and only used USE.

(rillig)

2022-04-15 09:33:20 UTC MAIN commitmail json YAML

tests/make: adjust expectations to actual behavior

The bug in deptgt-silent-jobs.mk has been fixed, the debug logging for
comparing conditions and for deleting global variables has changed
intentionally.

(rillig)

2022-04-14 19:47:14 UTC MAIN commitmail json YAML

Revert "viornd(4): Process host entropy in softint context."

Apparently this has the effect of sometimes making the network hang
on Google Compute Engine as used by syzbot, which has held up all the
syzkaller testing for weeks now.  Let's revert this for now, and
separately try to figure out what's wrong with it.

(riastradh)

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

iscsid(8) no longer requires scsibus(4) and sd(4) to be built-in to
the kernel.  The scsi_subr module will be loaded if needed to resolve
any dependencies.

(pgoyette)

2022-04-14 16:51:57 UTC MAIN commitmail json YAML

2022-04-14 16:50:27 UTC MAIN commitmail json YAML

Split some common stuff into scsi_subr module.  This enables loading
of the iscsi module whether or not there are any scsi things built
into the kernel.

Addresses the iscsi portion of kern/56772

(pgoyette)

2022-04-14 15:51:29 UTC MAIN commitmail json YAML

Make this no-op variant of fmtcheck() compatible with the libc version
when called with NULL as first argument.

(martin)

2022-04-14 15:48:31 UTC MAIN commitmail json YAML

Fix invalid msg_fmt_table_add() call, pointed out by Andreas Gustafsson.

(martin)

2022-04-13 22:58:19 UTC MAIN commitmail json YAML

lint: remove trailing whitespace from README, add useful breakpoints

(rillig)

2022-04-13 22:41:18 UTC MAIN commitmail json YAML

virtio_pci: Don't use a cast for upcasting.

Same object code is generated.

(uwe)

2022-04-13 22:20:42 UTC MAIN commitmail json YAML

lint: fix lint warning on platforms where size_t == unsigned int

lex.c(1451): warning: argument #1 is converted from 'int' to
    'unsigned int' due to prototype [259]

A more thorough fix would be to change the type of block_level from int
to size_t, to match mem_block_level, but that change would generate
further signedness warnings because the type of sym_t.s_block_level
would have to be changed from int to size_t as well, but some symbols
have s_block_level == -1, so that's a larger and more error-prone
change.  Leave that for later.

Whether message 259 makes sense at all in C99 mode is an entirely
different question that needs to be answered separately.

No functional change.

(rillig)

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

Fix build (enabled only for MKDEBUG?)

(pgoyette)

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

Add a Makefile missed out in a previous commit.

(jkoshy)

2022-04-13 17:52:56 UTC MAIN commitmail json YAML

When building tools use a dedicated subdirectory for compiling
Elftoolchain code.

Build and install <sys/elfdefinitions.h> in ${TOOLDIR}/include.

This change prepares the ground for upgrading libelf and libdwarf to
their current Elftoolchain versions.

(jkoshy)

2022-04-13 15:24:42 UTC MAIN commitmail json YAML

vio9p: Bump max tag len to match QEMU.

QEMU defines it to 32 but includes the final zero byte into the limit.
Our code counts the final zero byte separately, so adjust this define
appropriately.

(uwe)

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

vio9p: Properly negotiate MOUNT_TAG feature.

I _think_ that this is what is intended here.  The code used to
actually test for the presence of any random device independent
feature bits (the test would happen to succeed b/c of INDIRECT_DESC).

(uwe)

2022-04-13 13:50:37 UTC MAIN commitmail json YAML

vio9p: Add definition for the MOUNT_TAG feature bit.

From QEMU sources.

(uwe)

2022-04-13 10:56:11 UTC MAIN commitmail json YAML

virtio: Use UINT64_C() instead of explicit ULL suffix.

(uwe)

2022-04-13 10:50:28 UTC MAIN commitmail json YAML

virtio: G/c accidentally committed comment in previous.

The format spec for the V1 bit was to be committed as a separate
followup commit, but I forgot to take it out.  Sorry...

(uwe)

2022-04-13 10:42:12 UTC MAIN commitmail json YAML

virtio: use the new syntax for snprintb(3) format strings.

The old syntax is limited to 32 bits only (and has 1-based bit numbers
which is rather incovenient too).

(uwe)

2022-04-13 03:39:58 UTC netbsd-9 commitmail json YAML

2022-04-13 03:39:23 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by martin in ticket #1436):
distrib/amd64/ramdisks/common/Makefile.ramdisk: revision 1.16
distrib/amd64/ramdisks/common/list.ramdisk: revision 1.22
Add missing EFI bootloaders to the install kernel ramdisk,
noticed by Lloyd Parkes.

(snj)

2022-04-13 02:28:01 UTC MAIN commitmail json YAML

vioif(4): issue VIRTIO_NET_CTRL_MAC_ADDR_SET command only when
VIRTIO_NET_F_CTRL_MAC_ADDR is negotiated

(yamaguchi)

2022-04-12 21:54:16 UTC MAIN commitmail json YAML

Fix compile breakage when wide char support is disabled.

(blymn)

2022-04-12 21:05:37 UTC MAIN commitmail json YAML

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

2022-04-12 20:27:56 UTC MAIN commitmail json YAML

2022-04-12 11:54:57 UTC MAIN commitmail json YAML

Adapt to libcurses minor bump

(martin)

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

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

2022-04-12 07:03:05 UTC MAIN commitmail json YAML

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

2022-04-11 20:57:38 UTC MAIN commitmail json YAML

2022-04-11 19:37:20 UTC MAIN commitmail json YAML

libedit/chartype.h: portability fix for OSF/1

(tnn)

2022-04-10 19:54:57 UTC MAIN commitmail json YAML

doc/HACKS: add bug report for internal compiler error on alpha

(rillig)

2022-04-10 13:26:47 UTC MAIN commitmail json YAML

PR 56789: document gcc bug workaround for -ftrapv on alpha.

(martin)

2022-04-10 13:21:34 UTC MAIN commitmail json YAML

PR 56789: avoid -ftrapv for alpha, it triggers a gcc error.
OK: rillig

(martin)

2022-04-10 12:14:10 UTC MAIN commitmail json YAML

2022-04-10 11:56:28 UTC MAIN commitmail json YAML

Add missing EFI bootloaders to the install kernel ramdisk,
noticed by Lloyd Parkes.

(martin)

2022-04-10 11:36:32 UTC MAIN commitmail json YAML

2022-04-10 10:38:33 UTC MAIN commitmail json YAML

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

No need to flush icache for EFI RT mappings as bootaa64.efi flushed
the full icache for us.  (Also this avoids traps)

(skrll)

2022-04-10 09:50:47 UTC MAIN commitmail json YAML

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

makefs(8): Fix tool build -- no libutil DPADD if HOSTPROG.

(riastradh)

2022-04-10 00:42:29 UTC MAIN commitmail json YAML

lint: add quickstart documentation to the implementation of lint

(rillig)

2022-04-09 23:52:23 UTC MAIN commitmail json YAML

unix(4): Convert membar_exit to membar_release.

Use atomic_load_consume or atomic_load_relaxed where necessary.

Comment on why unlocked nonatomic access is valid where it is done.

(riastradh)

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

select(9): Use membar_acquire/release and atomic_store_release.

No store-before-load ordering here -- this was obviously always
intended to be load-before-load/store all along.

(riastradh)

2022-04-09 23:51:57 UTC MAIN commitmail json YAML

thmap(9): Convert membar_exit to membar_release.

(riastradh)

2022-04-09 23:51:48 UTC MAIN commitmail json YAML

pool(9): Convert membar_exit to membar_release.

(riastradh)

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

ipi(9): Convert membar_exit/enter to membar_release/acquire.

No store-before-load ordering needed here, just need to ensure that
in

A, ipi_send, ipi receive, B,

memory operations in A happen-before memory operations in B.

(riastradh)

2022-04-09 23:51:09 UTC MAIN commitmail json YAML

ucas(9): Convert membar_exit to membar_release.

(riastradh)

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

rwlock(9): Convert to membar_acquire/release.

Leave an XXX comment where I suspect there might be a missing membar
-- to be audited when I have more time to think!

(riastradh)

2022-04-09 23:46:10 UTC MAIN commitmail json YAML

mutex(9): Convert to membar_acquire/release.

Except for setting the waiters bit -- not sure if this is actually
required to be store-before-load/store.  Seems unlikely -- surely
we'd have seen some serious bug by now if not, because membar_enter
has failed to guarantee that on x86! -- but I'm leaving it for now
until I have time to think enough about it to be sure one way or
another.

(riastradh)

2022-04-09 23:45:45 UTC MAIN commitmail json YAML

vfs(9): Add XXX comment about unclear membar_enter.

(riastradh)

2022-04-09 23:45:37 UTC MAIN commitmail json YAML

kern: Handle l_mutex with atomic_store_release, atomic_load_consume.

- Where the lock is held and known to be correct, no atomic.
- In loops to acquire the lock, use atomic_load_relaxed before we
  restart with atomic_load_consume.

Nix membar_exit.

(Who knows, using atomic_load_consume here might fix bugs on Alpha!)

(riastradh)

2022-04-09 23:45:23 UTC MAIN commitmail json YAML

rumpkern/sleepq: Convert membar_exit/store to atomic_store_release.

(riastradh)

2022-04-09 23:45:14 UTC MAIN commitmail json YAML

rumpkern/scheduler: Use membar_release.

...but add an XXX comment asking for clarity on what it pairs with.

(riastradh)

2022-04-09 23:45:02 UTC MAIN commitmail json YAML

if_shmem(4): Use membar_acquire/release for lock acquire/release.

(riastradh)

2022-04-09 23:44:54 UTC MAIN commitmail json YAML

ena: Convert not-right membar_enter/exit to membar_acquire/release.

Only used on non-x86 and non-aarch64, which probably means this
branch is never used.  (This should really use bus_space_barrier or
bus_dmamap_sync.)

(riastradh)

2022-04-09 23:44:45 UTC MAIN commitmail json YAML

2022-04-09 23:44:25 UTC MAIN commitmail json YAML

linux/ratelimit: Convert to membar_acquire and atomic_store_release.

Simplify while here: atomic_swap is enough, no need for atomic_cas.
(Maybe drm'll run faster on sparcv8 this way...!)

(riastradh)

2022-04-09 23:43:55 UTC MAIN commitmail json YAML

linux/llist: Use membar_release and membar_datadep_consumer.

No need for membar_acquire here!  Loads are all data-dependent.

(riastradh)

2022-04-09 23:43:39 UTC MAIN commitmail json YAML

linux/kref: Fix memory barriers and use membar_release/acquire.

(riastradh)

2022-04-09 23:43:31 UTC MAIN commitmail json YAML

2022-04-09 23:43:20 UTC MAIN commitmail json YAML

mips: Convert lock.h to membar_release/acquire.

(riastradh)

2022-04-09 23:43:12 UTC MAIN commitmail json YAML

hppa: Convert ipiuncs.c to membar_release/acquire.

(riastradh)

2022-04-09 23:42:56 UTC MAIN commitmail json YAML

alpha: Convert ipifuncs.c to membar_release/acquire.

No semantic change is possible because all of these membars are just
mb on alpha -- change just makes the intent clearer.  (Only
membar_producer is weaker, wmb.)

(riastradh)

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

2022-04-09 23:39:18 UTC MAIN commitmail json YAML

alpha: Convert cpu_iccb_send from membar_exit to membar_release.

XXX Maybe this should really use alpha_mb, since it's not writing to
normal MI-type memory so technically the membr_* semantics doesn't
apply?

(riastradh)

2022-04-09 23:39:07 UTC MAIN commitmail json YAML

rtld: Convert membar_exit/enter to membar_release/acquire.

These are basic CAS-based locking primitives needing release and
acquire semantics, nothing fancy here -- except the membar_sync parts
which are questionable but not relevant to the present audit.

(riastradh)

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

libc/atomic: Fix membars in __atomic_load/store_* stubs.

- membar_enter/exit ordering was backwards.
- membar_enter doesn't make any sense for load anyway.
- Switch to membar_release for store and membar_acquire for load.

The only sensible orderings for a simple load or store are acquire or
release, respectively, or sequential consistency.  This never
provided correct sequential consistency before -- we should really
make it conditional on memmodel but I don't know offhand what the
values of memmodel might be and this is at least better than before.

(riastradh)

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)