Commit Graph

222794 Commits

Author SHA1 Message Date
Dimitry Andric
0f5676f432 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302418, and update
build glue.
2017-05-08 19:20:55 +00:00
Dimitry Andric
fbe69f787a Vendor import of lld trunk r302418:
https://llvm.org/svn/llvm-project/lld/trunk@302418
2017-05-08 17:13:44 +00:00
Dimitry Andric
733153a0fb Vendor import of libc++ trunk r302418:
https://llvm.org/svn/llvm-project/libcxx/trunk@302418
2017-05-08 17:13:34 +00:00
Dimitry Andric
2109e2e418 Vendor import of compiler-rt trunk r302418:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@302418
2017-05-08 17:13:22 +00:00
Dimitry Andric
0a5fb09b59 Vendor import of clang trunk r302418:
https://llvm.org/svn/llvm-project/cfe/trunk@302418
2017-05-08 17:13:11 +00:00
Dimitry Andric
c46e6a5940 Vendor import of llvm trunk r302418:
https://llvm.org/svn/llvm-project/llvm/trunk@302418
2017-05-08 17:12:57 +00:00
Dimitry Andric
7d9e99b671 Regenerate llvm's config.h file. 2017-05-05 20:45:55 +00:00
Dimitry Andric
be27b31162 Merge ^/head r317503 through r317807. 2017-05-04 21:30:26 +00:00
Dimitry Andric
b174acef4c Some more files in libllvm moved around. These only apply for WITH_CLANG_EXTRAS. 2017-05-04 21:04:38 +00:00
Gleb Smirnoff
93ed1e805b The nandsim(4) simulator driver doesn't have any protection against
races at least in its ioctl handler, and at the same time it creates
device entry with 0666 permissions.

To plug possible issues in it:
- Mark it as needing Giant.
- Switch device mode to 0600.

Submitted by:	C Turt
Reviewed by:	imp
MFC after:	1 week
Security:	Possible double free in ioctl handler
2017-05-04 20:42:31 +00:00
Edward Tomasz Napierala
d4acedbc64 Revert r317804; apparently I forgot the auto_master syntax.
MFC after:	2 weeks
2017-05-04 19:55:32 +00:00
Edward Tomasz Napierala
1638f1d3e4 Make automount(8) error out when the map name is missing.
MFC after:	2 weeks
2017-05-04 19:41:19 +00:00
Edward Tomasz Napierala
1f1abc7882 Enable automounting of exFAT media.
With fstyp(8) being updated to detect exfat in base r312003, it seems
like a good time to add support for auto-mounting SDXC cards -- which
use exfat by default.

The user will need to locally compile and install sysutils/fusefs-exfat
for this to succeed; logs a message to that effect when not installed.

PR:		218743
Submitted by:	eborisch+FreeBSD@gmail.com
MFC after:	2 weeks
2017-05-04 19:16:36 +00:00
Kurt Lidl
40935b566b Merge latest version of blacklist sources from NetBSD (@ 20170503)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2017-05-04 19:07:37 +00:00
Edward Tomasz Napierala
4b89eed669 Fix markup in gettytab(5).
Reviewed by:	bapt
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10476
2017-05-04 19:01:17 +00:00
Luiz Otavio O Souza
cd39450155 Add support for the no-1-8-v and wp-inverted properties in generic SDHCI
FDT glue.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC (Netgate)
2017-05-04 18:56:11 +00:00
Kenneth D. Merry
6da3b2f7f0 Add the SCSI Solid State Media Log page (0x11) definition.
sys/cam/scsi/scsi_all.h:
	Add the SCSI Solid State Media log page (0x11) structure
	definition.  This gives the percentage used (in terms of
	lifetime flash wear) of an SSD.

MFC after:	3 days
Sponsored by:	Spectra Logic
2017-05-04 17:23:39 +00:00
Sean Bruno
00c230410f bnxt: Add support for new Broadcom 100Gb adapter BCM57454
Submitted by:	bhargava.marreddy@broadcom.com
Reviewed by:	venkatkumar.duvvuru@broadcom.com
Differential Revision:	https://reviews.freebsd.org/D10595
2017-05-04 15:26:28 +00:00
Konstantin Belousov
dddb157699 Avoid wrapping of the machine-dependent type sizes table, by removing
non-informational sizeof() expressions.  Add some explanatory and
summary sentences.

