Commit Graph

294311 Commits

Author SHA1 Message Date
kre 772973c9a5 When we initialize libedit (editline) always call ourselves "sh" no
matter what $0 is (or is not) set to.   This means that editrc(5)
lines that start "sh:" are used (in addition to those with no prefix,
which will usually be most of them), regardless of the name or manner in
which we were invoked.

OK christos@
2022-01-31 18:15:45 +00:00
ryo aa60659cfa Extend the time to wait for the thread to quit.
It seems that alarm(1) is not enough time for the thread to actually exit after quittingtime = 1.
It randomly failed with "Test program received signal 14" on a slow environment.
2022-01-31 17:23:37 +00:00
kre 05e80ac3ee Add some comments explaining accesses to the environment via
getenv()/setenv()/unsetenv() which manipulate the envornoment
the shell was passed at entry.

These are a little odd in sh as that environment is copied into
the shell's internal variable data struct at shell startup, and
normally never accessed after that - in builtin commands (test.
printf, ...) getenv() is #defined to become an internal sh lookup
function instead, so even those never use the startup environment).

NFCI
2022-01-31 16:54:28 +00:00
christos ea988183cf PR/56622: Walter Lozano: Improve readline compatibility by adding
rl_readline_state support.
2022-01-31 14:44:49 +00:00
msaitoh 19dabbe68b Decode SCSI programming interface. Whitespace fix. 2022-01-31 10:14:55 +00:00
msaitoh d0b6db0c66 Add three new extended capabilities:
- Physical Layer 32.0 GT/s
  - Alternate Protocol
  - System Firmware Intermediary
2022-01-31 10:11:33 +00:00
ryo 7527171b33 add support Hardware updates to Access flag and Dirty state (FEAT_HAFDBS)
- The DBM bit of the PTE is now used to determine if it is writable, and
  the AF bit is treated entirely as a reference bit. A valid PTE is always
  treated as readable. There can be no valid PTE that is not readable.
- LX_BLKPAG_OS_{READ,WRITE} are used only for debugging purposes,
  and has been superseded by LX_BLKPAG_AF and LX_BLKPAG_DBM.
- Improve comment

The need for reference/modify emulation has been eliminated,
and access/permission faults have been reduced, however,
there has been little change in overall performance.
2022-01-31 09:16:09 +00:00
ryo a4facd3bc2 Skip unnecessary PTE operations and TLB invalidation. 2022-01-31 08:43:05 +00:00
msaitoh 6c5aebe108 Fix procfs_machdep.c rev. 1.143. Print CPUID 0x00000007:1 %eax correctly. 2022-01-31 06:54:50 +00:00
christos 4793086b69 Add some more debugging to collect information about the sequence of events. 2022-01-30 19:49:30 +00:00
christos 4d912a20e8 Bump the number of "workers" to 2 which effectively bumps the number of
contexts to 8. We seem to need 5 contexts so that should stop the error
checking to hp_retire() from triggering.
2022-01-30 19:47:04 +00:00
christos 2c17dc5941 a bit less verbose 2022-01-30 18:54:52 +00:00
christos 03fbb540b5 Make the GNode lineno unsigned to fix lint warning in var.c calling
PrintLocation()
2022-01-30 13:21:08 +00:00
christos 4232aba464 Avoid retiring a thread with a xtid >= isc__hp_max_threads and crashing.
XXX: need to fix the real bug, but this will do for now.
2022-01-30 13:11:46 +00:00
martin fade124bc6 Do not defer wedge deletions when we have nothing mounted.
Define and use a constant for maximum disk name length.
2022-01-30 11:58:29 +00:00
riastradh 66170f1a41 usbnet: Defer hardware multicast filter updates to USB task.
Breaks deadlock:

