Commit Graph

276678 Commits

Author SHA1 Message Date
hannken a1b51d3577 Add operation fstrans_held(struct mount *), true if the current thread
holds a fstrans lock.

Ride 9.99.61
2020-05-13 09:21:30 +00:00
bouyer feb45d8f30 xen: enable MULTIPROCESSOR for Xen dom0 2020-05-13 08:43:28 +00:00
bouyer 1e73aef6a5 MULTIPROCESSOR for dom0 should be safe now. Enable it. 2020-05-13 08:42:01 +00:00
ryo eeb5bd9a17 fix evbarm64 build release with LLVM 2020-05-13 06:09:25 +00:00
ryo 202c072361 - move aarch64 addressspace macros from pmap.h to cpufunc.h
- rename ptr_strip_pac() to aarch64_strip_pac()
2020-05-13 06:08:51 +00:00
chs cc0d11d270 fix the handling in putpage of the page containing EOF. 2020-05-13 05:52:54 +00:00
chs 9c0ce03a86 for "mach cpuinfo", print ci_biglock_count too. 2020-05-13 05:37:16 +00:00
ad fdbd18cb16 NetBSD 9.99.61 - vfa_cache interface changed 2020-05-12 23:18:52 +00:00
ad a8497e6541 Regen. 2020-05-12 23:18:03 +00:00
ad d6844897f1 cache_enter_id(): give it a boolean parameter to indicate whether the cached
identity is valid.
2020-05-12 23:17:41 +00:00
ad cd30436c69 PR kern/55251 (use of ZFS may trigger kernel memory corruption (KASAN error))
Previous wasn't quite right.  Redo it differently - disable preemption
earlier instead.
2020-05-12 21:56:17 +00:00
ad 58cf4a477e PR kern/55251: use of ZFS may trigger kernel memory corruption
mutex_vector_enter(): reload mtx_owner with preemption disabled before
calling mutex_oncpu(), otherwise lwp_dtor() can intervene.
2020-05-12 21:24:29 +00:00
riastradh a3f52b6ec2 Don't invoke callbacks of rndsources with collection disabled. 2020-05-12 20:50:17 +00:00
martin 98c332e311 PR 55202: disable swapping if we started it due to low ram 2020-05-12 17:26:43 +00:00
martin 0466f2885f Ooops, backout previous - twice the entropy saving is not needed.
Instead slightly improve the (slightly) hidden other code that already
did it.
2020-05-12 17:04:00 +00:00
martin a55d2d6bdf At the end of a new installation save entropy. 2020-05-12 16:18:04 +00:00
christos cb15ac971c - in script mode always output errors to stderr prefixed by the program name.
- in command mode always output errors to stdout not prefixed " " "
- perror(3) -> warn(3)
2020-05-12 16:17:58 +00:00
christos b11fb1d040 Keep track of the filename to print in error messages.
Change quoting of error string from [] to `'.
2020-05-12 14:29:06 +00:00
simonb be35586421 Oceton RNG/RNM driver modernisation to fit new entropy world order by
riastradh@, with some tweaks to get working in RNG mode.

XXX TODO: work out how to get raw entropy mode working.
2020-05-12 14:04:50 +00:00
kamil ba111eb8df Remove mentions of CLONE_PID and CLONE_STOPPED
CLONE_PID was removed in Linux 2.5.15 and recycled for
CLONE_PIDFD since Linux 5.2.

CLONE_STOPPED was removed in Linux 2.6.38 and recycled
for CLONE_NEWCGROUP since Linux 4.6.
2020-05-12 11:39:08 +00:00
kamil 0e491f3f32 Remove the stub support of CLONE_PID in clone(2)
CLONE_PID causes the child clonee to share the same process id as cloner.

It was implemented for debugging purposes in the Linux kernel 2.0,
restricted to root only in 2.3.21 and removed from Linux 2.5.16.

The CLONE_PID bit was recycled for CLONE_PIDFD in Linux 5.2.
2020-05-12 11:21:09 +00:00
simonb ec1a4f3758 If bus_space_map fails, just don't attach the driver instead of panicing.
Check RNG built in self test, don't attach if that fails too.
2020-05-12 10:37:10 +00:00
leot 467c5d63f6 Remove a reference to /etc/netstart
It was removed in rc.d era and no longer honored (except by newbtconf(8)).

Noticed by Ottavio Caruso on #netbsd@Freenode, thanks!
2020-05-12 10:20:16 +00:00
simonb 48e87d3c8f Add a few more bits.
XXX convert to __BITS.
2020-05-12 10:12:08 +00:00
jdolecek f906864e2f need to take IFNET_LOCK() around if_stop (on suspend) and if_init (on resume)
calls, those need to read and/or manipulate if_flags and hence need
the lock for IFEF_MPSAFE drivers; the drivers can't do IFNET_LOCK() themselves,
because the ioctl path call these hooks with the lock held

fixes KASSERT() in xennet(4) while investigating PR port-xen/55207
2020-05-12 10:02:56 +00:00
jdolecek d2a162b1b4 move xen_intr_disestablish() call in xbd_xenbus_suspend() so it's executed
without holding the xbd mutex, to avoid LOCKDEBUG assertion on suspend

while here only disestablish the intr if it was established

part of PR port-xen/55207
2020-05-12 09:54:02 +00:00
simonb da20e95aa9 Whitespace alignment nits. 2020-05-12 09:48:44 +00:00
msaitoh 42f8c9cecf Don't use TSC freq value from CPUID if calibration works.
- When it's the first call of cpu_get_tsc_freq() the HPET is not initialized,
   so try to use CPUID to get TSC freq.
 - If it's the 2nd call, don't use CPUID. Instead, print the difference
   between the calibrated value and CPUID's value if the verbose mode is set.
2020-05-12 06:32:05 +00:00
martin 46db4168b5 Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.
2020-05-12 06:23:07 +00:00
jakllsch dc4978d3b1 msk(4): ack Status BMU IRQ only if we're (apparently) caught up with it
Possibility for acking an unprocessed Status BMU IRQ still exists, and
remains handled by the watchdog.  Nevertheless this should reduce the
likelyhood that path is taken.
2020-05-11 23:47:45 +00:00
yhardy dd377fc593 Fix the build for MKCOMPAT=no.
The t_user_ldt test needs the i386 compat library which is only built
when MKCOMPAT=yes.
2020-05-11 21:51:25 +00:00
riastradh 00d0504163 Remove cprng initialization order hack.
cprng_init now runs early enough that the hack should no longer be
needed to address PR port-arm32/55252.
2020-05-11 21:40:12 +00:00
riastradh 64f67209e8 Move cprng_init before configure.
This makes it available to device drivers, e.g. to generate MAC
addresses at random, without initialization order hacks.

Requires a minor initialization hack for cpu_name(primary cpu) early
on, since that doesn't get set until mi_cpu_attach which may not run
until the middle of configure.  But this hack is less bad than other
initialization order hacks.
2020-05-11 21:38:54 +00:00
riastradh 1f0e72f10b Teach percpu to run constructors on CPU attach.
This should make percpu work reliably for things like cprng_strong
much earlier -- not just after all CPUs have been detected.  This is
also necessary (though not on its own sufficient) for CPU hotplug.
2020-05-11 21:37:31 +00:00
kamil 907d0e8035 Fix potential race in ptrace(2) clone(2) tests
Instead of comparing old and new signal mask, just after the cloning
operation, check whether the expected signal is still masked and in
another test whether it is still ignored.

Catch up after t_ptrace_fork_wait.h r. 1.2.
2020-05-11 21:18:11 +00:00
kamil 9400a778fb Fix race in fork_singalmasked
ELF RTLD after rtld.c r. 1.204 introduced locking that wraps the fork
syscall. This locking changes signal mask of the calling process during
the forking process.

Instead of comparing old and new signal mask, just after the forking
operation, check whether the expected signal is still masked and in
another test whether it is still ignored.
2020-05-11 20:58:48 +00:00
alnsn a38f79e2a6 KAUTH_MACHDEP_SVS_DISABLE is deprecated.
sysctl machdep.svs.enabled can't be changed anymore
at runtime because it's now a boot option.
2020-05-11 19:36:39 +00:00
jakllsch 1c2feb10e5 msk(4): simplify interrupt return value creation
This also corrects a problem where we would not claim we handled an
interrupt that was ours.
2020-05-11 19:17:46 +00:00
jakllsch cc6f91ed12 msk(4): moderate no interrupts globally
The global interrupt moderator on mskc(4) is mostly redundant with the Status Unit's tx and rx interrupt coalescing for our purpouses

Revisits interrupt moderation change in 1.108.
2020-05-11 18:49:04 +00:00
kamil 24a7c76830 Reject setting unaligned Program Counter
Patch taken from OpenBSD.

Tested in qemu.

Fixes PR port-sparc/54734 by Andreas Gustafsson
2020-05-11 18:38:26 +00:00
jdc 86998ea365 Add "wb at ebus" and sdmmc, ld for the SD card reader on SPARCle. 2020-05-11 18:29:59 +00:00
martin d567815e89 When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.
2020-05-11 17:40:50 +00:00
riastradh 72f0af4b2a Work around early calls to cprng_strong.
The bottleneck here is getting percpu_create to work early enough.
We should really fix that, but for now, this workaround will serve.

Should fix PR port-arm32/55252.
2020-05-11 17:27:48 +00:00
jdc 4592cdd1eb Add an ebus frontend for the Winbond W83l518D SD card reader as found on
Tadpole SPARCLE latops.
2020-05-11 15:56:15 +00:00
martin a3e2f2a69a Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.
2020-05-11 15:27:41 +00:00
joerg 866ac96542 Fix GCC flags for Spectre mitigation to really only apply to GCC. 2020-05-11 15:15:15 +00:00
jdc 93f83d92b2 Make the driver endian-independent.
Add a quirk so that the bus front end can specify 1-bit only mode.
Remove unused isa includes.
Change the error returned for unsupported opcodes to ENOTSUP, so that
we can pass this back to sdmmc_mem, where it's handled since r1.72 of
  src/sys/dev/sdmmc/sdmmc_mem.c
2020-05-11 14:55:20 +00:00
kre 872f7801f3 Do as the manual says, and use _PATH_DEFPATH if PATH is not present in
the environment rather than simply turning into posix_spawn() in that case.

Also, we cannot use strtok() to parse PATH, the semantics don't fit the API.
Borrow the guts of execvp for the PATH search.

We still simply check for a file with 'x' permission, and assume that one
will do, whatever it is, which isn't really correct, but ...
2020-05-11 14:54:34 +00:00
riastradh 8e46dd336e Add support for the ARMv8.5-RNG CPU random number generator.
We use the RNDRRS system register.  I made the following two
wild-arse guesses about the architecture of real implementations,
which might not exist yet:

1. There's only one physical source per CPU package, so not worth
   attaching one per core.

2. Like other CPU RNGs -- RDSEED, VIA C3 -- this probably gives about
   half a bit of entropy per bit of data (although perhaps we should
   say zero and revisit this once it arrives on real silicon).

Tested in qemu as well as I can, using `-cpu max' (which doesn't get
to userland for unrelated reasons).

This uses the numeric notation `mrs %0, s3_3_c2_c4_1' for the rndrrs
system register instead of the more legible `mrs %0, rndrrs' as
suggested in the ARMv8.5 ARM.  Why?

- clang doesn't like `mrs %0, rndrrs' for reasons unclear to me.

- gas only likes it with `.arch armv8.5-a+rng', but there's no clear
  way to keep that scoped; the `.set push/pop' stack that would be an
  obvious choice for this works only on mips.

- gcc supports __attribute__((target("arch=..."))) on functions, but
  the version we use doesn't yet know about armv8.5-a+rng.

Later on, we should replace this by a target attribute and the more
obvious `mrs %0, rndrrs' notation.

ok nick
2020-05-11 14:44:16 +00:00
pgoyette df773a4b86 Fix typo 2020-05-11 12:42:58 +00:00