Noted by:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2017-05-04 11:57:52 +00:00
Michael Tuexen
ed466c3404 Add support for socket option names related to the level IPPROTO_UDPLITE. 2017-05-04 07:44:07 +00:00
Sepherosa Ziehau
c23a0b35c1 pcicfg: Fix direct calls of pci_cfg{read,write} on systems w/o PCI host bridge.
Reported by:	dexuan@
Reviewed by:	jhb@
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision: https://reviews.freebsd.org/D10564
2017-05-04 05:28:46 +00:00
Toomas Soome
f6bd3d520f zfsboot: drvsize() may be unusable on some systems
From user report, the errors are seen:
error 1
error 1
gptzfsboot: error 1 lba 4294967288
gptzfsboot: error 1 lba 1
gptzfsboot: no ZFS pools located, can't boot

The first two errors above are from issuing INT13 EAX=0x4800, meaning we
need to check if EDD is available and use EAX=0x800 if not.

For an workaround I'm using the similar idea as in biosdisk.c - first probe
ah=8h, then check if we have EDD.

Note we would like to see the correct disk size info, but we *may*
get away with anything >64MB, so we could at least test 2 zfs pool labels
on whole disk setup and not to freak out the INT13 interface.

If we get away with initial disk probing, then we have partition sizes from
the partition table and we should be able to complete the disk probing.

Note: this update does not provide full fix to all errors, but we get
the drvsize() errors removed.

Reported by:	Michael W. Lucas
Reviewed by:	julian
Differential Revision:	https://reviews.freebsd.org/D10591
2017-05-04 05:26:37 +00:00
Mateusz Guzik
8066a14a3c cache: stop holding the ncneg_hot lock across purging
Only non-hot entries are purged so the lock is not needed in the first place.
This saves one lock/unlock pair.

MFC after:	1 week
2017-05-04 03:11:59 +00:00
Sepherosa Ziehau
c321779676 hyperv/kvp: Fix pool direcrory and file permission
PR:		209385
MFC after:	2 weeks
Sponsored by:	Microsoft
2017-05-04 01:46:04 +00:00
Martin Matuska
a8fc61d51a MFV r317781:
Sync libarchive with vendor

Vendor changes (FreeBSD-related):
  PR 897: add test for ZIP archives with invalid EOCD headers
  PR 901: fix invalid renaming of sparse files
  OSS-Fuzz issue 497: remove fallback tree in LZX decoder
  OSS-Fuzz issue 527: rewrite expressions in lz4 filter
  OSS-Fuzz issue 577: fix integer overflow in cpio reader
  OSS-Fuzz issue 862: fix numerc parsing in mtree reader
  OSS-Fuzz issue 1097: fix undefined shift in rar reader
  cpio: various optimizations and memory leak fixes

MFC after:	1 week
2017-05-04 00:04:17 +00:00
Martin Matuska
87a07d9d6c Update vendor/libarchive to git c253f0aae9ac86a617b4f814137e07757df72391
Vendor changes (FreeBSD-related):
  PR 897: test for ZIP archives with invalid EOCD headers
  PR 901: fix invalid renaming of sparse files
  OSS-Fuzz issue 497: remove fallback tree in LZX decoder
  OSS-Fuzz issue 527: rewrite expressions in lz4 filter
  OSS-Fuzz issue 577: fix integer overflow in cpio reader
  OSS-Fuzz issue 862: fix numerc parsing in mtree reader
  OSS-Fuzz issue 1097: fix undefined shift in rar reader
  cpio: various optimizations and memory leak fixes
2017-05-03 23:55:12 +00:00
Pedro F. Giffuni
34f4388801 ext2fs: add read-write support for Extended Attributes.
Extended attributes and their particular implementation in linux are
different from FreeBSD so in this case we have started diverging from
the  UFS EA implementation, which would be the natural reference.

Depending on future progress implementing ACLs this approach may change
but for now bring to the tree an implementation that is consistent and
can be tested.

Submitted by:	Fedor Uporov

Differential Revision:	https://reviews.freebsd.org/D10460
2017-05-03 22:35:41 +00:00
Dimitry Andric
f37b6182a5 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).
2017-05-03 21:54:55 +00:00
Gleb Smirnoff
5c3ec67603 Improve documentation of fbuf device.
Submitted by:	novel
Reviewed by:	grehan, bcr
Differential Revision:	https://reviews.freebsd.org/D10014
2017-05-03 21:44:04 +00:00
Kenneth D. Merry
aefae9c7bb Bump the camcontrol(8) man page date.
MFC after:	3 days
X-MFC-with:	r317774
Sponsored by:	Spectra Logic
2017-05-03 21:04:32 +00:00
Kenneth D. Merry
6953d22b15 Fix error recovery behavior in the pass(4) driver.
After FreeBSD SVN revision 236814, the pass(4) driver changed from
only doing error recovery when the CAM_PASS_ERR_RECOVER flag was
set on a CCB to sometimes doing error recovery if the passed in
retry count was non-zero.

