Commit Graph

276534 Commits

Author SHA1 Message Date
simonb a7fbf566cf Get rid of needless __predict_true() and move a comment slightly. 2020-05-01 07:27:51 +00:00
maxv 37beba86ee Explicitly align to 8 bytes, found by kUBSan.
Reported-by: syzbot+f1e1561ed739db869d44@syzkaller.appspotmail.com
2020-05-01 07:03:02 +00:00
isaki e1f09352b2 Fix two tests.
- kqueue_mode_{RDONLY,RDWR}_READ: Fix expected value.
  This is rest of rev1.9.
- AUDIO_SETINFO_params_simul: Fix condition.
  This happens on full-duplex, not bi-directional.
These affect only standalone test, not atf.
2020-05-01 05:45:57 +00:00
msaitoh d9bd40cefd - Add AMD INVLPGB/TLBSYNC hypervisor enable in VMCB and TLBSYNC intercept bit.
- Modify comment.
2020-05-01 04:07:24 +00:00
tsutsui 23536c517e Move HP332 to "Supported hardware" list, as reported by Chris Hanson. 2020-05-01 03:02:28 +00:00
thorpej 6809e70297 Oops, accidentally #if 0'd some tests, probably while debugging
something else.  Correct this silly mistake.
2020-05-01 01:44:30 +00:00
riastradh d4d6cae1b0 Zero rndsource before using it.
XXX pullup
2020-05-01 01:34:57 +00:00
riastradh a2d38a07b7 Fix sense of conditional in previous.
I must have tested (cold ? (void *)1 : curlwp) but then decided,
after testing, to replace cold by !curcpu_available() -- thinking
that would be a safe change to make, except I forgot to either write
the ! or change the sense of the conditional.  OOPS.
2020-05-01 01:31:17 +00:00
bouyer 3d54ce5e59 Change module path to xen-* only for XENPV 2020-04-30 22:09:32 +00:00
bouyer 80f1967e4a Don't #include xen/intrdefs.h is !XEN.
Should fix third-party module builds (e.g. virtualbox)
2020-04-30 22:05:17 +00:00
skrll 319010a3ca Trailing whitespace 2020-04-30 20:54:27 +00:00
skrll cc41fc5aac G/C __HAVE_AST_PERPROC 2020-04-30 20:48:10 +00:00
riastradh af16796218 Mark rnd_sources_locked __diagused -- only for KASSERTs. 2020-04-30 20:06:40 +00:00
riastradh 2d9621f866 curlwp may not be available early enough for kern_entropy.c.
Fortunately, we're just using it to print helpful diagnostic messages
in kasserts here, so while we're still cold just use (void *)1 for
now until someone figures out how to make curlwp available earlier on
x86.

(All of the curcpu_available() business is a provisional crock here
and it would be better to get rid of it.)
2020-04-30 19:34:37 +00:00
nia 63629d9f87 Make kern.arandom truncate the output instead of failing with ETOOBIG
when the requested data exceeds 256 bytes in size. The actual size of
the returned data is output to oldlenp.

This matches FreeBSD's behaviour and seems to be more in line with
what software in the wild expects.

"sounds reasonble" - Riastradh
2020-04-30 17:36:06 +00:00
maxv 1d76a251d8 The labels are already global, drop unused. 2020-04-30 17:21:12 +00:00
maxv 00ae02df33 Switch to templates. 2020-04-30 17:17:33 +00:00
riastradh f36f13f01d Missed a spot! (Part II(b) of no percpu_foreach under spin lock.) 2020-04-30 17:16:00 +00:00
maxv ab10f5d552 If we were processing a software int/excp, and got a VMEXIT in the middle,
we must also reflect the instruction length, otherwise the next VMENTER
fails and Qemu shuts the guest down.
2020-04-30 16:56:23 +00:00
maxv 435736c62e When the identification fails, print the reason. 2020-04-30 16:50:17 +00:00
riastradh 708a423c14 Lock the rndsource list without E->lock for ioctls too.
Use the same mechanism as entropy_request, with a little more
diagnostic information in case anything goes wrong.  No need for
LIST_FOREACH_SAFE; elements cannot be deleted while the list is
locked.

This is part II of avoiding percpu_foreach with spin lock held.
2020-04-30 16:50:00 +00:00
riastradh 3d3181686d Avoid calling entropy_pending() with E->lock held.
This is part I of avoiding percpu_foreach with spin lock held.
2020-04-30 16:43:12 +00:00
martin a0926c8673 futexput: cast the mask to u_long (as the op already is) 2020-04-30 15:12:25 +00:00
joerg 43aaaac2bf GNU as on ARM silently accepts @progbits, but interpretes it as comment
internally. LLVM bails out on the other hand. So conditionally this
properly.
2020-04-30 14:32:05 +00:00
jakllsch d1817154ad msk(4): actually moderate interrupts from the Yukon 2 Status BMU
Previously the interrupt moderation enable register was being programmed
with sk(4)-style enable bits, none of which matched the significant
interrupt sources of the Yukon 2 we enable.
2020-04-30 14:04:54 +00:00
jdolecek 5b27ba3b79 add sc_capenable member, forgot to commit 2020-04-30 13:59:50 +00:00
jakllsch 9727748e87 msk(4): during attach print intrstr only once 2020-04-30 13:51:43 +00:00
rin 40fc0808c4 Hack "gcc-4.5 arm without -fno-tree-vrp generate broken code" was removed in
src/lib/libc/softfloat/Makefile.inc rev 1.21:

