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

2024-05-10 01:33:38 UTC Now

2021-10-10 23:39:50 UTC MAIN commitmail json YAML

usb: uhub: remove unnecessary delays when powering on ports

In uhub_explore instead of waiting 300ms after powering up each
connected port, power up all of the connected ports and then wait for
300ms total.

(jmcneill)

2021-10-10 23:30:44 UTC MAIN commitmail json YAML

Document the locking rules for the fields of the kevent that's
embedded in a knote.

(thorpej)

2021-10-10 23:28:36 UTC MAIN commitmail json YAML

Use PCI-SIG official acronyms:

- RP stands for Root Port.
- RC stands for Root Complex.
- RCIEP stands for Root Complex Integrated End Point.

(msaitoh)

2021-10-10 23:02:10 UTC MAIN commitmail json YAML

Use VN_KNOTE() to send our NOTE_ATTRIB and NOTE_REVOKE events.

(thorpej)

2021-10-10 20:14:09 UTC MAIN commitmail json YAML

usb: usb_event_thread: remove delay at startup for USB >= 2.0 HCs

The delay at the start of usb_event_thread is meant to slow down EHCI
companion controllers. Skip the 500ms delay if the bus that owns this
thread is USB >= 2.0 since those are never companions.

(jmcneill)

2021-10-10 20:10:12 UTC MAIN commitmail json YAML

xhci: shrink port reset delay

Instead of waiting for USB_PORT_ROOT_RESET_DELAY (250ms) before checking
the port reset status, poll the PORTSC register and return early if the
reset has completed.

(jmcneill)

2021-10-10 19:17:32 UTC MAIN commitmail json YAML

Fix typo in comment.

(wiz)

2021-10-10 19:11:56 UTC MAIN commitmail json YAML

Check _KERNEL_OPT before including opt_ddb.h.

(thorpej)

2021-10-10 19:07:19 UTC MAIN commitmail json YAML

echo: clean up, increase WARNS to 6

Lint can handle __COPYRIGHT and __RCSID, so there is no need to hide
them anymore.

Use proper type 'bool' for nflag, ensure correct types via lint's strict
bool mode.

Remove unnecessary call to exit(0); returning from main is equivalent
since C99.

No functional change.

(rillig)

2021-10-10 18:46:25 UTC MAIN commitmail json YAML

sh: remove useless do-while-0 loop

28 years was more than enough for the useless 'continue' statement in
this do-while-0 "loop". Without the 'continue' statement, there is no
need for the "loop" anymore. The comment at its top was confusing since
the word 'while' suggested a loop, but there was none, so remove that as
well.

Pointed out by Tom Ivar Helbekkmo on source-changes-d.

No change to the resulting binary.

(rillig)

2021-10-10 18:16:12 UTC MAIN commitmail json YAML

tests/lint: remove duplicate platform, generate platforms list

It was an unreliable idea to extract the platform properties from the
targparam.h files manually, even if it was a one-time job. I still made
a mistake by accidentally marking aarch64 as schar, even though it is
uchar, plus I duplicated the line for powerpc64.

Remove the duplicate line, no functional change.

(rillig)

2021-10-10 18:11:31 UTC MAIN commitmail json YAML

The knotes for EVFILT_SIGNAL and EVFILT_PROC are maintained on a single
per-process list, and kern_event.c,v 1.129 has several KASSERT()s in
various code paths that process this list related to the mixing of these
two knote types.  This new unit test is designed specifically to exercise
those KASSERT()s and thus validate their assumptions.

(thorpej)

2021-10-10 18:08:12 UTC MAIN commitmail json YAML

Add a "show kqueue <addr>" command.

(thorpej)

2021-10-10 18:07:52 UTC MAIN commitmail json YAML

Changes to make EVFILT_PROC MP-safe:

Because the locking protocol around processes is somewhat complex
compared to other events that can be posted on kqueues, introduce
new functions for posting NOTE_EXEC, NOTE_EXIT, and NOTE_FORK,
rather than just using the generic knote() function.  These functions
KASSERT() their locking expectations, and deal with other complexities
for each situation.

knote_proc_fork(), in particiular, needs to handle NOTE_TRACK, which
requires allocation of a new knote to attach to the child process.  We
don't want to be allocating memory while holding the parent's p_lock.
Furthermore, we also have to attach the tracking note to the child
process, which means we have to acquire the child's p_lock.

So, to handle all this, we introduce some additional synchronization
infrastructure around the 'knote' structure:

- Add the ability to mark a knote as being in a state of flux.  Knotes
  in this state are guaranteed not to be detached/deleted, thus allowing
  a code path drop other locks after putting a knote in this state.

- Code paths that wish to detach/delete a knote must first check if the
  knote is in-flux.  If so, they must wait for it to quiesce.  Because
  multiple threads of execution may attempt this concurrently, a mechanism
  exists for a single LWP to claim the detach responsibility; all other
  threads simply wait for the knote to disappear before they can make
  further progress.

- When kqueue_scan() encounters an in-flux knote, it simply treats the
  situation just like encountering another thread's queue marker -- wait
  for the flux to settle and continue on.

(The "in-flux knote" idea was inspired by FreeBSD, but this works differently
from their implementation, as the two kqueue implementations have diverged
quite a bit.)

knote_proc_fork() uses this infrastructure to implement NOTE_TRACK like so:

- Attempt to put the original tracking knote into a state of flux; if this
  fails (because the note has a detach pending), we skip all processing
  (the original process has lost interest, and we simply won the race).

- Once the note is in-flux, drop the kq and forking process's locks, and
  allocate 2 knotes: one to post the NOTE_CHILD event, and one to attach
  a new NOTE_TRACK to the child process.  Notably, we do NOT go through
  kqueue_register() to do this, but rather do all of the work directly
  and KASSERT() our assumptions; this allows us to directly control our
  interaction with locks.  All memory allocations here are performed with
  KM_NOSLEEP, in order to prevent holding the original knote in-flux
  indefinitely.

