Commit Graph

265671 Commits

Author SHA1 Message Date
rin
0a91477ac0 Add ./usr/include/dev/spi 2019-02-24 02:29:09 +00:00
kamil
c5cd46777b Drop signal5 test-case from ATF t_ptrace_wait*
This test is now duplicated with traceme_signalmasked_exec.
2019-02-23 20:52:42 +00:00
kamil
71299c6f1d Add signal masked and ignored variations of traceme_exec in ATF tests
All tests pass.
2019-02-23 20:46:27 +00:00
kamil
6174d56e42 Rearrange code in amdgpu_display.c to prevent build error
GCC reports that stat can be uninitialized when used, prevent this with
changing the construction of the code a little bit.

Keep original indent in order to not generate diff with upstream.

Solution suggested by <mrg>

Detected with GCC7 when building NetBSD/i386 with kUBSan.
2019-02-23 19:56:51 +00:00
kamil
e9178591aa Add missing break in amdgpu_gfx_v8_0.c
Reviewed by <mrg>

Detected with GCC7 with kUBSan build for NetBSD/i386
2019-02-23 19:37:36 +00:00
kamil
cf28f6959e Add missing break in amdgpu_cz_smc.c
Reviewed by <mrg>

Detected with GCC7 with kUBSan build for NetBSD/i386
2019-02-23 19:36:15 +00:00
kamil
0327411d8a Add signal masked and ignored variations of traceme_vfork_exec in ATF tests
All tests pass.
2019-02-23 18:07:47 +00:00
wiz
e38ac3b5cb New sentence, new line. Add missing Nd. Remove superfluous Rs. 2019-02-23 17:37:10 +00:00
wiz
70e4e24829 Sort SEE ALSO. 2019-02-23 17:34:04 +00:00
wiz
eb550baddf New sentence, new line. 2019-02-23 17:33:01 +00:00
martin
d9a5cbbf80 Adjust all callers of dwc_gmac_attach, pass MII_PHY_ANY for now. 2019-02-23 17:18:38 +00:00
martin
3502630206 Pass the phy ID to dwc_gmac_attach. 2019-02-23 17:18:07 +00:00
kamil
a7931d4610 Register kUBSan and KCOV in kernel=GENERIC of NetBSD/i386
Both options are disabled by default.
2019-02-23 12:28:22 +00:00
maxv
5891881932 Install the x86 RESET state at VCPU creation time, for convenience, so
that the libnvmm users can expect a functional VCPU right away.
2019-02-23 12:27:00 +00:00
kamil
83b223f69d Reserve majors for HAXM and example loadable kernel modules
348-350 are reserved for HAXM
351 is reserved for sys/modules/examples

Discussed on tech-kern@
2019-02-23 12:25:33 +00:00
kamil
0a62dd894e Stop including <sys/atomic.h> in KCOV
This header is not needed.

Noted by <martin>
2019-02-23 12:07:40 +00:00
kamil
ccd1760460 Fix subr_kcov build on NetBSD/i386
Cast the pointer returned from __builtin_return_address() to intptr_t
before converting it to uint64_t.
2019-02-23 12:03:07 +00:00
kamil
e222246acd Correct printing type of b_blkno (int64_t) in st.c
Fixes build with kUBSan on NetBSD/i386.
2019-02-23 11:57:41 +00:00
kamil
6d863cec8b Fix GCC7 "avoid ambiguous 'else'" build error in if_wm.c
Detected with kUBSan NetBSD/i386 build.
2019-02-23 11:41:08 +00:00
kamil
3f2edb6fdf Improve fallthrough statement wording in dev/gpib/ct.c
Fixes build with kUBSan on NetBSD/i386.
2019-02-23 11:33:31 +00:00
kamil
e1b2633dfc Improve fallthrough statement wording
Fixes build with kUBSan on NetBSD/i386.
2019-02-23 11:24:53 +00:00
mlelstv
ed3650807a add missing debug file for kcov. 2019-02-23 11:23:07 +00:00
maxv
35dd2ad507 Move PATENTRY into pmap.h, will be used outside. 2019-02-23 10:59:12 +00:00
maxv
34a76d1469 Add support for CPUs that don't have the EPT_{A,D} bits.
On such CPUs, these bits are ignored by the hardware. We don't care about
setting them, however, we must always assume they are set. Modify the pmap
code to do that.

