Commit graph

225549 commits

Author SHA1 Message Date
Enji Cooper ac5ff11099 TESTSDIR isn't required; remove it
MFC after:	1 week
MFC with:	r322450
2017-08-13 01:08:37 +00:00
Enji Cooper 38dd175927 Integrate the tests moved in r305626 in to the FreeBSD test suite
The reachover Kyuafiles were never added, and thus the tests were installed
as standalone tests, and not integrated into the full suite.

MFC after:	1 week
MFC with:	r305626, 305629, r307863, r322447, r322448, r322449
2017-08-13 01:04:44 +00:00
Enji Cooper 191d976f61 Use hardcoded IPv4/IPv6 addresses for google-public-dns-a.google.com instead
of freefall.freebsd.org to unbreak the DNS tests

The address allocations for freefall.freebsd.org have changed in the past 4 years.
Use a more stable set of hardcoded addresses for now to make the tests succeed
reliably.

The hostname should be resolved dynamically instead of hardcoding the addresses in
the future. This is just a bandaid.

MFC after:	1 week
2017-08-13 00:56:43 +00:00
Enji Cooper 737fb907a7 Make root-privileges a requirement for the test
Some of the testcases try to manipulate sysctls that require root privileges,
e.g., "kern.sync_on_panic". Make root-privileges a hard requirement so the
tests don't raise false positives due to privilege issues when calling
sysctlbyname(3) on writable sysctls.

MFC after:	1 week
2017-08-13 00:14:08 +00:00
Enji Cooper ebe3e93cef Fix result printing
- Flushing stdout prevents the buffer from being printed twice, fixing
  issues with stdout printing out the testplan, etc, twice.
- Don't print out raw source/line numbers; hide them behind comments.

MFC after:	1 week
2017-08-13 00:04:50 +00:00
Enji Cooper 22dae9c629 Hide sccsid under #if 0, per example in style(9)
This fixes a -Wunused warning with gcc 6.3.0/7.0.0.

MFC after:	1 week
2017-08-12 22:20:08 +00:00
Nathan Whitehorn c670f31f19 Move NVME controller shutdown from being called as part of module unloading
to being called through the newbus DEVICE_SHUTDOWN() path. This ensures that
the NVME controller gets shut down before the device and bus disappear
and prevents data corruption on shutdown on at least Samsung EVO 960 SSDs.

PR:		kern/211852
Reviewed by:	imp
MFC after:	2 weeks
2017-08-12 22:13:06 +00:00
Enji Cooper 7a6fd8dc6b Delete trailing whitespace
MFC after:	1 month
2017-08-12 21:26:46 +00:00
Vladimir Kondratyev a9a8884bf9 bthidd(8): Add support for Apple's magic mouse
Note: Mouse's bthidd.conf record should contain vendor and device IDs
to make proper device detection. If it does not contain IDs,
regenerate record with "Query" command of recent bthidcontrol(8).

Submitted by:		Dirk Engling <erdgeist@erdgeist.org>
Reviewed by:		emax
Approved by:		bapt (mentor), gonzo (mentor)
Differential Revision:	https://reviews.freebsd.org/D3702
2017-08-12 21:23:33 +00:00
Vladimir Kondratyev 6032284eb9 bthidd(8): Add support for vendor_id, product_id and version.
Extend bthidd.conf format to store vendor and product IDs of remote
Bluetooth HID devices to make possible implementation of device
specific quirks inside bthidd(8).
Add support for querying of this information from device's SDP records
with bthidcontrol(8) "Query" command.

Submitted by:		Dirk Engling <erdgeist@erdgeist.org>
Reviewed by:		emax
Approved by:		bapt (mentor), gonzo (mentor)
Differential Revision:	https://reviews.freebsd.org/D3702
2017-08-12 21:20:51 +00:00
Jilles Tjoelker 2cc32af06f sh: Add tests for sh -c that already pass.
PR:		220587
Submitted by:	Ryan Moeller
2017-08-12 19:17:48 +00:00
John Baldwin 992029ba10 Reliably enable debug exceptions on all CPUs.
Previously, debug exceptions were only enabled on the boot CPU if
DDB was enabled in the dbg_monitor_init() function.  APs also called
this function, but since mp_machdep.c doesn't include opt_ddb.h, the
APs ended up calling an empty stub defined in <machine/debug_monitor.h>
instead of the real function.  Also, if DDB was not enabled in the kernel,
the boot CPU would not enable debug exceptions.

