Commit Graph

258912 Commits

Author SHA1 Message Date
maxv
0ef961c700 Mmh, don't compile spectre.c on Xen. 2018-05-22 11:09:57 +00:00
kamil
7cc9be7372 Add new ATF ptrace(2) tests: traceme_sendsignal_{masked,ignored}[1-3]
These tests emit signal from a tracer/parent to the child and verify the
behavior in the case of SIG_BLOCK (masked) and SIG_IGN (ignored).

The signal is not reported by the child process.

These tests pass.

While there, rename for consistency with other tests:
 - traceme_sighandler_catch[1-3] -> traceme_sendsignal_handle[1-3]
 - traceme_signal_nohandler[1-5] -> traceme_sendsignal_simple[1-5]

Sponsored by <The NetBSD Foundation>
2018-05-22 10:48:06 +00:00
maxv
81bbfb9674 Implement a mitigation for SpectreV4 on AMD families 15h and 16h. We use
a non-architectural MSR. This MSR is also available on 17h, but there SMT
is involved, and it needs more investigation.

Not tested (I have only 10h).
2018-05-22 10:20:04 +00:00
maxv
6d31866e70 Several changes:
- Move the sysctl initialization code into spectre.c. This way each
   variable is local. Rename the variables, use shorter names.

 - Use mitigation methods for SpectreV4, like SpectreV2. There are
   several available on AMD (that we don't support yet). Add a "method"
   leaf.

 - Make SSB_NO a mitigation method by itself. This way we report as
   "mitigated" a CPU that is not affected by SpectreV4. In this case,
   of course, the user can't enable/disable the mitigation. Drop the
   "affected" sysctl leaf.
2018-05-22 09:25:58 +00:00
maxv
1fd52b99f4 Clarify the parameters for the SpectreV2 mitigation.
Add:
	machdep.spectre_v2.swmitigated
Rename:
	machdep.spectre_v2.mitigated -> machdep.spectre_v2.hwmitigated

Change the method string, to combine both the hardware and software
mitigations. swmitigated is set at compile time, hwmitigated can be
set by the user.

Examples:

	spectre_v2.swmitigated = 1
	spectre_v2.hwmitigated = 0
	spectre_v2.method = [GCC retpoline]

	spectre_v2.swmitigated = 0
	spectre_v2.hwmitigated = 0
	spectre_v2.method = (none)

	spectre_v2.swmitigated = 1
	spectre_v2.hwmitigated = 1
	spectre_v2.method = [GCC retpoline] + [Intel IBRS]
2018-05-22 08:15:26 +00:00
maxv
3bf037e0d1 Add RSBA. When set, it indicates that the CPU is vulnerable to SpectreV2
via the RSB.
2018-05-22 07:24:08 +00:00
maxv
058ce8c21c Mitigation for SpectreV4, based on SSBD. The following sysctl branches
are added:

	machdep.spectre_v4.mitigated = {0/1} user-settable
	machdep.spectre_v4.affected = {0/1} set by the kernel

The mitigation is not enabled by default yet. It is not tested either,
because no microcode update has been published yet.

On current CPUs a microcode/bios update must be applied for SSBD to be
available. The user can then set mitigated=1. Even with an update applied
the kernel will set affected=1.

On future CPUs, where the problem will presumably be fixed by default,
the CPU will report SSB_NO, and the kernel will set affected=0. In this
case we also have mitigated=0, but the mitigation is not needed.

For now the feature is system-wide. Perhaps we will want a more
fine-grained, per-process approach in the future.
2018-05-22 07:11:53 +00:00
maxv
af4f39409e Reorder and rename, to make the code less SpectreV2-specific. 2018-05-22 06:31:05 +00:00
wiz
69f43e6644 Remove reference to itself. 2018-05-22 05:39:44 +00:00
kamil
aaef92583a Extend ATF tests in t_trapsignal.sh to verify software breakpoint traps
There are at least four types of SIGTRAP events:
 - software/hardware single step (trace trap)
 - software breakpoint
 - hardware breakpoint/watchpoint
 - kernel event (exec, fork, vfork, vfork-done, lwp-create, lwp-exit)

A program can execute software breakpoint without the context of being
traced and this is a regular crash signal emitting SIGTRAP (TRAP_BRKPT).

Rename original trap_* tests (trap_simple, trap_handle, trap_mask,
trap_handle_recurse and trap_ignore) to segv_* tests and restrict them for
SIGSEGV.

Add new tests: trap_* testing the same scenarios as segv_ ones, however
verifying the software breakpoint trap (SIGTRAP).

Keep the original name of h_segv.c, and extend it for software breakpoint
events.

The purpose of these tests is to verify SIGTRAP kernel paths without the
ptrace(2) context.

All tests pass.

Sponsored by <The NetBSD Foundation>
2018-05-22 04:32:56 +00:00
kamil
33e8159699 Minor improvement in sigaction(2)
Note that SIGCHLD covers process continued event.

Sponsored by <The NetBSD Foundation>
2018-05-22 03:07:50 +00:00
ginsbach
4c45dc6a2c Add M&O, ROM, and SWOT 2018-05-22 02:54:32 +00:00
ginsbach
3d30e61472 Fix spelling 2018-05-22 02:46:19 +00:00
kamil
8ea76f3911 Minor update to signal(7)
Note that SIGCHLD is not just a child exit signal.
Note that SIGIOT is PDP-11 specific signal.

Sponsored by <The NetBSD Foundation>
2018-05-22 02:31:57 +00:00
nat
e01c875899 Using audioctl without the -p switch defaults to the mix ring. This allows
setting the hardware gain etc.

Update the audio spec in audio.7 to reflect these changes.

Addresses PR kern/52781.
2018-05-22 01:35:49 +00:00
jmcneill
6d889ed6ec Workaround bogus GCC warning about an uninitialized variable 2018-05-21 22:04:27 +00:00
taca
306edb803b Postfix 3.1.9/3.2.6/3.3.1 has released. 2018-05-21 14:48:55 +00:00
jmcneill
88d6c0b7fc Replace stable_read/write debug printfs with event counters 2018-05-21 10:28:13 +00:00
mrg
c2cd564784 disable drm2 on modern nouveau cards (Pascal-based).
our older drm doesn't have any support for modern Pascal or
the second version of Maxwell (but not disabled here yet)
but the driver tries to attach on any nvidia gpu.

this should workaround PR#53258, and other issues reported
with modern nvidia chipsets.

XXX: pullup-7, pullup-8.
2018-05-21 08:58:47 +00:00
kamil
5607b39231 Add new ATF test: t_trapsignal:trap_ignore
Test ignored trap with right exit code.

This test passes.

Sponsored by <The NetBSD Foundation>
2018-05-21 08:49:03 +00:00
jnemeth
2e2c5c7329 add Oxford Semiconductor OXPCIe954 PCIe 4-port serial card 2018-05-21 03:56:21 +00:00
jnemeth
9abd5cd2d2 regen 2018-05-21 03:54:06 +00:00
jnemeth
1fb365cf7d add Oxford Semiconductor OXPCIe954 PCIe 4-port serial card 2018-05-21 03:45:50 +00:00
christos
c88c0cb418 add minimal glue to make gdb compile on aarch-64; now configure in gdb/dist
and gmake creates a gdb binary.
2018-05-21 02:10:46 +00:00
kamil
8e107b0ecc Refactor and enable the signal3 ATF ptrace(2) test
Adapt the test to be independent from the software breakpoint trap
behavior, whether the Program Counter is moved or not. Just kill the
process after catching the expected signal, instead of pretending to resume
it.

This test passes.

Sponsored by <The NetBSD Foundation>
2018-05-20 23:47:16 +00:00
wiz
eb22472975 End sentence with a dot. 2018-05-20 15:28:27 +00:00
thorpej
f5a92b7658 Add a 1PPS-over-GPIO driver, originally by Brad Spencer, with changes by
me to adapt to the new GPIO interrupt interface and support a wider variety
of GPIO pin configuations.

PR kern/51676

(Oops, forgot to "cvs add" these items previously.)
2018-05-20 15:15:40 +00:00
christos
0ff9c30a3a Also substitute ${X11SRCDIR} for the random seed for reproducible builds so
that the random seed is consistent.
XXX: pullup-8
2018-05-20 14:39:53 +00:00
thorpej
266bca89c9 Add a 1PPS-over-GPIO driver, originally by Brad Spencer, with changes by
me to adapt to the new GPIO interrupt interface and support a wider variety
of GPIO pin configuations.

PR kern/51676
2018-05-20 14:08:32 +00:00
wiz
5ac153b128 End sentence with a dot. 2018-05-20 12:08:46 +00:00
maxv
df9d65850f Add a note about FreeBSD. 2018-05-20 09:14:18 +00:00
maxv
dc0ca504c7 Update, after ten years. Importantly, add a "History" section, to explain
what's going on.

We have now become "upstream", and most of the ipsec-tools development is
done in NetBSD's CVS. However, many distributions still take their
tarballs from SourceForge (which is defunct, and not maintained).
2018-05-20 08:55:25 +00:00
ryo
584a364528 pmap_enter() must update modified/referenced flags by 'flags' not 'prot'. 2018-05-20 06:45:00 +00:00
maxv
ffafb66f54 Remove notyet, we've never had this. 2018-05-20 06:29:43 +00:00
maxv
4eb599a9b3 Style. 2018-05-20 06:15:45 +00:00
kamil
20c051d726 Make stopsigmask a non-static symbol now as it's used in ptrace(2) code
This is a missing part of the previous commit.

While there fix a typo in a newly added comment in the ptrace(2) code.

Sponsored by <The NetBSD Foundation>
2018-05-20 04:00:35 +00:00
kamil
7f2cb72e7e Fix and enable traceme_signal_nohandler2 in ATF ptrace(2) tests
traceme_signal_nohandler2 checks emitting SIGSTOP to a traced process
with the PT_CONTINUE operation.

The expected behavior is to simulate a behavior of receiving SIGSTOP,
generating SIGCHLD to its parent (in this case the debugger) and ability
to call wait(2)-like function receiving the stopped child event.

The previous behavior was unstopping the process and it has been adjusted
in the kernel code.

FreeBSD keeps unstopping a process for emitting SIGSTOP.
Linux handles this scenario in the same way as NetBSD now.

While there, implement the missing bits in the userland ATF test for
traceme_signal_nohandler2: receiving and validating 2nd SIGSTOP event and
continuing the process, followed by its normal termination.

Sponsored by <The NetBSD Foundation>
2018-05-20 03:51:31 +00:00
christos
8841d3f7b9 Fix reproducible builds
XXX: pullup-8
2018-05-20 03:09:02 +00:00
thorpej
5aae56c5be Note GPIO interrupt support overhaul. 2018-05-19 22:57:54 +00:00
christos
aac6defbba don't prepend sysroots when we already have prepended it (breaks X11 binaries) 2018-05-19 21:20:35 +00:00
maxv
79383b8281 Remove dead code, and style. 2018-05-19 20:40:40 +00:00
maxv
e2ff693411 Remove unused 'error' variables, it's obvious they should have no use. 2018-05-19 20:21:23 +00:00
maxv
165b31ce96 Use strict prototypes, when they don't introduce more warnings than they fix.
Also localify a few functions.
2018-05-19 20:14:56 +00:00
thorpej
62b8bd8a74 Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.
2018-05-19 20:04:41 +00:00
maxv
abe88a07be Remove unused labels, functions, and function prototypes. 2018-05-19 19:47:47 +00:00
maxv
78d5ecb35f More unused variables. 2018-05-19 19:32:16 +00:00
maxv
ff699fb469 Remove unused variables. 2018-05-19 19:23:15 +00:00
maxv
253ae9a65a Style, a little... 2018-05-19 18:51:59 +00:00
jakllsch
1f91fc4431 Fix some whitespace style issues. 2018-05-19 18:19:37 +00:00
jakllsch
7ee7de8c2d Compact crc32 code by 12 bytes of text.
From dave0 in #NetBSD on Freenode circa December 2017.

Tested in a 32-bit userland harness to produce identical results as old
code for one set of inputs.
2018-05-19 18:18:16 +00:00