Error recovery would happen if two conditions were met:

1.  The error recovery action was simply a retry.  (Which is most
    cases.)
2.  The retry_count is non-zero. (Which happened a lot because of
    cut-and-pasted code.)

This explains a bug I noticed in with camcontrol:

# camcontrol tur da34 -v
Unit is ready
# camcontrol reset da34
Reset of 1:172:0 was successful

At this point, there should be a Unit Attention:

# camcontrol tur da34 -v
Unit is ready

No Unit Attention.

Try it again:

# camcontrol reset da34
Reset of 1:172:0 was successful

Now set the retry_count to 0 for the TUR:

# camcontrol tur da34 -v -C 0
Unit is not ready
(pass42:mps1:0:172:0): TEST UNIT READY. CDB: 00 00 00 00 00 00
(pass42:mps1:0:172:0): CAM status: SCSI Status Error
(pass42:mps1:0:172:0): SCSI status: Check Condition
(pass42:mps1:0:172:0): SCSI sense: UNIT ATTENTION asc:29,2 (SCSI bus reset occurred)
(pass42:mps1:0:172:0): Field Replaceable Unit: 2

There is the unit attention. camcontrol(8) has a default
retry_count of 1, in case someone sets the -E flag without
setting -C.

The CAM_PASS_ERR_RECOVER behavior was only broken with the
CAMIOCOMMAND ioctl, which is the synchronous pass(4) API.  It has
worked as intended (error recovery is only done when the flag
is set) in the asynchronous API (CAMIOQUEUE ioctl).

sys/cam/scsi/scsi_pass.c:
	In passsendccb(), when calling cam_periph_runccb(), only
	specify the error routine when CAM_PASS_ERR_RECOVER is set.

share/man/man4/pass.4:
	Document that CAM_PASS_ERR_RECOVER is needed to enable
	error recovery.

Reported by:	Terry Kennedy <TERRY@glaver.org>
PR:		kern/218572
MFC after:	1 week
Sponsored by:	Spectra Logic
2017-05-03 20:59:47 +00:00
Kenneth D. Merry
36d0fa44e2 Add the ability to rescan or reset devices specified by peripheral
name and unit number in camcontrol(8).

Previously camcontrol(8) only supported rescanning or resetting
devices specified by bus:target:lun.  This is because for
rescanning at least, you don't have a peripheral name and unit
number (e.g. da4) for devices that don't exist yet.

That is still the case after this change, but in other cases, when
the device does exist in the CAM EDT (Existing Device Table), we
do a careful lookup of the bus/target/lun if the user supplies a
peripheral name and unit number to find the bus:target:lun and then
issue the requested reset or rescan.

The lookup is done without actually opening the device in question,
since a rescan is often done to make a device go away after it has
been pulled.  (This is especially true for busses/controllers, like
parallel SCSI controllers, that don't automatically detect changes
in topology.)  Opening a device that is no longer there to
determine the bus/target/lun might result in error recovery actions
when the user really just wanted to make the device go away.

sbin/camcontrol/camcontrol.c:
	In dorescan_or_reset(), if the use hasn't specified a
	numeric argument, assume he has specified a device.  Lookup
	the pass(4) instance for that device using the transport
	layer CAMGETPASSTHRU ioctl.  If that is successful, we can
	use the returned bus:target:lun to rescan or reset the
	device.

	Under the hood, resetting a device using XPT_RESET_DEV is
	actually sent via the pass(4) device anyway.  But this
	provides a way for the user to specify devices in a more
	convenient way, and can work on device rescans when the
	device is going away, assuming it still exists in the EDT.

sbin/camcontrol/camcontrol.8:
	Update the man page for the rescan and reset subcommands
	to reflect that you can now use a device name and unit
	number with them.

Sponsored by:	Spectra Logic
MFC after:	3 days
2017-05-03 20:57:52 +00:00
Kristof Provost
64c79ee733 pf: Fix panic on unload
vnet_pf_uninit() is called through vnet_deregister_sysuninit() and
linker_file_unload() when the pf module is unloaded. This is executed
after pf_unload() so we end up trying to take locks which have been
destroyed already.

Move pf_unload() to a separate SYSUNINIT() to ensure it's called after
all the vnet_pf_uninit() calls.