Fix this by adding a new dbg_init() function that always clears the OS
lock to enable debug exceptions which the boot CPU and the APs call.
This function also calls dbg_monitor_init() to enable hardware breakpoints
from DDB on all CPUs if DDB is enabled.  Eventually base support for
hardware breakpoints/watchpoints will need to move out of the DDB-only
debug_monitor.c for use by userland debuggers.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D12001
2017-08-12 18:42:54 +00:00
John Baldwin c9ee3caf19 Don't panic for PT_GETFPREGS.
Only fetch the VFP state from the CPU if the thread whose registers are
being requested is the current thread.  If a stopped thread's registers
are being fetched by a debugger, the saved state in the PCB is already
valid.

Reviewed by:	andrew
MFC after:	1 week
2017-08-12 18:38:18 +00:00
Ryan Libby 4c889da8b6 Revert r322418, LDBL_MAX_EXP unsuitable for macro pasting on some arches
Either need a different way to spell HALF_LDBL_MAX, or a different way
to spell LDBL_MAX_EXP, or a different approach.

Reported by:	ian
2017-08-12 18:28:02 +00:00
Li-Wen Hsu 229d577fe8 Re-remove excess / for installing SYMLINKS
This excess / was introduced in r280129, and fixed in r295230, but got
re-introduced while merging another branch in r298107.

Approved by:	gjb
Differential Revision:	https://reviews.freebsd.org/D11995
2017-08-12 18:11:41 +00:00
Sevan Janiyan ef764b4b8e Add missing header.
S_IRUSR is defined in sys/stat.h

PR:		209229
Submitted by:	<mt AT markoturk DOT info>
Approved by:	bcr (mentor)
MFC after:	5 days
Differential Revision:	https://reviews.freebsd.org/D12007
2017-08-12 17:46:50 +00:00
Ian Lepore 4541b9aab6 Bid for the device with BUS_PROBE_GENERIC, because this is very much a
generic driver with minimal feature support for a large number of chips.
More featureful per-chip drivers might exist (especially out-of-tree) and
those should win the bidding even if they use BUS_PROBE_DEFAULT.
2017-08-12 17:39:32 +00:00
Warner Losh 9208cbbd0e arm*hf is no longer a thing, remove it from the conversion now that it's easy.
Submitted by: andyt@
2017-08-12 17:07:32 +00:00
Warner Losh 7709b2ae16 Make _TO_CPUARCH macro for ARCH to CPUARCH conversions
Consolidate all the regular expressions to convert from MACHINE_ARCH
to MACHINE_CPUARCH into a variable and use that variable in preference
to the almost identical copies in the tree (which should have been
identical).

Differential Revision: https://reviews.freebsd.org/D11986
2017-08-12 17:07:27 +00:00
Sevan Janiyan b9c0f39213 Set usage() to show -d flag
mkesdb supports the -d flag for enabling debug mode, as documented in the manual.

PR:		209865
Submitted by:	Maya Rashish <coypu AT sdf DOT org>
Reviewed by:	imp
Approved by:	bcr (mentor)
Obtained from:	NetBSD
MFC after:	7 days
Differential Revision:	https://reviews.freebsd.org/D11987
2017-08-12 15:51:46 +00:00
Konstantin Belousov 25b73e6327 Improve standard compliance for memset_s() and abort_handler_s().
abort_handler_s() currently simply calls abort(), though the standard
specifies more: "Writes an implementation-defined message to stderr
which must include the string pointed to by msg and calls abort()."

memset_s() is missing error condition "n > smax", and does not invoke
the constraint handler after filling the buffer: "following errors are
detected at runtime and call the currently installed constraint
handler function after storing ch in every location of the destination
range [dest, dest+destsz) if dest and destsz are themselves valid",
one of the errors is "n > smax" itself.

Submitted by:	Yuri Pankov <yuripv@gmx.com>
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D11991
2017-08-12 15:18:17 +00:00
Konstantin Belousov 6fe9e5b821 Fix indent.
Submitted by:	Yuri Pankov <yuripv@gmx.com>
MFC after:	3 days
2017-08-12 14:58:09 +00:00
Navdeep Parhar 5d973bad2a cxgbe(4): Save the last reported link parameters and compare them with
the current state to determine whether to generate a link-state change
notification.  This fixes a bug introduced in r321063 that caused the
driver to sometimes skip these notifications.

