258835 Commits

Author SHA1 Message Date
nonaka
327f8a3690 gmake: __alloca and __stat are provided only when building with GLIBC.
Fix a build failure on Ubuntu 18.04.
2018-05-23 09:52:27 +00:00
ryo
677168d711 style 2018-05-23 08:20:12 +00:00
maxv
488673a3ac Merge convert_xmm_s87.c into fpu.c. It contains only two functions, that
are used only in fpu.c.
2018-05-23 07:45:35 +00:00
maxv
2684bf2f4d style 2018-05-23 07:34:40 +00:00
para
cc7824fd34 fix build
obsolete HMAC from cat3 as it was renamed to openssl_HMAC
2018-05-23 07:33:55 +00:00
maxv
7d80450676 Clean up the FPU headers. 2018-05-23 07:24:37 +00:00
wiz
e8075710dc Mark up argument. Fix typo. 2018-05-23 07:08:13 +00:00
wiz
e46faeed68 Add missing .El. Replace Ta outside its defined usage with No (no change
to text output).
2018-05-23 07:06:45 +00:00
wiz
1a15da2ec7 Use .An in authors section. Remove empty section. 2018-05-23 06:08:01 +00:00
msaitoh
f4dbbca14e Add SSBD bit for Intel. 2018-05-23 05:04:39 +00:00
msaitoh
bd8db26297 Don't check IFF_RUNNING in ixgbe_rxeof(). Doing break and leaving a deacriptor
with DD bit is worse than just processing the entry. And it's also racy to
check IFF_RUNNING in rxeof(). If you'd like to strictly obey IFF_RUNNING,
it would be better to do it in the upper layer.

 Same as DragonFly (a part of 79251f5ebe4cf9dd2f3e6aed590e09d756d39922).
2018-05-23 04:45:24 +00:00
msaitoh
4735e8e1bf Add rxd_nxck (Receive Descriptor next to check) read only sysctl. 2018-05-23 04:37:13 +00:00
christos
e4acc50303 Add cross references to the openssl man pages. 2018-05-23 02:08:40 +00:00
christos
9077b5aaa9 rename {HMAC,MD5} to openssl_{HMAC,MD5}; add openssl_MD{2,4} 2018-05-23 02:06:03 +00:00
christos
2ded5b1a5c rename {MD5,HMAC} to openssl_{MD5,HMAC}. Also add man pages for openssl_MD2
and openssl_MD4 to avoid conflicts with case-preserving but case-insensitive
filesystems and the corresponding libc lower case man pages.
2018-05-23 01:58:40 +00:00
kamil
9b1435470a Refactor the attach[1-8] and race1 ATF t_ptrace_wait* tests
Share code in: attach1, attach2 and race1 in the same function body.
Rename thsee tests to more verbose names:
 - tracer_sees_terminaton_before_the_parent
 - tracer_sysctl_lookup_without_duplicates
 - unrelated_tracer_sees_terminaton_before_the_parent

Rename attach3 to parent_attach_to_its_child.

Rename attach4 to child_attach_to_its_parent.

Share code in attach5, attach6 and attach7 in the same function body and
reanem the tests to:
 - tracee_sees_its_original_parent_getppid
 - tracee_sees_its_original_parent_sysctl_kinfo_proc2
 - tracee_sees_its_original_parent_procfs_status

Reduce the code by around 50%.

No functional change intended. All tests pass.

Sponsored by <The NetBSD Foundation>
2018-05-23 01:29:43 +00:00
christos
9495f777bf remove Mail 2018-05-23 01:05:47 +00:00
christos
45c59656f1 Remove Mail 2018-05-23 01:03:46 +00:00
kamil
1f98e5479d Define PTRACE_BREAKPOINT_ASM for i386 in the MD part of <sys/ptrace.h>
x86 uses int3 for software breakpoint on i386 and amd64.

Sponsored by <The NetBSD Foundation>
2018-05-22 21:03:09 +00:00
maxv
39b17c8e86 Extend the AMD NONARCH method to family 17h. The AMD spec states that for
17h care must be taken when handling sibling threads.

The concern is that if we have a protected two-thread process running on
two siblings, and context switch one thread to another unprotected thread,
disabling the SSB protection on one logical core will disable SSB on its
sibling too (which is still running the protected thread).

All of that doesn't matter to us, because the SSB value we set is
system-wide, not per-process.
2018-05-22 17:14:46 +00:00
maxv
c1030802e3 Simplify the sysctl handlers. 2018-05-22 16:44:42 +00:00
maxv
530f0b9126 Forgot switch cases for AMD. 2018-05-22 16:36:19 +00:00
reinoud
2a35e8d935 Include <machine/mcontext.h> now its available 2018-05-22 14:38:10 +00:00
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