Differential Revision:	https://reviews.freebsd.org/D10025
2017-05-03 20:56:54 +00:00
Vladimir Kondratyev
aa556702bc Add myself (wulf) as a src committer with gonzo and bapt as my mentors.
Approved by:	gonzo (mentor)
2017-05-03 20:56:34 +00:00
Poul-Henning Kamp
67c9f60e86 Flush stdout before yes/no confirmations, to force question
through pipes/tee(1)/whatever
2017-05-03 20:41:26 +00:00
Dimitry Andric
52fd8de56a Vendor import of lldb trunk r302069:
https://llvm.org/svn/llvm-project/lldb/trunk@302069
2017-05-03 20:26:55 +00:00
Dimitry Andric
d803cda429 Vendor import of lld trunk r302069:
https://llvm.org/svn/llvm-project/lld/trunk@302069
2017-05-03 20:26:46 +00:00
Dimitry Andric
285f392c55 Vendor import of compiler-rt trunk r302069:
https://llvm.org/svn/llvm-project/compiler-rt/trunk@302069
2017-05-03 20:26:31 +00:00
Dimitry Andric
f0c0337bbf Vendor import of clang trunk r302069:
https://llvm.org/svn/llvm-project/cfe/trunk@302069
2017-05-03 20:26:23 +00:00
Dimitry Andric
148779df30 Vendor import of llvm trunk r302069:
https://llvm.org/svn/llvm-project/llvm/trunk@302069
2017-05-03 20:26:11 +00:00
Alan Somers
b583a2c10d Fix memory leaks in camcontrol
Reported by:	Coverity
CID:		1331674, 1331675
Reviewed by:	ken
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D10588
2017-05-03 19:56:55 +00:00
Alan Somers
f24faa98dc Unbreak ifconfig for mlx4en(4) after r317755
ifconfig doesn't correctly infer mlx interfaces' module names, so it will
attempt to load the mlx(4) module even when not necessary.

Reported by:	rstone
MFC after:	3 weeks
X-MFC-With:	317755
Sponsored by:	Spectra Logic Corp
2017-05-03 19:53:01 +00:00
Conrad Meyer
9ac9bc28bb cpuset.2: Document new API options
A follow-up to r317756.  Adrian will chase up the userspace cpuset(1)
additions.

Reported by:	kib@
Sponsored by:	Dell EMC Isilon
2017-05-03 18:46:33 +00:00
Conrad Meyer
29dfb631d8 Extend cpuset_get/setaffinity() APIs
Add IRQ placement-only and ithread-only API variants. intr_event_bind
has been extended with sibling methods, as it has many more callsites in
existing code.

Reviewed by:	kib@, adrian@ (earlier version)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D10586
2017-05-03 18:41:08 +00:00
Alan Somers
6223cc336e Various Coverity fixes in ifconfig(8)
* Exit early if kldload(2) fails (1011259). This is the only change that
  affects ifconfig's behavior.
* Close memory and resource leaks (1305624, 1305205, 1007100)
* Mark usage() as _Noreturn (1305806, 1305750)
* Fix some dereference after null checks (1011474, 270774)

Reported by:	Coverity
CID:		1305624, 1305205, 1007100, 1305806, 1305750, 1011474,
CID:		270774, 1011259
Reviewed by:	cem
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D10587
2017-05-03 17:21:01 +00:00
John Baldwin
4dd67957a8 Replace 'riscv' with the RISC-V targets 'riscv64' and 'riscv64sf'. 2017-05-03 16:55:02 +00:00
Conrad Meyer
1365421f09 glob: Fix an overlong line
Trivial style(9) fix, no functional change.  There are also some 81
characters lines below, but I don't see a good way to shorten them.

Sponsored by:	Dell EMC Isilon
2017-05-03 16:34:22 +00:00
Alexander Motin
31da007f7e Fix typo in r317659.
MFC after:	2 weeks
2017-05-03 16:34:03 +00:00
Dimitry Andric
cddf3eadbd Pull in r301983 from upstream llvm trunk (by Tim Northover):
ARM: avoid handing a deleted node back to TableGen during ISel.

  When we replaced the multiplicand the destination node might already
  exist. When that happens the original gets CSEd and deleted. However,
  it's actually used as the offset so nonsense is produced.

  Should fix PR32726.

This fixes an assertion failure when building building www/firefox 53.0
for arm.

Reported by:	Bob Prohaska
PR:		218782
MFC after:	3 days
2017-05-03 16:12:43 +00:00
Michael Tuexen
c0b72375d8 Add support for sctp_generic_sendmsg() and sctp_generic_recvmsg(). 2017-05-03 16:03:33 +00:00