- usbnet_detach holds usbnet lock, awaits kpause in ure_reset
- callout holds softclock `lock' (sequential softints, blocks kpause
  wakeup), awaits softnet_lock in tcp_timer_keep, frag6_fasttimo, &c.
- soclose holds softnet_lock, awaits usbnet lock in SIOCDELMULTI

This change breaks the deadlock by not passing the SIOCADDMULTI or
SIOCDELMULTI ioctl synchronously to the driver, which typically takes
the usbnet lock.

With this change, the ethernet layer still maintains the list of
multicast addresses synchronously, but we defer the driver logic that
updates the hardware multicast filter to an asynchronous USB task
without softnet_lock held.

This doesn't cause exactly the same ioctl to be sent to the driver --
usbnet just sends SIOCDELMULTI with an all-zero struct ifreq, and
might drop some ioctls if issued in quick succession.  This is OK
because none of the drivers actually distinguish between SIOCADDMULTI
and SIOCDELMULTI, or examine the argument; the drivers just commit
whatever multicast addresses are listed in the ethercom.

Other than the different ioctl submitted, there is no change to the
ABI or locking scheme of usbnet, so this is safe to pull up to
netbsd-9.  This means we unfortunately can't guarantee that if a
process issues SIOCADDMULTI and then sendto, the multicast filter
update will be done by the time of the sendto -- and, more
importantly, the packets received in reply to it.  But failing to
guarantee that is better than deadlocking!  Later changes on HEAD
will restore the synchronous multicast filter updates with much more
extensive ABI changes and API simplifications in usbnet(9).

Proposed on tech-net:
https://mail-index.netbsd.org/tech-net/2021/12/30/msg008164.html

XXX pullup-9
2022-01-29 21:37:07 +00:00
riastradh 6e5399e670 xhci(4): Fix handling of endpoint reset/stop.
Use the same asynchronous task resetting a stalled/halted endpoint
and stopping a running endpoint -- either way we need to put the
endpoint back into a known state and, if there are transfers waiting
to run, start them up again.

- xhci_abortx must not drop the pipe (bus) lock -- usbdi(9) requires
  this.  So arrange to stop the endpoint and empty the queue
  asynchronously.

- If the xhci softint claims an xfer for completion with
  usbd_xfer_trycomplete, it must call usb_transfer_complete without
  ever releasing the pipe (bus) lock -- it can't claim the xfer and
  then defer the usb_transfer_complete to a task.  So arrange to
  reset the endpoint asynchronously, hold up new transfers until the
  endpoint has been reset, and then do usb_transfer_complete
  immediately.
2022-01-29 21:36:12 +00:00
sjg c6b66c0365 Tweak description of local variable assignments 2022-01-29 20:54:58 +00:00
christos af918e051e Add more refreshes from Walter Lozano. The readline example in
http://www.mcld.co.uk/blog/2009/simple-gnu-readline-callback-style-example.html
still does not work, but it is better.
2022-01-29 20:52:45 +00:00
riastradh 9f9c430042 pmf(9): Conditionalize pmflock_debug output on PMFLOCK_DEBUG.
This is really only helpful for debugging the software logic to
handle the trees of devices for suspend/resume, not for debugging the
drivers, which is most of what we need to do.  If anyone still finds
this useful they can make a sysctl knob for it or something, but for
now this substantially reduces the amount of debug output that's
getting in my way.
2022-01-29 20:35:11 +00:00
martin 4204f81037 When upgrading, update the boot code post extraction from
the updated target file system.
2022-01-29 16:01:16 +00:00
martin 8bb96d39e3 Try to get rid of all wedges we created (after unmounting). 2022-01-29 15:32:49 +00:00
riastradh 2c163b14db tpm(4): Nix TPM_BE16/TPM_BE32. Just use sys/endian.h. 2022-01-29 12:27:30 +00:00
martin 3c0daa59b0 In some cases the gcc optimizer is not smart enough to figure out why
the luns and nluns variables are never actually used when they are not
initialized - so initialize them always.
2022-01-29 11:20:30 +00:00
rillig 2d30eb833a tests/make: clean up variants that are tested
Since main.c 1.373 from 2020-10-18, make does not use iovec anymore, so
remove that test variant.

Document the details of why generating the test coverage took so long on
NetBSD < 10.

Add another test variant with optimization for binary size (-Os), since
with that option, GCC 10 does not perform the same data flow analysis as
with -O2, in particular it gets confused about whether local variables
are correctly initialized across function calls.
2022-01-29 10:44:40 +00:00
rillig e55e22919c tests/make: sync comment in test for recursive variable 2022-01-29 10:21:26 +00:00
rillig a5fc9d51a1 make: for recursive variables in commands, print location
Print the approximate location based on the last command that has been
defined for the target.  It would be possible to get more detailed
location information by counting the number of commands of the target,
but that would get messy due to .USEBEFORE, .USE and .DEFAULT, and
still, this is an edge case, so don't waste too much code for it now.
Having this hint about the location is more helpful than just a plain
"Variable X is recursive" without any further details.
2022-01-29 10:19:49 +00:00
rillig 2856bc0c6e tests/make: demonstrate recursive variable in target 2022-01-29 10:09:37 +00:00
rillig a270f08cb3 make: print stack trace on fatal errors
The only fatal error that occurs while the makefiles are read in is the
one about recursive variables, which didn't give any hint about the
location before.

If a recursive variable is detected while evaluating the commands of a
target to be made, there is no location information, as before.
2022-01-29 09:38:26 +00:00
msaitoh 6f3942e76a Decode Intel Hybrid Information Enumeration (CPUID Fn0000_001a). 2022-01-29 08:20:45 +00:00
msaitoh 535da4c1d6 Add Intel Hybrid Information Enumeration (CPUID Fn0000_001a). 2022-01-29 08:18:22 +00:00
msaitoh 237bd9a9d3 Add code for DDR5 a little. I have no datasheet. 2022-01-29 08:17:03 +00:00
msaitoh e472ee7af0 Add LPDDR4X and DDR5. Not decoded yet. 2022-01-29 08:14:24 +00:00
sjg 33d445c441 Document quirks of target local variable assignments 2022-01-29 07:42:10 +00:00
uwe adad4427e8 Default WSDISPLAY_BORDER_COLOR to WS_DEFAULT_BG.
Avoids black overscan area when WS_DEFAULT_BG is set.
2022-01-29 01:19:30 +00:00
rillig 376b091f41 make: rename labels in CondParser_Leaf
No binary change.
2022-01-29 01:12:36 +00:00
rillig 5643b394fa make: inline functions that have a single call site
No functional change.
2022-01-29 01:07:31 +00:00
rillig 33b1fb5e4c tests/make: extend and isolate tests for target-local variables
Reusing the target var-scope-local.o for several tests made the test
more difficult to understand than necessary.  The test names '2' and '3'
didn't convey any meaning.

Instead, add more test targets that are named after what they test.  Add
tests for each of the 5 variable assignment operators, to demonstrate an
inconsistency between '+=' and '?='.

Add tests for the built-in target-local variables as well and explain
the general concepts, in particular the exact point where target-local
expressions are expanded.

The lines in the expected output file are not generated in the same
order as they appear in the makefile, so allow the 'expect' lines in
non-linear order, in check-expect.lua.
2022-01-29 00:52:53 +00:00
tnn 64af69d8bc librefuse: default_log_func is __printflike 2022-01-29 00:03:41 +00:00
reinoud a23f7dc35e On freeing a virtual address in the VAT, use the correct value; this might
confuse other implementations who can reject the VAT on this.
2022-01-28 20:00:52 +00:00
wiz 58fed2b507 sysinst: sync usage with man page 2022-01-28 19:38:51 +00:00
wiz d72710ea39 Sort options and their descriptions. 2022-01-28 19:36:00 +00:00
martin cfebcbba29 Document the missing command line options. 2022-01-28 19:28:08 +00:00
martin 3b7d675b40 Add an option to set the directory where we look for message catalogs. 2022-01-28 19:27:43 +00:00
christos 501a9727b6 Factor out the lun detection code to simplify control flow. 2022-01-28 18:23:28 +00:00
jakllsch da6c99a69e drop WSDISPLAY_CUSTOM_BORDER, it's currently only used by vga(4) which isn't used on evbarm 2022-01-28 16:38:56 +00:00
jakllsch 6fc380f232 shut up GCC about possibly-uninit; some KNF 2022-01-28 14:02:45 +00:00
sjg 4a311e4fd9 numEntries can vary 2022-01-27 21:50:50 +00:00
rillig fc7f141b6a tests/make: add more edge cases for expansion of .for loop body 2022-01-27 20:15:14 +00:00
jakllsch 7e64fd0859 use powerof2() in sd_validate_blksize() 2022-01-27 18:44:49 +00:00