Reported by:	Jason Eggleston @ LLNW
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-08-12 14:02:19 +00:00
Sevan Janiyan b6687401d6 Correct the -H longopt equivillant
PR:		209876
Submitted by:	<kdrakehp AT zoho DOT com>
Approved by:	bcr (mentor)
Differential Revision:	https://reviews.freebsd.org/D11988
2017-08-12 12:17:38 +00:00
John Baldwin 319e8f3e36 Fix a typo. 2017-08-11 22:47:32 +00:00
Ryan Libby 9afac9fed9 lib/msun: avoid referring to broken LDBL_MAX
LDBL_MAX is broken on i386:
https://lists.freebsd.org/pipermail/freebsd-numerics/2012-September/000288.html

Gcc has produced +Infinity for LDBL_MAX on i386 and amd64 with -m32
for some time, and newer versions of gcc are now warning that the
"floating constant exceeds range of 'long double'".  Avoid this by
referring to half the value of LDBL_MAX instead.

Reviewed by:	bde
Approved by:	markj (mentor)
Sponsored by:	Dell EMC Isilon
2017-08-11 22:41:24 +00:00
Bjoern Heidotting b820ef458d add myself to calendar.freebsd
Requested by:	mckusick
2017-08-11 20:44:17 +00:00
Ed Maste 056dd75b27 lldb: enable on i386
It is functional on FreeBSD/i386 as of r322326.

Sponsored by:	The FreeBSD Foundation
2017-08-11 20:11:43 +00:00
Ed Maste 67d4951ddf arm: enable ARM_MANY_BOARD in NOTES for LINT build
Added in r238189, ARM_MANY_BOARD adds support for multiple ARM boards in
a single kernel. Include it for LINT builds to avoid duplicate symbol
errors when linking with lld.

Sponsored by:	The FreeBSD Foundation
2017-08-11 19:49:29 +00:00
Mark Johnston d055a46cda Bump KERNELDUMP_BUFFER_SIZE to 4096.
The encrypted kernel dump code writes data in blocks of this size. A buffer
size of 4096 allows encrypted dumps to work with 4Kn drives.

Reviewed by:	cem
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D11870
2017-08-11 19:24:08 +00:00
Glen Barber ebd2eeb3f8 Add SVNVERSION_CMD to bsd.own.mk, adding the capability to include
svnversion metadata to the runtime and kernel packages.

Instead of traversing src/sys, as is done by newvers.sh for uname(1),
a full tree walk is done to prevent userland and/or modifications
from not being reflected in a modified tree (M).

MFC after:	5 days
Sponsored by:	The FreeBSD Foundation
2017-08-11 19:21:40 +00:00
Ian Lepore c82d887d47 Stop calling atrtc_set() from the xen timer clock_settime() method. That
removes the only reference to atrtc_set() from outside of atrtc.c, so make
it static.

The xen timer driver registers as a realtime clock with 1us resolution.  In
the past that resulted in only the xen timer's clock_settime() getting
called, so it would call atrtc_set() to set the hardware clock as well.  As
of r32090, the clock_settime() method of all registered realtime clocks gets
called, so the xen driver no longer needs to chain-call the lower-resolution
driver.

Thanks to royger@ for talking me through the xen stuff, and for testing.
2017-08-11 19:02:11 +00:00
Kenneth D. Merry 74a90ba38a Add historical notes on QIC tape drives and fix a couple of issues in mt(1).
o Density code 0x5 is also known as QIC-11, and should have a footnote
   reference.
 o Add notes on QIC tape drives from the bug report.  These may help anyone
   trying to use a QIC drive.
 o Take out a "more more" instance found by igor.
 o Bump the man page date.

The PR is 14 years old, so it's past time to retire it.

PR:		doc/53596
Submitted by:	tedm@toybox.placo.com
Reviewed by:	bcr
Sponsored by:	Spectra Logic
2017-08-11 18:43:52 +00:00
Ed Maste 9432a9bd9f Rename at91_pmc's M_PMC malloc type to avoid duplicate definition
M_PMC is defined in sys/dev/hwpmc/hwpmc_mod.c, and the LINT kernel build
fails when linking with lld due to a duplicate symbol error.

