Commit Graph

267548 Commits

Author SHA1 Message Date
maxv c496b67597 Clean up a little, add new XCR0 bits, remove a few unused MSRs, and fix
typos.
2019-05-18 08:17:39 +00:00
maxv c7628e5418 Set the symbol type for intrfastexit, so that tools like tprof can find
the symbol name.
2019-05-18 07:58:58 +00:00
abhinav 933b5da267 PR misc/54213: Fix performance of whatis(1) when no matches are found
In revision 1.6 of whatis.c the query was modified to return matches for names found
in MLINKS of the man pages as well. However it was slow. The reason probably being that it
required a join. But more importantly the where condition on an FTS virtual table column
is very slow. To avoid the join and the expensive where condition on the virtual table,
add the name_desc column to the mandb_links table as well. This improves the performance
of whatis(1) to the original level at the expense of slight data duplication.

Bump the schema to force database rebuild to take account for the new column addition
2019-05-18 07:56:43 +00:00
maxv eb40683716 Disable errata #1091. We are the only OS to apply it, and it seems to be
causing trouble to VirtualBox (PR/54143).
2019-05-18 07:49:31 +00:00
skrll 2c9023a65e Switch the kernel7.img RaspberryPi kernel in the armv7 image to GENERIC
and thus reducing the number of kernels built in an evbarmv7 release.
2019-05-18 07:33:10 +00:00
gutteridge 94d05cbf81 cpuctl.8: minor fixes 2019-05-17 23:51:35 +00:00
christos d93832813c use a union cast to assert alignment of string constant. 2019-05-17 20:27:48 +00:00
christos d0659350cc Factor out the magic checking code for the label, and make it not depend
on alignment.
2019-05-17 18:50:40 +00:00
christos b8616ab611 Factor out the fbinfo setting code, to make it more readable, and use
memcpy to properly align the structure (although it does not matter on x86).
2019-05-17 18:34:33 +00:00
nakayama 43b52312c6 Use ${_TOOL_PREFIX} instead of hardcoding "nb" for consistency. 2019-05-17 13:51:36 +00:00
nakayama 0015932b89 Revert previous.
The binaries created are different, but according to joerg@ there
is no difference in functionality.
2019-05-17 13:44:55 +00:00
wiz 315c68e54c Merge single-letter options in SYNOPSIS.
Add an article.
2019-05-17 08:56:12 +00:00
ozaki-r e674e58b44 mount_9p: add initial support for 9P2000.u
The implementation enables to work with a server talking 9P2000.u.  However, it
doesn't use the extended fields yet; it just ignores those of received messages
and sets "please ignore" values to those of sending messages such as zero-length
strings and maximum unsigned values.

The feature is enabled by the -u option.
2019-05-17 08:48:04 +00:00
wiz 5e9199761d Add missing .Re. 2019-05-17 08:26:20 +00:00
ozaki-r 9e63ef91c4 Refer the current official page 2019-05-17 07:50:49 +00:00
ozaki-r 3f3df26172 Document the -s option 2019-05-17 07:50:09 +00:00
msaitoh 3441efda2e ifmedia(4): Extend Ethernet's ifmedia word's subword up to 255. 2019-05-17 07:42:29 +00:00
msaitoh 526b9038db Use new media types. 2019-05-17 07:39:33 +00:00
msaitoh e6f3676a26 New SIOC[GS]IFMEDIA.
Welcome to 8.99.41.
2019-05-17 07:38:48 +00:00
msaitoh bf354a0797 The max subtype of the ifmedia word is 31. It's too small for Ethernet now.
We currently use use it up to 30. We should extend the limit to be able to use
more than 10Gbps speeds. Our ifmedia(4) is inconvenience and have some problem
so we should redesign the interface, but it's too late for netbsd-9 to do it.
So, we keep the data structure size and modify the structure a bit. The
strategy is almost the same as FreeBSD. Many bits of IFM_OMASK for Ethernet
have not used, so use some of them for Ethernet's subtype.

The differences against FreeBSD are:
 - We use NetBSD style compat code (i.e. no SIOCGIFXMEDIA).
 - FreeBSD's IFM_ETH_XTYPE's bit location is from 11 to "14" even though
   IFM_OMASK is from 8 to "15". We use _IFM_ETH_XTMASK from bit 13 to "15".
 - FreeBSD changed the meaning of IFM_TYPE_MATCH(). I think we should
   not do it. We keep it not changing and added new IFM_TYPE_SUBTYPE_MATCH()
   macro for matching both TYPE and SUBTYPE.
 - Added up to 400GBASE-SR16.

