Commit Graph

265630 Commits

Author SHA1 Message Date
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
knakahara 1da2d3b232 Fix panic when wm(4) is reattached. ok by msaitoh@n.o.
This panic occured after kern_rndq.c:r1.90.
2019-02-21 08:10:22 +00:00
mrg 543c86fd13 fix naming errors in previous. (this file is no longer compiled, but
this fix makes the pull up more obvious, before deleting this file.)
2019-02-21 05:02:20 +00:00
mrg 39e3203eaa for sysv ipc stat operations, explicitly copy the exported parts
instead of the whole ds structure.

besides triggering a recently added assert in netbsd32, this stops
exposing kernel addresses.

copy the mode clamping to 0777 from sem to shm and msg.


while here, make sure that the compat callers to sysv_ipc clear
the contents of the compat structure before setting the result
members to ensure padding bytes are cleared.

don't set/copy _sem_base, _msg_first, _msg_last or _shm_internal.
even if used, which seems very dodgy, they leak KVAs as well.
possibly this may affect linux binaries, in particular, the
comments around _shm_internal ("XXX Oh well.") may mean apps
rely upon these but hopefully not -- the comments date back to
rev 1.1 in 1995.

the _key, _seq and _msg_cbytes members are exported as before as
i found multiple consumers of these (no less than ipcs(1), and
they appear to be useful for debugging and more.


XXX: the naming of compat functions have too many styles.  there
     are at least 3 different ones changed here.
2019-02-21 03:37:18 +00:00
sevan 0c02a81b28 Sometimes negative acknowledgement also shows up as NAK 2019-02-21 01:20:45 +00:00
christos b3b9361cff handle O_NOSIGPIPE too. 2019-02-20 19:42:14 +00:00
macallan 7ead432177 moar match string 2019-02-20 18:19:46 +00:00
wiz b12920d30c Remove superfluous Pp. 2019-02-20 17:48:31 +00:00
msaitoh 01d880aba7 Add support for BCM5762, BCM5725, BCM5727, BCM57764, BCM57767 and BCM57787. 2019-02-20 17:08:06 +00:00
msaitoh 46a6566ee5 - Add support for BCM5762 ASIC devices.
- Add BCM5762, BCM5725, BCM5727, BCM57764, BCM57767 and BCM57787.
2019-02-20 17:00:20 +00:00
msaitoh 403b39d97a Add BCM5702FE, another BCM5704S and SysKonnect SK-9Mxx support. 2019-02-20 15:56:51 +00:00
kamil a3c646ca3f Unify the style of t_ubsan tests
Apply similar change for load_invalid_value_bool in
test_load_invalid_value_enum.

Follow up of PR bin/53968 by Michael van Elst
2019-02-20 11:40:41 +00:00
hannken e28265c95c - Make the fstrans mount info part of the per-lwp state and replace
most accesses to the mount with fstrans mount info.

- Add "fmi_gone" to be true after unmount and add a counter of
  outstanding mount infos so fstrans_clear_lwp_info() only runs
  if there may be something to do.

- Move lookup of base mounts into per-lwp state.

- Keep a list of valid mounts for DIAGNOSTIC checks.
2019-02-20 10:09:45 +00:00
hannken 583a153e11 Move fstrans_unmount() to vfs_rele(), just before it would free the mount.
Don't take a mount reference for fstrans as it gets notified about the release.

Defer the final free of the mount to fstrans_mount_dtor() when fstrans
has released all references to this mount.  Prevents the mount's memory
to be reused as a new mount before fstrans released all references.

Address PR kern/53928 modules/t_builtin:disable test case randomly fails.
2019-02-20 10:08:37 +00:00
hannken f421b3668b Attach "mnt_transinfo" to "dead_rootmount" so every mount has a
valid "mnt_transinfo" and remove now unneeded flag IMNT_HAS_TRANS.

Run fstrans_start()/fstrans_done() on dead_rootmount if FSTRANS_DEAD_ENABLED.
Should become the default for DIAGNOSTIC in the future.
2019-02-20 10:07:27 +00:00
hannken a041391e45 Assign vnode to dead_rootmount before vcache_dealloc() releases it.
Now v_mount is never NULL.
2019-02-20 10:06:33 +00:00
hannken 2df7877a09 Set "mnt_lower" before the first file system operation on the new file system. 2019-02-20 10:05:59 +00:00
hannken 3c4b857dd5 Bracket do_sys_renameat() and nfsrv_rename() with fstrans.
The v_mount field for vnodes on the same file system as "from"
is now stable for referenced vnodes.

VFS_RENAMELOCK no longer may use lock from an unreferenced and
freed "struct mount".
2019-02-20 10:05:20 +00:00
hannken 8d939a9270 Fix vnode locking, must lock for VOP_OPEN() and VOP_UNLOCK() when done. 2019-02-20 10:04:28 +00:00
hannken 836873044c Remove superfluous VOP_UNLOCK(), vnode will be unlocked from spec_reclaim(). 2019-02-20 10:03:55 +00:00
hannken b783399854 Make FSS_ERROR a flag to prevent bogus fscow_disestablish() after error. 2019-02-20 10:03:25 +00:00
hannken 936247f806 Fix vnode locking for opendisk(), must lock for VOP_OPEN(). 2019-02-20 10:02:51 +00:00
pgoyette 4d21548422 compat70_ocreds_valid is not a pointer to a boolean, it is the boolean
itself which controls whether or not we recognize the OCRED options.

Should fix the panic identified in PR kern/53991 (awaiting confirmation
from submitter).
2019-02-20 09:59:39 +00:00
kamil dc43916dcf Try to make load_invalid_value_bool portable to Big-Endian
PR bin/53968 by Michael van Elst
2019-02-20 09:50:09 +00:00
kamil b07a2df4fa Replace signal4 (PT_STEP) test with refactored ones with extra asserts
New tests: step_signalmasked and step_signalignored.

Assert that signal context is not reset upon PT_STEP trap.

Mark new tests as expecting to fail.
2019-02-20 09:25:11 +00:00
msaitoh c666e7f586 Simplify PCI device table. No functional change. 2019-02-20 08:03:58 +00:00
msaitoh 8ab6db13a3 Regen. 2019-02-20 07:47:34 +00:00
msaitoh 389a3a7d24 Add SK-NET SK-9Mxx Gigabit Ethernet. 2019-02-20 07:47:11 +00:00
kamil a0995bf67f Add more tests for variations of unrelated_tracer_sees_crash in ATF
New tests:
 - unrelated_tracer_sees_signalmasked_crash_trap
 - unrelated_tracer_sees_signalmasked_crash_segv
 - unrelated_tracer_sees_signalmasked_crash_ill
 - unrelated_tracer_sees_signalmasked_crash_fpe
 - unrelated_tracer_sees_signalmasked_crash_bus
 - unrelated_tracer_sees_signalignored_crash_trap
 - unrelated_tracer_sees_signalignored_crash_segv
 - unrelated_tracer_sees_signalignored_crash_ill
 - unrelated_tracer_sees_signalignored_crash_fpe
 - unrelated_tracer_sees_signalignored_crash_bus

All these tests are failing with the current kernel.
2019-02-20 07:18:18 +00:00
mrg 2ca163b231 use KASSERTMSG() in netbsd32_ptr32i(). 2019-02-20 06:04:28 +00:00
rin 8cef165a13 Export atomic_cas_32_ni in a similar manner to its 64-bit counterpart.
Compile test only, but seems trivial enough for me.

Fix build error due to test/lib/libc/atomic/t_atomic_cas.

Note that mips32 does not use atomic_cas.S.
2019-02-20 05:25:12 +00:00
kamil 383b4e94a2 Add minor improvements in unrelated_tracer_sees_crash in t_ptrace_wait*
Switch forkee commands with asserts to be aligned for the purpose of being
used by forkees.
2019-02-20 05:20:05 +00:00
rin 184dcf3f8a WARNS=3 for compat_netbsd32_* in order to appease sign-compare warnings
for mips64, where NETBSD32_POINTER_TYPE is signed.
2019-02-20 05:11:30 +00:00
msaitoh 340e8542ab Add BCM5717's another device ID support. 2019-02-20 04:49:08 +00:00
pgoyette 759c9ce33f Add an entry to remind someone(tm) to review the need for WARNS=3 in
more than 100 modules' Makefile.
2019-02-20 04:32:51 +00:00
msaitoh 3da8db6fff Regen. 2019-02-20 03:57:28 +00:00
msaitoh 25c6288c9f Add some Broadcom Ethernet devices from {Open,Free}BSD. 2019-02-20 03:57:03 +00:00
christos 1fe7b7ace4 try using COPTS instead of CPPFLAGS 2019-02-20 03:50:06 +00:00
pgoyette 2d6aca9e32 Another WARNS=3 module 2019-02-20 01:20:16 +00:00
pgoyette 0347dde6b5 Another module that needs WARNS=3 to allow signed-vs-unsigned compares 2019-02-20 00:55:03 +00:00
sevan ed144a82dc POWERMAC_G5 and POWERMAC_G5.MP kernels 2019-02-20 00:22:29 +00:00
sevan f1b263c7a6 Document the netbsd-POWERMAC_G5 and netbsd-POWERMAC_G5.MP kernels. 2019-02-20 00:10:26 +00:00