- Because the NOTE_TRACK use case adds knotes to kqueues through a
  sort of back-door mechanism, we must serialize with the closing of
  the destination kqueue's file descriptor, so steal another bit from
  the kq_count field to notify other threads that a kqueue is on its
  way out to prevent new knotes from being enqueued while the close
  path detaches them.

In addition to fixing EVFILT_PROC's reliance on KERNEL_LOCK, this also
fixes a long-standing bug whereby a NOTE_CHILD event could be dropped
if the child process exited before the interested process received the
NOTE_CHILD event (the same knote would be used to deliver the NOTE_EXIT
event, and would clobber the NOTE_CHILD's 'data' field).

Add a bunch of comments to explain what's going on in various critical
sections, and sprinkle additional KASSERT()s to validate assumptions
in several more locations.

(thorpej)

2021-10-10 17:47:39 UTC MAIN commitmail json YAML

Add a test case for the race condition in PR kern/50094, modeled after
the Go run-time scenario described in the PR.

(thorpej)

2021-10-10 17:43:15 UTC MAIN commitmail json YAML

2021-10-10 14:52:30 UTC MAIN commitmail json YAML

UEFI calls can modify size inputs, so stash them for use with kmem_free

(jmcneill)

2021-10-10 13:03:10 UTC MAIN commitmail json YAML

efi: Add /dev/efi character device

Introduce a /dev/efi character device that provides a means for accessing
UEFI RT variable services from userland. Compatible with the FreeBSD ioctl
interface for ease of porting their libefivar and associated tools.

The ioctl interface is defined in sys/efiio.h.

To enable support for this on an arch, the kernel needs `pseudo-device efi`
and the MD EFI implementation needs to register its backend by calling
efi_ops_register(). This commit includes an implementation for Arm.

(jmcneill)

2021-10-10 11:21:05 UTC MAIN commitmail json YAML

audio(9): Issue pserialize_perform outside sc_lock in audiodetach.

Breaks another deadlock between sc_lock and high-priority xcalls at
softint serial.  With any luck, this should be the last such softint
deadlock in audio!

(riastradh)

2021-10-10 11:20:47 UTC MAIN commitmail json YAML

pserialize(9): Lift rule that pserialize_perform be serialized.

There may have been a technical reason for this back when we were
following the expired passive serialization patent to the letter, but
no more -- and this is a real burden for some applications.

(riastradh)

2021-10-10 11:20:29 UTC MAIN commitmail json YAML

audio(9): Call hw_if->getdev without sc_lock.

Holding sc_lock is not necessary -- I reviewed all ~70 cases in-tree,
and none of them rely on state protected by sc_lock.  Essentially
everything just copies from static data or data initialized at attach
time.

(Exceptions: tms320av110.c issues a bus_space_read_1, but I don't see
any reason why that needs to be serialized; and uaudio.c reads from
sc_dying, but that's not necessary and also not protected by sc_lock
anyway.)

Holding sc_lock is harmful because at least hdafg(4) can trigger module
autoload that leads to pserialize_perform, which waits for logic to run
at softint serial on all CPUs; at the same time, audio_softintr_rd/wr
run at softint serial and take sc_lock, so this leads to deadlock.

(riastradh)

2021-10-10 09:17:25 UTC MAIN commitmail json YAML

tests/lint: add more examples for continue in do-while-0

(rillig)

2021-10-10 08:59:45 UTC MAIN commitmail json YAML

2021-10-10 08:45:52 UTC MAIN commitmail json YAML

2021-10-10 08:42:43 UTC MAIN commitmail json YAML

doc: wscons changes

(nia)

2021-10-10 08:36:49 UTC MAIN commitmail json YAML

Add a placeholder for PRRR

(skrll)

2021-10-10 08:35:34 UTC MAIN commitmail json YAML

sh: remove no-op 'continue' from do-while-0 loop

With Clang, the only change to the binary are the line number changes
from __LINE__, GCC generates a bit different code.

No functional change.

(rillig)

2021-10-10 08:19:02 UTC MAIN commitmail json YAML

sh: make find_command simpler

Lint complained about the do-while-0 loop that contained a continue. It
didn't state the reason for it, but indeed the code looked complicated.
Rewrite the code to be less verbose and to use common coding patterns.

No functional change.

(rillig)

2021-10-10 07:50:53 UTC MAIN commitmail json YAML

Catch up with pcireg.h change

(skrll)

2021-10-10 07:41:21 UTC MAIN commitmail json YAML

Need to call pmap_tlb_info_attach for each CPU.  Missed in previous
commit.
CVS ----------------------------------------------------------------------

(skrll)

2021-10-10 07:20:01 UTC MAIN commitmail json YAML

Add Some PCI config information:

- Lane Margining at the Receiver
- NVME admin interface
- UFSHCI
- InfiniBand
- Host fabric
- HDA 1.0 with vendor ext
- USB4 HCI
- MIPI I3C
- Cellular controller/modem (+ Ethernet)

(msaitoh)

2021-10-10 07:15:25 UTC MAIN commitmail json YAML

Use sys/uvm/pmap/pmap_tlb.c on Aarch64 in the same way that some Arm, MIPS,
and some PPC kernels do.  This removes the limitation of 256 processes on
CPUs with 8bit ASID field, e.g. Apple M1.

Additionally the following changes have been made

- removed a couple of unnecessary aarch64_tlbi_all calls
- removed any invalidation after freeing page tables due to
  _pmap_sweep_pdp. This was never necessary afaict.
- all kernel mappings are marked global and userland mapping not-global.

Performance testing hasn't show a significant difference.  The data here
is from building a kernel on an lx2k system with nvme.

before
1489.6u 400.4s 2:40.65 1176.5% 228+224k 0+32289io 57pf+0w
1482.6u 403.2s 2:38.49 1189.9% 228+222k 0+32274io 46pf+0w
1485.4u 402.2s 2:37.27 1200.2% 228+222k 0+32275io 12pf+0w

after
1493.9u 404.6s 2:37.50 1205.4% 227+221k 0+32265io 48pf+0w
1485.0u 408.0s 2:38.54 1194.0% 227+222k 0+32272io 36pf+0w
1484.3u 407.0s 2:35.88 1213.3% 228+224k 0+32268io 14pf+0w

>>> stats.ttest_ind([160.65,158.49,157.27], [157.5,158.54,155.88])
Ttest_indResult(statistic=1.1923622711296888, pvalue=0.2990182944606766)
>>>

(skrll)

2021-10-10 07:09:20 UTC MAIN commitmail json YAML

Whitespace fix. No functional change.

(msaitoh)

2021-10-09 22:03:38 UTC MAIN commitmail json YAML

tests/lint: demonstrate wrong warning about nonportable char comparison

Seen in bin/sh/expand.c:273.

(rillig)

2021-10-09 21:56:12 UTC MAIN commitmail json YAML

lint: add more details to warning about nonportable character comparison

Especially when macros are involved, this makes it easier to see that
there is a real problem.

Seen in bin/sh/expand.c:273, where a plain char is compared to numbers
larger than 127.

(rillig)

2021-10-09 21:31:36 UTC MAIN commitmail json YAML

dd: fix lint warnings about effectively discarding 'const'

args.c(153): warning: call to 'bsearch' effectively discards 'const'
    from argument [346]
args.c(383): dito
args.c(475): dito

No functional change.

(rillig)

2021-10-09 21:25:39 UTC MAIN commitmail json YAML

2021-10-09 21:06:31 UTC MAIN commitmail json YAML

bin: in builds with MKLINT=yes, run lint on all programs

(rillig)

2021-10-09 21:02:53 UTC MAIN commitmail json YAML

sh: ignore lint error about 'continue' in 'do while' loop

exec.c(575): error: continue in 'do ... while (0)' loop [323]
jobs.c(203): error: continue in 'do ... while (0)' loop [323]

It is certainly a rarely used feature, I saw it the first time today and
had to look up its meaning in the C standard. But after that, I don't
see why a 'continue' statement in a 'do while' loop should be an error.
Maybe a warning since up to now I thought that 'continue' would jump
back to the top of the loop, while it really jumps to the bottom of the
loop body, for all 3 kinds of loops.

(rillig)

2021-10-09 20:59:47 UTC MAIN commitmail json YAML

Handle wskbd(9) .set_leds op in cngetc(9) using wskbd_cnattach(9) cookie.

XXX1: LUNA's keyboards emulate "mechanical lock" for CAP and Kana keys,
      i.e. it sends "DOWN" code only when CAP/Kana LEDs are turned on
      and send "UP" code only when the LEDs are turned off.
      The MD omkbd_input() via wskbd_input(9) for the normal wskbd(4)
      (i.e. ttyE0) devices handles this quirk, but MI wskbd_cngetc()
      in sys/dev/wscons/wskbd.c can do nothing for this.

XXX2: I wonder if we should have an independent .set_leds op for cons(9)
      as cnbell(9), rather than referring a device specific softc stuff
      during .set_leds op in struct wskbd_accessop (registered during
      autoconf(9) via struct wskbddev_attach_args passed to config_found(9))
      even for wskbd cngetc(9) op in struct wskbd_consops (registered
      via early wskbd_cnattach(9)).

(tsutsui)

2021-10-09 20:44:55 UTC MAIN commitmail json YAML

dd: clean up function summary

No functional change. Ideally the binary would have stayed the same, but
GCC 10.3.0 inserts a nop and reorders the code.

(rillig)

2021-10-09 20:29:23 UTC MAIN commitmail json YAML

dd: fix lint error about 'return expr' from void function

No change to the resulting binary. The 'return' statements are necessary
for GCC to generate the exact same object code, even though they can be
removed without affecting the functionality, as seen before the 'else'.

(rillig)

2021-10-09 20:07:37 UTC MAIN commitmail json YAML

indent: fix lint warning about bsearch discarding 'const'

lexi.c(433): warning: call to 'bsearch' effectively discards 'const'
    from argument [346]

(rillig)

2021-10-09 20:03:20 UTC MAIN commitmail json YAML

lint: warn that bsearch effectively discards 'const'

Just like strchr, bsearch takes a const pointer and returns a non-const
pointer into the same object.

(rillig)

2021-10-09 20:00:42 UTC MAIN commitmail json YAML

2021-10-09 19:18:53 UTC MAIN commitmail json YAML

tests/lint: test effective unconst cast using bsearch

Seen in usr.bin/indent/lexi.c, function lexi.

(rillig)

2021-10-09 14:22:42 UTC MAIN commitmail json YAML

2021-10-09 13:57:55 UTC MAIN commitmail json YAML

tests/lint: test getopt with an options string starting with ':'

(rillig)

2021-10-09 13:09:17 UTC MAIN commitmail json YAML

efiboot: add "setup" command

The "setup" command sets the 64-bit "OsIndications" variable to the value of
EFI_OS_INDICATIONS_BOOT_TO_FW_UI and requests a reboot. On firmware that
supports this, after reboot the user will be presented with the firmware
setup menu.

(jmcneill)

2021-10-09 11:13:25 UTC MAIN commitmail json YAML

indent: condense code for calculating indentations

No functional change.

(rillig)

2021-10-09 11:00:27 UTC MAIN commitmail json YAML

2021-10-09 10:56:13 UTC MAIN commitmail json YAML

2021-10-09 09:07:21 UTC MAIN commitmail json YAML

ftp: fix -? more portably

Start the optstring with ":" (which implicitly disables opterr),
and handle '?' with optopt=='?' separately to ':'.
Fixes -? display of full usage on other platforms.

(lukem)

2021-10-09 09:06:28 UTC MAIN commitmail json YAML

Consistent #if for static helper function add_entropy

(martin)

2021-10-09 08:25:33 UTC MAIN commitmail json YAML

Update documentation to mention current status of X11

(jandberg)

2021-10-09 08:21:03 UTC MAIN commitmail json YAML

Disable some installer options to shrink the ramdisk image

(martin)

2021-10-09 07:01:35 UTC MAIN commitmail json YAML

2021-10-09 04:26:37 UTC MAIN commitmail json YAML

COPYING: convert to 2 clause BSD license

(lukem)

2021-10-08 23:55:44 UTC MAIN commitmail json YAML

indent: merge duplicate code in lexer

No functional change.

(rillig)

2021-10-08 23:53:37 UTC MAIN commitmail json YAML

2021-10-08 23:47:41 UTC MAIN commitmail json YAML

indent: clean up comments, parentheses, debug messages, boolean operator

No functional change.

(rillig)

2021-10-08 23:43:33 UTC MAIN commitmail json YAML

indent: rename in_or_st to init_or_struct

This makes a few comments redundant.

No functional change.

(rillig)

2021-10-08 23:40:08 UTC MAIN commitmail json YAML

indent: remove 'global' from the list of keywords

Since 1978, 'global' has not been a keyword in C. Moreover, it was
declared as a type while its name would rather suggest a storage class.

Removing the keyword fixes the formatting of variables named 'global'.

(rillig)

2021-10-08 23:30:17 UTC MAIN commitmail json YAML

xf86-input-ws: Port auto-calibration bits from xf86-input-mouse.

Needed for absolute input devices where pointer coordinates do not
match the display size.

Tested by jmcneill.

(nia)

2021-10-08 23:08:06 UTC MAIN commitmail json YAML

gnu-efi: x86_64 build fixes for NetBSD

(jmcneill)

2021-10-08 23:04:02 UTC MAIN commitmail json YAML

2021-10-08 22:37:34 UTC MAIN commitmail json YAML

indent: replace unreachable code with assertions

The input buffer is always supposed to be terminated with a newline. The
function inbuf_read_line silently skips null characters. Since the input
buffer is redirected to a temporary buffer in some cases, do not simply
remove this supposed dead code, but replace it with assertions.

In any case, if the code for calling inbuf_read_line had been reachable
and actually allocated a different buffer, continuing to use the pointer
p would have invoked undefined behavior anyway.

(rillig)

2021-10-08 22:27:52 UTC MAIN commitmail json YAML

indent: use standard error handling for unterminated comment

Just writing it to stdout is bad, especially when indent is used in
filter mode. Silently continuing after such an error is bad as well.

echo '/*' | indent

(rillig)

2021-10-08 22:22:14 UTC MAIN commitmail json YAML

indent: remove redundant conditions

No functional change.

(rillig)

2021-10-08 22:17:36 UTC MAIN commitmail json YAML

indent: convert ps.box_com to local variable

This variable is only used in a single function, and that function does
not call any other function that could replace the parser state or
install a temporary parser state.

No functional change.

(rillig)

2021-10-08 22:11:26 UTC MAIN commitmail json YAML

2021-10-08 22:07:11 UTC MAIN commitmail json YAML

2021-10-08 21:48:33 UTC MAIN commitmail json YAML

2021-10-08 21:41:29 UTC MAIN commitmail json YAML

Use BOOT_FLAG() to recognize standard boot options.

(ryo)

2021-10-08 21:32:28 UTC MAIN commitmail json YAML

2021-10-08 21:24:41 UTC MAIN commitmail json YAML

indent: clean up typename handling

Unexport typenames list.

Replace standard binary search with custom binary search that returns
the inserting position.

In is_typename, take advantage of the buffer type instead of using
the standard C recipe for str_ends_with.

No functional change.

(rillig)

2021-10-08 21:18:43 UTC MAIN commitmail json YAML

indent: enhance comments for lex_number state machine

No functional change.

(rillig)

2021-10-08 21:16:23 UTC MAIN commitmail json YAML

indent: improve local variable names

No functional change.

(rillig)

2021-10-08 21:13:58 UTC MAIN commitmail json YAML

2021-10-08 20:45:22 UTC MAIN commitmail json YAML

indent: clean up process_decl, replace unnecessary strlen

No functional change.

(rillig)

2021-10-08 20:33:18 UTC MAIN commitmail json YAML

indent: remove unnecessary forward declarations

No functional change.

(rillig)

2021-10-08 20:28:56 UTC MAIN commitmail json YAML

indent: reduce negations in main_loop

No functional change.

(rillig)

2021-10-08 20:24:06 UTC MAIN commitmail json YAML

Restore having a BIOS-only amd64 USB image.

Several people reported having hardware that struggles booting the mix
EFI+BIOS image, and it's better to offer them a working image.

Keeping the EFI image as having the obvious name, this is going to become
more likely to work by default as newer hardware may not support BIOS boot.

(XXX pullup-9)

(maya)

2021-10-08 20:23:23 UTC MAIN commitmail json YAML

2021-10-08 20:14:52 UTC MAIN commitmail json YAML

indent: fix parsing of preprocessor lines with comments and strings

(rillig)

2021-10-08 20:07:44 UTC MAIN commitmail json YAML

indent: clean up argument handling

Sort the macros, remove redundancy from comment.

Remove redundant lint comment. Lint still does not recognize
__attribute__((__noreturn__)), but it also doesn't perform advanced
control flow analysis, so there is no point in having the comment, as it
doesn't suppress any warnings.

No functional change.

(rillig)

2021-10-08 20:04:26 UTC MAIN commitmail json YAML

2021-10-08 19:27:20 UTC MAIN commitmail json YAML

indent: unexport add_typedefs_from_file

No functional change.

(rillig)

2021-10-08 19:22:19 UTC MAIN commitmail json YAML

indent: constify detection of function names

No functional change.

(rillig)

2021-10-08 19:03:34 UTC MAIN commitmail json YAML

indent: run indent on indent.h

The formatting looks mostly OK.

Some struct members had excessively long names, leaving no space for
their corresponding comments. Renamed some of them using well-known
abbreviations.

The formatting for debug_vis_range is messed up, no idea why. It is
clearly a function declaration, not a function definition, so there is
no need to place the function name in column 1.

No functional change.

(rillig)

2021-10-08 18:29:36 UTC MAIN commitmail json YAML

indent: fix formatting of C99 comments

The first attempt at formatting C99 comments was conceptually wrong. It
accessed the next token in dump_line, even though that function should
only ever look at the buffers for the label, the code and the current
comment. (Understanding that part of the code was difficult at that time
due to the sheer number of global variables.) The complicated and
ever-growing condition for whether to output the token was a hack and in
retrospect doesn't make sense at all, that's why it only came close to
the intended effect.

Some unintended side effects were that the C99 comments had an
additional space in front of them, and that in some cases an empty line
followed the comment, and that the comments were not aligned.

Previously, the newline that terminates the C99 comment was included in
the comment. Separating the newline from the comment fixed all these
unintended side effects. The only downside is that the multi-line
statement is not indented, but that should be easy to fix.

(rillig)

2021-10-08 18:02:57 UTC MAIN commitmail json YAML

Change the default shell of the "toor" user to /rescue/sh

toor is a backup account to be used in case of trouble.

When root's default shell was changed to from /bin/csh to /bin/sh,
toor lost its purpose.

/rescue/sh is an ideal choice here because it's a static binary,
while we've moved to dynamic linking for the rest of the system.

Discussed a few times over the years on tech-userlevel.

(nia)

2021-10-08 17:56:12 UTC MAIN commitmail json YAML

indent: split dump_line into smaller functions

No functional change.

(rillig)

2021-10-08 17:26:56 UTC MAIN commitmail json YAML

indent: reduce scope of t_ptr in process_comment

No functional change.

(rillig)

2021-10-08 17:19:50 UTC MAIN commitmail json YAML

indent: replace column calculations with indent, part 4/4

(rillig)

2021-10-08 17:12:08 UTC MAIN commitmail json YAML

indent: replace column calculations with indent, part 3

No functional change.

(rillig)

2021-10-08 17:07:36 UTC MAIN commitmail json YAML

indent: replace column calculations with indent, part 2

No functional change.

(rillig)

2021-10-08 17:04:13 UTC MAIN commitmail json YAML

indent: calculate indentation instead of column

This avoids constantly adding and subtracting 1.

No functional change.

(rillig)

2021-10-08 17:00:21 UTC MAIN commitmail json YAML

indent: reduce indentation in dump_line

(rillig)

2021-10-08 16:47:42 UTC MAIN commitmail json YAML

indent: split process_keyword_do_else into separate functions

No functional change.

(rillig)

2021-10-08 16:20:33 UTC MAIN commitmail json YAML

indent: rename tokens lparen and rparen to be more precise

No functional change.

(rillig)

2021-10-08 16:16:54 UTC MAIN commitmail json YAML

indent: merge headers into a single file

No functional change.

(rillig)

2021-10-08 15:59:56 UTC MAIN commitmail json YAML

Re-enable the entropy handling code in sysinst (only visible on machines
that do not have full entropy), but move it to the config menu
instead of enforcing it as mandatory step.

This menu is shown at the end of the setup, or if explicitly invoked
from the main menu.

Some of the input options are complex but useful in some situations
and code to support them is tiny. Most users will use the manual input
(first + default option) but some might prefer to connect a USB TRNG
or have easy setups to transfer entropy from another machine (while
copy & paste on a serial console sometimes is tricky).

(martin)

2021-10-08 15:01:21 UTC netbsd-8 commitmail json YAML

2021-10-08 14:59:59 UTC netbsd-8 commitmail json YAML

Pull up following revision(s) (requested by hannken in ticket #1698):

sys/kern/sys_pipe.c: revision 1.157

Fix a deadlock where one thread writes to a pipe, has more data
and no space in the pipe and waits on "pipe_wcv" while the reader
is closing the pipe and waits on "pipe_draincv".

Swap the test for "PIPE_EOF" and the "cv_wait_sig()" in "pipe_write()".

PR bin/56422 "zgrep -l sometimes hangs"

(martin)

2021-10-08 14:59:08 UTC netbsd-9 commitmail json YAML

2021-10-08 14:58:08 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by hannken in ticket #1357):

sys/kern/sys_pipe.c: revision 1.157

Fix a deadlock where one thread writes to a pipe, has more data
and no space in the pipe and waits on "pipe_wcv" while the reader
is closing the pipe and waits on "pipe_draincv".

Swap the test for "PIPE_EOF" and the "cv_wait_sig()" in "pipe_write()".

PR bin/56422 "zgrep -l sometimes hangs"

(martin)

2021-10-08 14:45:07 UTC MAIN commitmail json YAML

Add swab tests from RVP.

(christos)

2021-10-08 14:44:49 UTC MAIN commitmail json YAML

PR/56443: RVP: dd conv=swab doesn't always work

(christos)

2021-10-08 07:17:32 UTC MAIN commitmail json YAML

Fix a logic botch to actually apply the ASID limit returned by
pmap_md_tlb_asid_max.

(skrll)

2021-10-07 23:18:47 UTC MAIN commitmail json YAML

indent: rename bp_save to saved_inp_s, be_save to saved_inp_e

Using the same naming convention makes it easier to relate the
variables.

No functional change.

(rillig)

2021-10-07 23:15:16 UTC MAIN commitmail json YAML

indent: group variables for the input buffer

The input buffer follows the same concept as the intermediate buffers
for label, code, comment and token, so use the same type for it.

No functional change.

(rillig)

2021-10-07 23:01:32 UTC MAIN commitmail json YAML

indent: move definition of bufsize from header to implementation

No functional change.

(rillig)

2021-10-07 22:56:49 UTC MAIN commitmail json YAML

2021-10-07 22:52:13 UTC MAIN commitmail json YAML

indent: clean up code, remove outdated wrong comments

No functional change.

(rillig)

2021-10-07 21:57:21 UTC MAIN commitmail json YAML

2021-10-07 21:52:54 UTC MAIN commitmail json YAML

2021-10-07 21:43:20 UTC MAIN commitmail json YAML

2021-10-07 21:41:59 UTC MAIN commitmail json YAML

2021-10-07 21:38:25 UTC MAIN commitmail json YAML

2021-10-07 21:16:36 UTC MAIN commitmail json YAML

indent: reduce indentation

No functional change.

(rillig)

2021-10-07 19:42:42 UTC MAIN commitmail json YAML

indent: remove global variable option_source

It is only needed at startup, while parsing the options. The string "?"
was not needed at all.

No functional change.

(rillig)

2021-10-07 19:35:50 UTC MAIN commitmail json YAML

2021-10-07 19:17:07 UTC MAIN commitmail json YAML

indent: add high-level API for working with buffers

This makes the code more boring to read, which is actually good. Less
fiddling with memcpy and pointer arithmetics.

Since indent is not a high-performance tool used for bulk operations on
terabytes of source code, there is no need to squeeze out every possible
CPU cycle.

No functional change.

(rillig)

2021-10-07 18:48:32 UTC MAIN commitmail json YAML

indent: rename copy_id to copy_token

No functional change.

(rillig)

2021-10-07 18:32:09 UTC MAIN commitmail json YAML

2021-10-07 18:19:07 UTC MAIN commitmail json YAML

indent: prevent division by zero

(rillig)

2021-10-07 18:07:25 UTC MAIN commitmail json YAML

2021-10-07 17:38:21 UTC MAIN commitmail json YAML

indent: complain if the profile from the command line does not exist

(rillig)

2021-10-07 17:31:33 UTC MAIN commitmail json YAML

indent: allow long comments in profile files

When reading a comment in a profile file, don't store the characters of
the comment in the buffer, just skip them. This allows for long comments
without triggering overflow errors.

(rillig)

2021-10-07 16:45:38 UTC MAIN commitmail json YAML

indent: prevent buffer overflow when reading profile

(rillig)

2021-10-07 13:04:18 UTC MAIN commitmail json YAML

2021-10-07 12:52:27 UTC MAIN commitmail json YAML

2021-10-07 09:58:27 UTC MAIN commitmail json YAML

Reduce diff with cpufunc_asm_armv5.S, from which this file was derived.

(rin)

2021-10-07 09:57:27 UTC MAIN commitmail json YAML

2021-10-07 07:13:35 UTC MAIN commitmail json YAML

2021-10-07 06:44:19 UTC MAIN commitmail json YAML

Fix the lib/libc/setjmp/t_setjmp:{,_}longjmp_zero test cases

(skrll)

2021-10-07 00:11:08 UTC MAIN commitmail json YAML

Also print the device name with aprint_naive, like wss@pnpbios does.

(uwe)

2021-10-07 00:01:45 UTC MAIN commitmail json YAML

Fix KASSERT triggered when attaching opl at wss@isapnp.

Not really tested (no h/w), but this problem is exhibited by the
congruent code in acpi and pnpbios attachments.

wss has two attributes, "wss" and "audiobus", and this call didn't
specify an iattr for opl to attach to.  config_search_internal asserts
that when no iattr is specified, the parent should only have one.

(uwe)

2021-10-06 23:58:49 UTC MAIN commitmail json YAML

Fix KASSERT triggered when attaching opl at wss@pnpbios

wss has two attributes, "wss" and "audiobus", and this call didn't
specify an iattr for opl to attach to.  config_search_internal asserts
that when no iattr is specified, the parent should only have one.

(uwe)

2021-10-06 20:42:44 UTC MAIN commitmail json YAML

2021-10-06 20:36:58 UTC MAIN commitmail json YAML

2021-10-06 20:10:42 UTC MAIN commitmail json YAML

Don't use aprint_normal_dev("") to print the device name.

wssattach eventually calls ad1848_attach that prints the chip name
with ": %s".  Usually that is a continuation of the attachment line,
e.g.

  audiocs0 at ebus0 bar 14 offset 0x200000 line 3: CS4231A

but the wss? at acpi?: ... line we print is so long that we terminate
it and start a new one exclusively for ad1848_attach.  Hence we do NOT
want the colon that _dev version supplies, it will be supplied by the
callee.

(uwe)

2021-10-06 18:41:34 UTC MAIN commitmail json YAML

Fix KASSERT triggered when attaching opl at wss.

wss has two attributes, "wss" and "audiobus", and this call didn't
specify an iattr for opl to attach to.  config_search_internal asserts
that when no iattr is specified, the parent should only have one.

The same problem probably exists for other wss attachments, as opl is
not attached from wssattach, but from each wss_*_attach, so they need
a similar change.

(uwe)

2021-10-06 17:04:49 UTC MAIN commitmail json YAML

Sort variable declarations.  Add short comments while here.

The list was neither sorted nor grouped logically when db_dumpstack
and db_panicstackframes were added to modify the panic behavior.

(uwe)

2021-10-06 12:18:20 UTC MAIN commitmail json YAML

KNF: The function type must be declared on a line by itself.

(uwe)

2021-10-06 12:14:51 UTC MAIN commitmail json YAML

Add DDB_DUMPSTACK to opt_ddbparam.h.
PR kern/56445

(uwe)

2021-10-06 12:12:39 UTC MAIN commitmail json YAML

One option per-line for opt_ddbparam.h options.  Sort.

(uwe)

2021-10-06 11:26:21 UTC MAIN commitmail json YAML

EFIBOOT_FDT=yes for riscv64 too

(jmcneill)

2021-10-06 10:15:20 UTC MAIN commitmail json YAML

2021-10-06 10:13:20 UTC MAIN commitmail json YAML

2021-10-06 09:06:21 UTC MAIN commitmail json YAML

Add what must be an overlooked newline in the normal output.

(he)

2021-10-06 05:33:15 UTC MAIN commitmail json YAML

2021-10-06 05:29:32 UTC MAIN commitmail json YAML

2021-10-06 05:25:53 UTC MAIN commitmail json YAML

Update the description of the NMBCLUSTERS. Add NMBCLUSTERS_MAX.

(msaitoh)

2021-10-06 05:24:54 UTC MAIN commitmail json YAML

Fix a bug that NMBCLUSTERS(kern.mbuf.nmbclusters) can't be changed by sysctl.

(msaitoh)

2021-10-05 23:35:39 UTC MAIN commitmail json YAML

Sprinkle more markup in previous.  Sync argument names.

(uwe)

2021-10-05 22:22:46 UTC MAIN commitmail json YAML

indent: use buffer type in debug_print_buf

That function had been created before 'struct buffer' was invented,
therefore it used two pointers as parameters. Remove this redundancy.

No functional change.

(rillig)

2021-10-05 22:17:15 UTC MAIN commitmail json YAML

2021-10-05 22:15:32 UTC MAIN commitmail json YAML

byacc: fix line number information for code coverage

Previously, running gcov on a parser generated by byacc resulted in
obviously wrong counts. There were empty lines that had counts, and the
same counts spilled over to some nearby lines.

Only generate preprocessor line directives for the actual action code,
switch back to an empty filename for the glue code.

This only fixes the parsers in default mode. Parsers that use the
backtracking option may still report wrong counts.

Reported upstream via private mail.

(rillig)

2021-10-05 22:09:05 UTC MAIN commitmail json YAML

indent: run indent on lexi.c, with manual corrections

The variables 'keywords' and 'typenames' were indented using 8 spaces,
even though -di0 was in effect, which should result in a single space,
and -ut was in effect, which should result in a single tab instead of 8
spaces.

The option -eei does not work as advertised, the controlling expressions
are only indented by the normal amount, which easily leads to confusion
as to whether the code belongs to the condition or the following
statement.

(rillig)

2021-10-05 21:55:22 UTC MAIN commitmail json YAML

indent: untangle complicated condition in probably_typedef

No functional change.

(rillig)

2021-10-05 21:05:12 UTC MAIN commitmail json YAML

indent: rewrite parse_indent_comment for human readers

The generated code is still very similar, GCC does a good job at
inlining strncmp.

No functional change.

(rillig)

2021-10-05 21:01:10 UTC MAIN commitmail json YAML

2021-10-05 19:58:38 UTC MAIN commitmail json YAML

indent: fix outdated comment, add 'const'

(rillig)

2021-10-05 19:43:05 UTC MAIN commitmail json YAML

tests/indent: demonstrate bugs in -bacc and -nbacc

This part of indent has been broken since at least 2000. The update from
FreeBSD indent on 2019-04-04 made it worse than before.

To see the various results over time, older versions of indent compile
fine if they get passed the -fcommon compiler option.

(rillig)

2021-10-05 19:25:28 UTC MAIN commitmail json YAML

Tweak markup.  Sync argument names between text and synopsis.

(uwe)

2021-10-05 18:56:24 UTC MAIN commitmail json YAML

2021-10-05 18:50:42 UTC MAIN commitmail json YAML

indent: rename n_real_blanklines

The word 'n' was not as helpful as possible, the word 'real' did not
give any clue at all about the variable's purpose.

No functional change.

(rillig)

2021-10-05 18:21:03 UTC MAIN commitmail json YAML

tests/indent: test indentation of nested declarations and statements

(rillig)

2021-10-05 18:09:13 UTC MAIN commitmail json YAML

2021-10-05 18:00:29 UTC MAIN commitmail json YAML

PR/53299: RVP: kernfs and procfs are broken when sysctl security.curtain
is enabled

(christos)

2021-10-05 17:27:11 UTC MAIN commitmail json YAML

tests/indent: document missing space between '){'

(rillig)

2021-10-05 17:14:45 UTC MAIN commitmail json YAML

indent: fix off-by-one error for indented first line

(rillig)

2021-10-05 17:12:20 UTC MAIN commitmail json YAML

indent: make off-by-one error in main_prepare_parsing more visible

No functional change.

(rillig)

2021-10-05 17:09:45 UTC MAIN commitmail json YAML

2021-10-05 16:36:58 UTC MAIN commitmail json YAML

Add sht4xtemp(4). Sort.

(nia)

2021-10-05 16:33:25 UTC MAIN commitmail json YAML

indent: make variable names more expressive

The abbreviation 'dec' looked too much like 'decimal' instead of the
intended 'declaration'.

No functional change.

(rillig)

2021-10-05 14:18:18 UTC MAIN commitmail json YAML

fix a panic "m_verify_packet: inconsistent mbuf length" on aq(4).

- If mbuf cannot be allocated or some errors occur when receiving a jumboframe,
  it is necessary to free mbuf chains of the packet being received, and ignore
  the subsequent segments that make up the packet.
- Even if aq_rx_intr() is completed in the middle of the jumboframe
  reception process, it will resume normally at the next aq_rx_intr().

(ryo)

2021-10-05 11:08:04 UTC netbsd-9 commitmail json YAML

2021-10-05 11:06:58 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by christos in ticket #1356):

lib/libc/resolv/res_init.c: revision 1.32
lib/libc/resolv/res_private.h: revision 1.4

kqueue(2) file descriptors are not inherited across fork(2). A
process that that calls getaddrinfo(3) will end up cacheing the
kqueue(2) file descriptor in its res_state structure. If that
process fork(2)s and calls getaddrinfo(3) again might end up closing
that cached file descriptor which can end up pointing to a different
file object than the kqueue(2) original one. To fix this, associate
the kqueue(2) file descriptor with the process id that created it,
and don't close(2) it if it is being closed from a different process.

An alternative fix would be to attach the resolver to a fork(2) hook
to cleanup the res_state, but handling it internally in the resolver
is less intrusive. This was discovered by Dima Veselov when using
the FreeRADIUS package.

(martin)

2021-10-05 11:02:18 UTC netbsd-9 commitmail json YAML

Pull up following revision(s) (requested by christos in ticket #1355):

lib/libpthread/pthread_cancelstub.c: revision 1.39
lib/libc/sys/Makefile.inc: revision 1.247
lib/libpthread/pthread_cancelstub.c: revision 1.40

PR/56424: Clay Mayers: recvfrom() is not a cancelation point as documented
in pthread_setcanceltype.3

remove parameter names from decls.

(martin)

2021-10-05 11:01:49 UTC MAIN commitmail json YAML

2021-10-05 08:21:10 UTC MAIN commitmail json YAML

Advertise ATAC_CAP_DATA32 also for memory-mapped mode.

It seems that this flag bit is not enabled because memory-mapped mode
has its own wdc_softc:data{in,out}_pio routines. However, nowadays,
32-bit data access capability of a disk drive is not checked by ata(4)
backend unless this flag bit is set.

Tested with CF cards of few vendors and hd64461pcmcia(4) found for some
hpcsh machine models.

(rin)

2021-10-05 08:08:40 UTC MAIN commitmail json YAML

Do not establish the unused interrupt handler for memory-mapped mode,
for the sake of clarity.

(rin)

2021-10-05 08:01:05 UTC MAIN commitmail json YAML

PR kern/56403

Fix kernel freeze for wdc(4) variants with ATAC_CAP_NOIRQ:

(1) Change ata_xfer_ops:c_poll from void to int function. When it returns
    ATAPOLL_AGAIN, let ata_xfer_start() iterate itself again.

(2) Let wdc_ata_bio_poll() return ATAPOLL_AGAIN until ATA_ITSDONE is
    achieved.

A similar change has been made for mvsata(4) (see mvsata_bio_poll()),
and no functional changes for other devices.

This is how the drivers worked before jdolecek-ncq branch was merged.

Note that this changes are less likely to cause infinite recursion:

(1) wdc_ata_bio_intr() called from wdc_ata_bio_poll() asserts ATA_ITSDONE
    in its error handling paths via wdc_ata_bio_done().

(2) Return value from c_start (= wdc_ata_bio_start()) is checked in
    ata_xfer_start().

Therefore, errors encountered in ata_xfer_ops:c_poll and c_start routines
terminate the recursion for wdc(4). The situation is similar for mvsata(4).

Still, there is a possibility where ata_xfer_start() takes long time to
finish a normal operation. This can result in a delayed response for lower
priority interrupts. But, I've never observed such a situation, even when
heavy thrashing takes place for swap partition in wd(4).

"Go ahead" by jdolecek@.

(rin)

2021-10-05 07:05:51 UTC MAIN commitmail json YAML

indent: remove variable name prefix 'inout_'

This makes the variable names more readable. The prefix is not actually
needed to understand the code, it is rather distracting.

The compiler and lint will guard against any accidental mismatch between
pointer, integer and bool.

No functional change.

(rillig)

2021-10-05 07:05:40 UTC MAIN commitmail json YAML

Fix riscv32 GENERIC build

(skrll)

2021-10-05 06:55:24 UTC MAIN commitmail json YAML

indent: fix Clang-Tidy warnings, clean up bakcopy

The comment above and inside bakcopy had been outdated for at least the
last 28 years, the backup file is named "%s.BAK", not ".B%s".

Prevent buffer overflow for very long filenames (sprintf -> snprintf).

(rillig)

2021-10-05 06:49:19 UTC MAIN commitmail json YAML

2021-10-05 06:24:06 UTC MAIN commitmail json YAML

indent: rename local char variable, reduce scope of counters

No functional change.

(rillig)

2021-10-05 06:15:25 UTC MAIN commitmail json YAML

indent: use proper escape sequence for form feed

This escape sequence has been available since at least 1978.

(rillig)

2021-10-05 06:09:42 UTC MAIN commitmail json YAML

2021-10-05 05:56:49 UTC MAIN commitmail json YAML

indent: clean up code for appending to buffers

Use *e++ for appending and e[-1] for testing the previously appended
character, like in other places in the code.

No functional change.

(rillig)

2021-10-05 05:39:14 UTC MAIN commitmail json YAML

indent: merge duplicate code for reading from input buffer

No functional change.

(rillig)

2021-10-05 04:17:58 UTC MAIN commitmail json YAML

Drop unicast packets that are not for us
when lagg(4) is not in promisc

(yamaguchi)

2021-10-05 04:09:49 UTC MAIN commitmail json YAML

Replace the list for vlan interfaces with the counter

The list had been used in vlan_ifdetach(), but it is no longer in
use as a linked list by introducing ether_ifdetach hook.

(yamaguchi)

2021-10-05 01:23:39 UTC MAIN commitmail json YAML

Update agcre to version 20211001

20211001
========

+ move to a single source file, which can just be included as a single file
(the library method can still be used for this as well - sometimes, it's just easier to
drop in a single file to other projects)

+ add AGCRE_EMBED_CTAGS as a primary regular expresion type (same as basic regexps,
but where a '*' occurs as a non-column 0 element of the pattern, it is assumed
to be a standard character, as produced by ctags(1) output; basic regular expressions
only accept '*' as a standard character as the first element of the expression).
Yay.

+ make the version string in the program a real string, so it can be found using strings(1)

+ add an agcre_rev_regexec(3) function, which searches the text in an efficient, reverse
manner, a la strrchr(3) or memrchr(3) fashion.

+ add agcre_regnsub(3) and agcre_regasub(3) functions

+ bump the shared lib version to 1.0

+ cut version 20211001

(agc)

2021-10-04 21:02:40 UTC MAIN commitmail json YAML

2021-10-04 20:48:06 UTC MAIN commitmail json YAML