http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/softfloat/Makefile.inc#rev1.21

Now, all tests mentioned in the entry are passed for softfloat arm.
2020-04-30 12:44:41 +00:00
christos 58acbfa340 Simplify, little KNF 2020-04-30 12:40:11 +00:00
rin 482ad8d16d lmcconfig(8) was removed. 2020-04-30 12:35:01 +00:00
christos 8e08aa4add Simplify, errors to stderr. 2020-04-30 12:32:26 +00:00
rin 013fdb9ec3 Add missing dates and revisions. 2020-04-30 12:32:16 +00:00
thorpej 53a266e304 Decode futex op codes. 2020-04-30 12:17:01 +00:00
sevan 62aa287db5 It was aboard the Space Shuttle Atlantis using a Macintosh Portable.
https://support.apple.com/kb/TA30635
2020-04-30 12:13:39 +00:00
jdolecek c04e20a8d7 add support for scatter-gather when accepting packets on frontend Tx path
(frontend -> backend)

don't enable ETHERCAP_JUMBO_MTU nor feature-sg yet, need to implement
support also for the frontend Rx side
2020-04-30 11:23:44 +00:00
jdolecek 11a8c42123 NETTXF_csum_blank and NETTXF_data_validated should be set only for first
fragment of the packet
2020-04-30 11:19:39 +00:00
ryo 1da5a7c800 Add a test for sigaltstack(2) and SA_ONSTACK 2020-04-30 11:03:29 +00:00
nia 951b888a45 Fix the detection of KERN_ARND by OpenSSL.
Firstly, include the correct headers. Then, make sure that requests
never exceed 256 bytes.

Disable a hack for old FreeBSD versions, just in case it actually gets
used.

This should mean that OpenSSL doesn't ever fall back to reading from
/dev/urandom.

XXX pullup, XXX upstream.
2020-04-30 10:59:02 +00:00
christos 7fa5b1d2e9 remove debugging stuff accidentally committed. 2020-04-30 10:55:32 +00:00
jdolecek f91b80053d for bridge(4), report the common enabled capabilities of the members
via SIOCGIFCAP for visibility
2020-04-30 10:04:54 +00:00
mrg 0a33e04ee4 include sys/lwp.h and fix the build. 2020-04-30 07:07:22 +00:00
skrll 710f5bb78b Convert pmap_check_alias into a function that resolves any aliases issues
to deal with the locking around entering a mapping of the same page with
and alias issue in the same pmap (pmap lock already held in pmap_enter)

This has the added benefit of only flushing the troublesome mappings.

The locking could be simplified further here and an PV list iterator
function with callback is probably useful.
2020-04-30 06:16:47 +00:00
riastradh ea26d8a710 Missed a spot -- need <sys/atomic.h> to use atomic_*. 2020-04-30 04:26:29 +00:00
thorpej 1a07681a27 - In uvm_voaddr_acquire(), take an extra hold on the anon lock obj.
- In uvm_voaddr_release(), if the anon ref count drops to 0, call
  uvm_anfree() rather than uvm_anon_release().  Unconditionally drop
  the anon lock, and release the extra hold on the anon lock obj.

Fixes a panic that occurs if the backing store for a futex backed by
an anon memory location is unmapped while a thread is waiting in the
futex.

Add a test case that reproduced the panic to verify that it's fixed.
2020-04-30 04:18:07 +00:00
riastradh 3974c5cb9f Accept both byte orders for random seed in the kernel.
The file format was defined with a machine-dependent 32-bit integer
field (the estimated number of bits of entropy in the process that
generated it).  Fortunately we have a checksum to verify the order.

This way you can use `rndctl -S' on a little-endian machine to
generate a seed when installing NetBSD on a big-endian machine, and
the kernel will accept it on boot.
2020-04-30 03:42:23 +00:00
riastradh 2cca25b1b6 Make WM_NRXDESC unsigned. 2020-04-30 03:42:10 +00:00
riastradh 8063a7f0e7 Revert "- rnd_add_*() call must be serialized. Unserialized accesses broke the"
It is no longer necessary to serialize calls to rnd_add_data, so we
can use the same rndsource for every queue.

This also reverts some unrelated changes that were mixed in:

1. WM_NRXDESC was made unsigned
2. The specific samples were changed.

(1) will be redone in a separate commit.  (2) was buggy (wrote `='
where `|=' was meant) and is not needed; it's fine to do rnd_add_data
in a thread or softint too, not just in a hard interrupt handler.
2020-04-30 03:41:31 +00:00
riastradh f580bd2e6e No need for a lock around rnd_add_data any more. 2020-04-30 03:41:20 +00:00
riastradh 4df5e81c43 rnd_attach_source calls the callback itself now.
No need for every driver to explicitly call it to prime the pool.

Eliminate now-unused <sys/rndpool.h>.
2020-04-30 03:40:52 +00:00
riastradh 6bf9fb1500 Omit needless #include <sys/rnd.h>. 2020-04-30 03:30:10 +00:00