Sponsored by:	The FreeBSD Foundation
2017-08-11 18:09:26 +00:00
David C Somayajulu 45f1312387 Performance enhancements to reduce CPU utililization for large number of
TCP connections (order of tens of thousands), with predominantly Transmits.

Choice to perform receive operations either in IThread or Taskqueue Thread.

Submitted by:Vaishali.Kulkarni@cavium.com
MFC after:5 days
2017-08-11 17:43:25 +00:00
Ryan Libby 9de5f67de2 x86/crc32_sse42.c: quiet unused function warning
Reviewed by:	cem
Approved by:	markj (mentor)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D11980
2017-08-11 17:05:31 +00:00
Mark Johnston af0460beda Have sendfile_swapin() use vm_page_grab_pages().
Reviewed by:	alc, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D11942
2017-08-11 16:32:24 +00:00
Mark Johnston 9df950b35d Modify vm_page_grab_pages() to handle VM_ALLOC_NOWAIT.
This will allow its use in sendfile_swapin().

Reviewed by:	alc, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D11942
2017-08-11 16:29:22 +00:00
Alan Cox 6921451dab An invalid page can't be dirty.
Reviewed by:	kib
MFC after:	1 week
2017-08-11 16:27:54 +00:00
Roger Pau Monné c642d2f5b5 acpi/srat: fix build without DMAP
Use pmap_mapbios to map memory used to store the cpus array.

Reported by:	lwhsu
X-MFC-with:	r322348
2017-08-11 14:19:55 +00:00
Glen Barber 1866d42eec Fix indentation from r322401.
MFC after:	3 days
MFC with:	r322401
Sponsored by:	The FreeBSD Foundation
2017-08-11 14:19:31 +00:00
Glen Barber 33f8570d0c Avoid creating kernel-dbg.txz distribution sets and kernel-debug
packages when MK_DEBUG_FILES is 'no'.

MFC after:	5 days
Sponsored by:	The FreeBSD Foundation
2017-08-11 14:18:11 +00:00
Andrew Turner a92a2f00b1 Only return the current cpu if it's in the cpumask. When we restrict the
cpumask it probably means we are unable to sent interrupts to CPUs outside
the map. As such only return the current CPU when it's within the mask
otherwise return the first valid CPU.

This is needed on ThunderX as, in a dual socket configuration, we are
unable to send MSI/MSI-X interrupts between sockets.

Reviewed by:	mmel
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D11957
2017-08-11 12:45:58 +00:00
Hans Petter Selasky ebf854802d Make sure the "vm_flags" and "vm_page_prot" fields get set correctly
in the VM area structure in the LinuxKPI when doing mmap() and that
unsupported bits are masked away.

While at it fix some redundant use of parenthesing inside some related
macros.

Found by:	KrishnamRaju ErapaRaju <Krishna2@chelsio.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2017-08-11 10:44:40 +00:00
Mark Johnston 0b7bd01a82 Add a specialized function for DRM drivers to register themselves.
Such drivers attach to a vgapci bus rather than directly to a pci bus. For
the rest of the LinuxKPI to work correctly in this case, we override the
vgapci bus' ivars with those of the grandparent.

Reviewed by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11932
2017-08-11 03:59:48 +00:00
Mark Johnston 7e05ffa6e6 Micro-optimize kmem_unback().
We can remove some unnecessary object radix tree lookups by using the
object memq to iterate over pages in the specified range. This does not,
however, eliminate the lookup needed in vm_page_free_toq() to remove each
tree entry.

Reviewed by:	alc, kib (previous revision)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D11945
2017-08-11 03:09:11 +00:00
Peter Wemm ee51cfe17c Update from sqlite3-3.14.1 to sqlite3-3.20.0. This is a private lib.
This fixes a possible client-side crash when parsing corrupt databases.
2017-08-11 00:00:01 +00:00
Mark Johnston 2c642ec1e7 Make vm_page_sunbusy() assert that the page is unlocked.
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D11946
2017-08-10 22:43:38 +00:00
Peter Wemm bc3684a0e4 Import sqlite3-3.20.0 2017-08-10 22:15:42 +00:00
Peter Wemm 081baee06a Update subversion 1.9.5 -> 1.9.7
This includes a client-side fix for CVE-2017-9800.
2017-08-10 22:03:26 +00:00