New layout of the media word is as follows (from ifmedia_h):

 * if_media Options word:
 *	Bits	Use
 *	----	-------
 *	0-4	Media subtype	MAX SUBTYPE == 255 for ETH and 31 for others
 *	5-7	Media type
 *	8-15	Type specific options
 *	16-18	Mode (for multi-mode devices)
 *	19	(Reserved for Future Use)
 *	20-27	Shared (global) options
 *	28-31	Instance
 *
 *   3                     2                   1
 *   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
 *  +-------+---------------+-+-----+---------------+-----+---------+
 *  |       |               |R|     |               |     |         |
 *  | IMASK |     GMASK     |F|MMASK+-----+ OMASK   |NMASK|  TMASK  |
 *  |       |               |U|     |XTMSK|         |     |         |
 *  +-------+---------------+-+-----+-----+---------+-----+---------+
 *   <----->                   <--->                 <--->
 *  IFM_INST()               IFM_MODE()            IFM_TYPE()
 *
 *                              IFM_SUBTYPE(other than ETH)<------->
 *
 *                                   <---> IFM_SUBTYPE(ETH)<------->
 *
 *
 *           <------------->         <------------->
 *                        IFM_OPTIONS()
2019-05-17 07:37:11 +00:00
mrg 1905ac2405 apply some __diagused. 2019-05-17 06:05:07 +00:00
knakahara 75255032e6 Don't clear calculated Tx tos value for IPv[46] over IPv6. 2019-05-17 05:27:24 +00:00
msaitoh 593915784e Remove extra OSIOCSIFMEDIA. This old ioctl is converted to new one in
doifioctl().
2019-05-17 04:08:54 +00:00
ozaki-r 7fc219a5ee Implement an aggressive psref leak detector
It is yet another psref leak detector that enables to tell where a leak occurs
while a simpler version that is already committed just tells an occurrence of a
leak.

Investigating of psref leaks is hard because once a leak occurs a percpu list of
psref that tracks references can be corrupted.  A reference to a tracking object
is memorized in the list via an intermediate object (struct psref) that is
normally allocated on a stack of a thread.  Thus, the intermediate object can be
overwritten on a leak resulting in corruption of the list.