While here, in pmap_ept_remove_pte, don't flush the TLB when it's not
needed.

Tested on an old Intel Celeron.
2019-02-23 10:43:36 +00:00
mlelstv
975ce0ba8d Add userland driver to spi framework.
Previously spi would configure the controller to use the lowest speed of
all connected devices since the kernel started and to fail attempted mode
changes. This is now improved to keep individual modes and speeds for each
slave and to reconfigure the controller as necessary for each transfer.

Added man page for spi(9).
2019-02-23 10:43:25 +00:00
maxv
65e39aee46 Reorder the functions, and constify setstate. No functional change. 2019-02-23 08:19:16 +00:00
kamil
5577155981 Fix build of kcov tests on CPUs without 64-bit atomics
Restrict the 64-bit atomics to ports defining __HAVE_ATOMIC64_OPS.

Using 64-bit atomics is still good for i586 fuzzing, but the tests are
build for earlier CPUs. This makes this code to be disabled in i386 builds.

There is a similar situation with few other ports that offer 64-bit atomics
in certain CPU models and ABIs.
2019-02-23 08:03:24 +00:00
mlelstv
8e117ced4e Reserve major number for spi driver 2019-02-23 07:33:20 +00:00
mrg
c8eaee5359 pull out libstdc++ config.h as-is, for gnu.ver processing.
pull out the cxx11_sources and cxx98_sources values to avoid hard coding.
2019-02-23 06:54:45 +00:00
kamil
0fe7e51662 Add KCOV - kernel code coverage tracing device
The KCOV driver implements collection of code coverage inside the kernel.
It can be enabled on a per process basis from userland, allowing the kernel
program counter to be collected during syscalls triggered by the same
process.

The device is oriented towards kernel fuzzers, in particular syzkaller.

Currently the only supported coverage type is -fsanitize-coverage=trace-pc.

The KCOV driver was initially developed in Linux. A driver based on the
same concept was then implemented in FreeBSD and OpenBSD.

Documentation is borrowed from OpenBSD and ATF tests from FreeBSD.

This patch has been prepared by Siddharth Muralee, improved by <maxv>
and polished by myself before importing into the mainline tree.

All ATF tests pass.
2019-02-23 03:10:05 +00:00
macallan
9a79811e23 some register bits are defined differently by SunOS's sxreg.h and the SPAM
manual, upon investigation the hardware appears to agree with the SunOS header,
so adapt accordingly
2019-02-22 23:01:25 +00:00
uwe
c07928f07f Check getchar() result for EOF.
Call cleanup(SIGHUP) if we get local EOF, as if we've got SIGHUP.
While here, use EOF constant instead of literal -1 in an existing
check.

PR bin/53996
2019-02-22 22:25:22 +00:00
tsutsui
60282a8efb Explicitly use ${TOOL_AWK} instead of system's awk. 2019-02-22 22:20:18 +00:00
tsutsui
9541ec522c Reduce diffs between common and amd64 uefi Makefile.bootimage files.
No functional change.
2019-02-22 22:13:58 +00:00
maya
92e1c52520 Default our libm to -frounding-math, if built with GCC.
The long-standing GCC default is to not respect rounding mode.
it looks like GCC 7 optimizes rint to a builtin, causing our few
rounding mode tests to fail.

Fixes PR port-amd64/54000: FP tests failing on amd64 since gcc7 import
2019-02-22 18:17:22 +00:00
maxv
b4b0af39d9 Fix omission: if we receive a guest trap on CR0, and if the original
instruction would have resulted in Long Mode being enabled, we need to
manually enable Long Mode ourselves. We were already doing that correctly
in setstate, but not in the CR0 trap handler.

Problem initially reported by Aymeric Vincent; ArchLinux wouldn't boot,
now it does and works correctly.

While here, add CR0_ET in the CR0 mask, for the associated shadow to
be taken into account. Normally this shadow bit shouldn't be necessary,
but for now I keep it regardless.
2019-02-22 12:24:34 +00:00
hannken
44e38a6483 Always set "cn_namelen" in addition to "cn_nameptr".
Fix vnode locking for REMOVE, RMDIR and RENAME.
2019-02-22 09:01:32 +00:00
msaitoh
2330b84d98 Fix a bug that if_link_state_change(ifp, LINK_STATE_DOWN) isn't called unless
link goes up at least one time. Without this change, never linkup-ed media
keeps LINK_STATE_UNKNOWN instead of LINK_STATE_DOWN.
2019-02-22 06:49:15 +00:00
christos
2252cc8ccc Mention that ENOSPC can be returned if we exhausted the max number of
semaphores.
2019-02-21 21:54:09 +00:00
christos
ae4f322282 PR/53998: Joel Bertrand: Return ENOSPC when SEM_NSEMS_MAX is exceeded
instead of -1.
2019-02-21 21:49:23 +00:00
christos
0abcbcb46c add a lint(1) comment to nothing. 2019-02-21 21:34:05 +00:00
christos
3ecfeb8539 - KNF return
- be careful with errno, only set it when it is possibly set and not before
  a system call.
- factor out a common mask comparison.
2019-02-21 21:33:34 +00:00
msaitoh
79244d2c8e Revision 2..5 == RTL8211B...F 2019-02-21 15:41:56 +00:00
maxv
6c017c9010 Add a TODO list for NVMM, just to list some known issues. 2019-02-21 14:56:23 +00:00
maxv
cb8f467cc0 Remove wrong KASSERT in EPT, and reorder the code to reduce duplication. 2019-02-21 14:31:54 +00:00
maxv
01d6ce2a3a Reorder the detection in vmx_ident(), to fix panic on old CPUs. We must
read MSR_IA32_VMX_EPT_VPID_CAP _after_ ensuring EPT is there, because if
it's not, the rdmsr faults.
2019-02-21 13:25:44 +00:00
maxv
fa98071a47 Another locking issue in NVMM: the {svm,vmx}_tlb_flush functions take VCPU
mutexes which can sleep, but their context does not allow it.

Rewrite the TLB handling code to fix that. It becomes a bit complex. In
short, we use a per-VM generation number, which we increase on each TLB
flush, before sending a broadcast IPI to everybody. The IPIs cause a
#VMEXIT of each VCPU, and each VCPU Loop will synchronize the per-VM gen
with a per-VCPU copy, and apply the flushes as neededi lazily.

The behavior differs between AMD and Intel; in short, on Intel we don't
flush the hTLB (EPT cache) if a context switch of a VCPU occurs, so now,
we need to maintain a kcpuset to know which VCPU's hTLBs are active on
which hCPU. This creates some redundancy on Intel, ie there are cases
where we flush the hTLB several times unnecessarily; but hTLB flushes are
very rare, so there is no real performance regression.

The thing is lock-less and non-blocking, so it solves our problem.
2019-02-21 12:17:52 +00:00
maxv
9f7d8f06c3 Clarify the gTLB code a little. 2019-02-21 11:58:04 +00:00
hannken
42e8a0834e Fix bad assertion: vfs_suspend(dead_rootmount) may happen and
must return EOPNOTSUPP.
2019-02-21 08:52:53 +00:00
mrg
fccaa949ae include libkern.h or strings.h. should fix i386 build issues. 2019-02-21 08:25:00 +00:00