The tracker makes a shadow entry to an intermediate object and stores some hints
into it (currently it's a caller address of psref_acquire).  We can detect a
leak by checking the entries on certain points where any references should be
released such as the return point of syscalls and the end of each softint
handler.

The feature is expensive and enabled only if the kernel is built with
PSREF_DEBUG.

Proposed on tech-kern
2019-05-17 03:34:26 +00:00
macallan 01a177fdbf Even more registers! 2019-05-16 23:42:23 +00:00
macallan 1a0d0c1609 switch the default input to line in, to avoid feedback noise on laptops
should probably just mute the input, I need to read the datasheet again...
2019-05-16 23:39:37 +00:00
nakayama 8f5eb157ac Specify PID file to properly rotate npf log file. 2019-05-16 20:12:35 +00:00
nakayama 95541573e2 Rename nb{clang,llvm}-tblgen to ${MACHINE_GNU_PLATFORM}-{clang,llvm}-tblgen
since they contain the default target (e.g. x86_64--netbsd).
2019-05-16 20:00:49 +00:00
tpaul 0b7d2ee43d Prevent Lua from crashing if clear_bindings() is called on a statement
that failed to prepare().

ok mbalmer@
2019-05-16 12:42:35 +00:00
sevan 667d342ee9 CE, DLCI, LMI, MGCP, PE, PVC, SVC, VPWS 2019-05-16 10:28:19 +00:00
msaitoh 584b63d2fc Revert rev. 1.29. Use current cpuid 7 edx value to print. 2019-05-16 04:26:13 +00:00
msaitoh 87d770a83f Add md_clear. 2019-05-16 02:42:19 +00:00
msaitoh ea85add312 Use ci_feat_val[7] instead of directly getting cpuid 7 edx. 2019-05-16 02:36:30 +00:00
christos cf36505167 Fix MKCOMPATX11 build 2019-05-16 01:22:35 +00:00
maxv 05c1eda038 Enable EagerFPU on Xen PV. Should work as-is. Sent on port-amd64@. 2019-05-15 18:27:51 +00:00
maxv 9a0231b6db RB_MD3 now disables SVS. 2019-05-15 17:35:02 +00:00
maxv e795d0888c Change the way SVS is disabled. Now you have to pass "boot -3" from the
bootloader. The machdep.svs.enabled sysctl becomes read-only, and just
indicates whether SVS is enabled.

Sent on port-amd64@.
2019-05-15 17:31:41 +00:00
christos 58c984f9c2 From: Tobias Ulmer. Unbreak zfs module build on sparc{,64} by hiding DELAY.
ZFS has a conflicting definition of delay() and tries to hide it by
defining __HIDE_DELAY.
2019-05-15 16:59:10 +00:00
christos 6517494e91 print also ksi_code. 2019-05-15 13:49:10 +00:00
christos 72f0997774 Add a comment about iLO 2019-05-15 13:47:41 +00:00
christos af5402251e Add explanatory text 2019-05-15 13:43:45 +00:00
maxv 9113861689 NVMM: Expose MD_CLEAR to the guests. 2019-05-15 04:39:52 +00:00
knakahara 8b6ba33038 Fix build failure when INET6 is disabled and NET_MPSAFE is enabled. Pointed out by ozaki-r@n.o, thanks. 2019-05-15 03:33:41 +00:00
ozaki-r 6c6d1e4f71 Get rid of IFNET_LOCK for if_mcast_op to avoid a deadlock
The IFNET_LOCK was added to avoid data races on if_flags for IFF_ALLMULTI.
Unfortunatetly it caused a deadlock instead.  A known scenario causing a
deadlock is to occur the following two operations concurrently: (a) a removal of
an IP adddres assigned to an interface and (b) a manipulation of multicast
groups to the interface.  The resource dependency graph is like this:
  softnet_lock => IFNET_LOCK => psref_target_destroy => softint => softnet_lock

Thanks to the previous commit that avoids data races on if_flags for
IFF_ALLMULTI by another approach, we can remove IFNET_LOCK and defuse the
deadlock.

PR kern/54189
2019-05-15 02:59:18 +00:00
ozaki-r 99ec0af5eb Store IFF_ALLMULTI in ec_flags instead of if_flags to avoid data races
IFF_ALLMULTI is set/unset to if_flags via if_mcast_op.  To avoid data races on
if_flags, IFNET_LOCK was added for if_mcast_op.  Unfortunately it produces
a deadlock so we want to remove added IFNET_LOCK by avoiding the data races by
another approach.

This fix introduces ec_flags to struct ethercom and stores IFF_ALLMULTI to it.
ec_flags is protected by ETHER_LOCK and thus IFNET_LOCK is no longer necessary
for if_mcast_op.  Note that the fix is applied only to MP-safe drivers that
the data races matter.

In the kernel, IFF_ALLMULTI is set by a driver and used by the driver itself.
So changing the storing place doesn't break anything.  One exception is
ioctl(SIOCGIFFLAGS); we have to include IFF_ALLMULTI in a result if needed to
export the flag as well as before.

A upcoming commit will remove IFNET_LOCK.

PR kern/54189
2019-05-15 02:56:47 +00:00
mrg 7ce6ce51a2 support RK3328 tsadc:
- add clk_24m, clk_tsadc and pclk_tsadc rk3328 clocks
- rk3328 data<->temp conversion table is is wrong.  the actual values
  seen are 4096 - <expected>, and the linux driver has these values
  in the inverted value directly
- the above means the rk3328 is increasing data for increasing temp,
  and the min/max values are also inverted and swapped
- move auto-period into the rk_data
- rk3328 only has one sensor, deal with this
- rename rk_data_table as rk_data, and also s/rdt/rd/

thanks to jmcneill who helped clean up clocks confusion, and pointed
out the linux driver values matched my own inverted data experience.
2019-05-15 01:24:43 +00:00
christos 0b75a11ff8 more powerpc issues 2019-05-14 19:24:09 +00:00
christos 292b510fe2 clang ifunc's on powerpc require secure-plt. 2019-05-14 19:07:07 +00:00
msaitoh e201e655df Add snprintb's string for cpuid7 edx bit 10 "MD_CLEAR". 2019-05-14 18:11:34 +00:00
maxv 74b8eea55e Mitigation for INTEL-SA-00233: Microarchitectural Data Sampling (MDS).
It requires a microcode update, now available on the Intel website. The
microcode modifies the behavior of the VERW instruction, and makes it flush
internal CPU buffers. We hotpatch the return-to-userland path to add VERW.

Two sysctls are added:

	machdep.mds.mitigated = {0/1} user-settable
	machdep.mds.method = {string} constructed by the kernel

The kernel will automatically enable the mitigation if the updated
microcode is present. If the new microcode is not present, the user can
load it via cpuctl, and set machdep.mds.mitigated=1.
2019-05-14 16:59:25 +00:00