Commit Graph

215470 Commits

Author SHA1 Message Date
Toomas Soome
c531ca710b bd_int13probe() should check extended info if sector info is bad
In some Dell systems and usb stick combinations, it is found that
int13 AH=08 is reporting back bad sector information, preventing the
boot.

This update is allowing bd_int13probe() to use extended info call to
build disk properties.

It also can happen the total sectors count from extended info may be
wrong, in such case, the CHS data is used to calculate total sectors.

Reviewed by:	allanjude
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D7718
2016-09-01 06:35:13 +00:00
Sepherosa Ziehau
f320cbed5a net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1.
Reviewed by:	araujo, hps
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7710
2016-09-01 06:32:35 +00:00
Sepherosa Ziehau
fc4a9fc4c0 hyperv/hn: Stringent per-packet-info verification.
While I'm here, minor style changes.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7709
2016-09-01 06:05:08 +00:00
Sepherosa Ziehau
6f67f21938 net/rndis: Define per-packet-info for RNDIS packet message
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7708
2016-09-01 05:40:13 +00:00
Sepherosa Ziehau
2c2e52605f hyperv/hn: Remove unused function
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7706
2016-09-01 05:29:58 +00:00
Sepherosa Ziehau
947175ca10 net/rndis: Add comment for rndis_set_parameter
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7705
2016-09-01 05:15:04 +00:00
Ed Maste
dd38731e09 allow kern.proc.nfds sysctl in capability mode
Reviewed by:	allanjude
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7733
2016-09-01 02:51:50 +00:00
Enji Cooper
eab5e7a376 Don't bake all of CC/CPP/CXX into CFLAGS
Capture executable names for CC, CPP, CXX (assumed to be the
first non-CCACHE_BIN word).

This change strips out all of the cross-compiler arguments, (-target,
-B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it
doesn't infect the build and subsequently the test.

Add comments noting why this logic is being added, and why the logic in
r305041 was necessary/what it was trying to achieve.

This is required after recent changes made to the toolchain to always
specify --sysroot, -target, -B, etc with clang in buildworld (presumably
r304681).

Reviewed by:	rodrigc (earlier version)
Reported by:	Jenkins (FreeBSD_HEAD job from 559+)
MFC after:	12 days
X-MFC with:	r304681, r305041
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D7732
2016-09-01 02:42:11 +00:00
Patrick Kelsey
da2ded6575 _taskqueue_start_threads() now fails if it doesn't actually start any threads.
Reviewed by:	jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D7701
2016-09-01 02:05:46 +00:00
Eric Joyner
ff9b61ca07 Fix linker warnings (errors on gcc) that resulted from r304510.
The variables that are extern in the netmap header file should be
defined in ixl_txrx.c (the file that is included in both ixl(4)/ixlv(4),
not in the main driver source files.

Reported by:	ed@, dim@, ngie@
2016-09-01 01:08:18 +00:00
Navdeep Parhar
a9feb2cdbb cxgbe/t4_tom: Two new routines to allocate and write page pods for a
buffer in the kernel's address space.
2016-09-01 00:51:59 +00:00
Navdeep Parhar
968267fdb8 cxgbe/t4_tom: Add general purpose routines to deal with page pod regions
and allocations within them.  Switch to these routines to manage the TOE
DDP region.

Sponsored by:	Chelsio Communications
2016-08-31 23:23:46 +00:00
Mark Johnston
99ab95db4d Rename unp_dispose_so() to unp_dispose().
It implements the dom_dispose method for local socket domain, so its name
should match the method name.
2016-08-31 21:48:22 +00:00
Ed Maste
5462b0052b Set UEFI boot loader PE/COFF timestamps to known value for reproducible builds
Reviewed by:	rpokala
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7633
2016-08-31 21:35:38 +00:00
Ed Maste
d74808dd1a users: don't build when we don't have a C++ toolchain
(On RISC-V MK_CXX is in BROKEN_OPTIONS, so users remains skipped there.)

Reviewed by:	bdrewery
Differential Revision:	https://reviews.freebsd.org/D7725
2016-08-31 21:12:50 +00:00
Ed Maste
d0bd2dad6f readelf: silence GCC 4.2.1 uninitialized variable warning
Sponsored by:	The FreeBSD Foundation
2016-08-31 21:04:58 +00:00
Jilles Tjoelker
89688ae708 directory(3): Deprecate readdir_r(). Clarify dirent buffers.
In existing implementations including FreeBSD, there is no reason to use
readdir_r() in the common case where potentially multiple threads each list
their own directory. Code using readdir() is simpler.

What's more, lthough readdir_r() can safely be used on FreeBSD because
NAME_MAX is forced to 255, it cannot be used safely on systems where
{NAME_MAX} is not fixed. As a concrete example, FAT/NTFS filenames can be up
to 255 UTF-16 code units long, which can be up to 765 UTF-8 bytes.

Deprecating readdir_r() in POSIX has been proposed in
http://www.austingroupbugs.net/view.php?id=696
and glibc wants to deprecate it as well.

Reviewed by:	ed, wblock
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D7678
2016-08-31 20:38:40 +00:00
Luiz Otavio O Souza
4b360eca4a All the TI platforms are FDT based and it is not necessary to enumerate
the hinted children (there wont be any).

Spotted by:	gonzo
2016-08-31 19:37:10 +00:00
Bryan Drewery
1eb4ec9c62 DIRDEPS_BUILD: Add some missing dirctories to the build.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:59 +00:00
Bryan Drewery
9e2f435fc1 Add a 'make print-dir' that simply traverses all directories and prints them.
This is useful for finding connected directories.

MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:52 +00:00
Bryan Drewery
776d5e11e9 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:46 +00:00
Bryan Drewery
790ba09ec6 DIRDEPS_BUILD: Avoid cyclic dependency with libc++.
The DIRDEPS_BUILD does not have a 'make includes' phase, so it would
otherwise want libc++ to be fully built/staged before building
libgcc.  Using the header directly works.

MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:00 +00:00
Andrey A. Chernov
e1ec67bbc9 'addrlen' does not matter when we need to find the first non-zero bit in
the byte from the left and 'addrlen' already counted in 'lim'.

PR:     212121
Submitted by:   Herbie.Robinson@stratus.com
MFC after:      7 days
2016-08-31 18:49:50 +00:00
Ed Maste
bce38b9f35 Regnerate after r305140, getdtablesize in capability mode
Sponsored by:	The FreeBSD Foundation
2016-08-31 18:37:51 +00:00
Luiz Otavio O Souza
eff30e9149 Fix the build.
Works better when the file with the #define is actually included...
2016-08-31 18:35:41 +00:00
Ed Maste
ca380195ab Allow getdtablesize in capability mode
getdtablesize is "trivial global state" and is similar to
getrlimit(RLIMIT_NOFILE), so should be permitted in capability mode.

Reviewed by:	oshogbo
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7719
2016-08-31 18:33:15 +00:00
Conrad Meyer
246ef54f15 df(1): Allow duplicate -l flags gracefully
Rather than producing a misleading error message when duplicate -l flags are
provided to df(1), simply ignore extra flags and proceed as if only one was
specified.  This seems most reasonable given the usage for -l:

     -l      Only display information about locally-mounted file systems.

l and t flags still conflict, as before.

PR:		208169
Reported by:	by at reorigin.com
Reviewed by:	allanjude
2016-08-31 18:10:41 +00:00
Allan Jude
61bd7ae0ec Eliminate unnecessary loop in _cap_check()
Calling cap_rights_contains() several times with the same inputs is not
going to produce a different output. The variable being iterated, i, is
never used inside the for loop.

The loop is actually done in cap_rights_contains()

Submitted by:	Ryan Moeller <ryan@freqlabs.com>
Reviewed by:	oshogbo, ed
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D7369
2016-08-31 17:52:11 +00:00
Jared McNeill
cc14fb4c2e Add Allwinner A64 (sun50i) and Pine64 dts files.
Reviewed by:		andrew, imp, manu, wca
Differential Revision:	https://reviews.freebsd.org/D7169
2016-08-31 16:56:54 +00:00
Andrey A. Chernov
af98aa6e21 Apply the same qsort() usage fix as in r304911 getaddrinfo.c
qsort() can't be stabilized with just return(-1) alone.

MFC after:      3 days
2016-08-31 15:47:58 +00:00
Warner Losh
32286efee1 Remove accidentally committed stray comment.
Noticed by: dteske@
2016-08-31 15:32:52 +00:00
Ed Maste
b6d812d2dd Update to ELF Tool Chain r3490
Improvements include:
 * readelf: report all relocation types in rel/rela for MIPS N64
 * readelf: add ELFOSABI_ARM_AEABI
 * elfdump: add ELFOSABI_ARM_AEABI and ELFOSABI_ARM
 * Add recent RISC-V relocations
 * elfcopy: use elftc_timestamp, to support SOURCE_DATE_EPOCH

Sponsored by:	The FreeBSD Foundation
2016-08-31 15:05:04 +00:00
Konstantin Belousov
9815066425 Make swapoff reliable.
The swap_pager_swapoff() function uses trylock for the object lock
before pagein, which means that either i/o to md(4) over swap, or
intensive page faults over swap pager objects might prevent swapoff()
from making any progress. Then the retry < 100 check fails and machine
panics.

If trylock fails, acquire the object lock in the blockable way and
restart the hash bucket walk.  Keep retries logic for now.

Reported and tested by:	pho
Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D7688
2016-08-31 14:49:58 +00:00
Andrew Turner
d953ec3222 Also handle instruction traps. We might hit these when the page we are
executing is being promoted to a superpage.

Obtained from:	ABT Systems Ltd
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-08-31 13:58:32 +00:00
Ed Maste
665a3a9a79 Import ELF Tool Chain snapshot at revision 3490
From http://svn.code.sf.net/p/elftoolchain/code/
2016-08-31 13:50:23 +00:00
Baptiste Daroussin
6a695123b0 Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi
Add a new 'netproto' variable which can be set for now to
NET_TFTP or NET_NFS (default to NET_NONE)

From the dhcp options if one sets the root-path option to:
"ip:path", the loader will consider it is booting over NFS
(meaning same behaviour as the default current behaviour)

if the dhcp option "tftp server address" is set (option 150)
the loader will consider it is booting over tftpfs, it will then
consider the root-path options with 2 possible case
1. "path" then the IP of the tftp server will be the one passed by
the option 150, and the files will be retrieved under "path" on the tftp
server
2. "ip:path" then the IP of the tftp server will be the one passed in
the option "overwritting the IP from the option 150.

We could not "abuse" the rootpath option in the form or tftp://ip:path because
this is already used for other purpose by iPXE preventing any chainload from
iPXE to the FreeBSD loader.

Given at each open(), the loader loops over all available filesystems and keep
the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa.
the tftpfs and nfs implementation in libstand now return EINVAL early if
'netproto' for that purpose.

Reviewed by:	tsoome
Relnotes:	yes
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D7628
2016-08-31 13:16:40 +00:00
Mateusz Guzik
44feca2360 fd: effectively revert r305091
Turns out fd_lastfile can survive being -1 for some processes, giving
incorrect results with the cast.

Noted by: cem
2016-08-31 12:29:04 +00:00
Alexander Motin
9007a8679a Fix kernel panic when inheriting properties without default.
There are two writable hidden properties "iscsioptions" and "stmf_sbd_lu",
that have no default string value.  Attempt to unset them or replicate
caused kernel panic.  This simple bandaid seems fixes the problem nicely.

MFC after:	2 weeks
2016-08-31 11:55:31 +00:00
Andrey V. Elsukov
0c127808dd Remove redundant sanity checks from ipsec[46]_common_input_cb().
This check already has been done in the each protocol callback.
2016-08-31 11:51:52 +00:00
Bruce Evans
a95582c6fd Add some locking to sc_cngetc().
Keyboard input needs Giant locking, and that is not possible to do
correctly here.  Use mtx_trylock() and proceed unlocked as before if
we can't acquire Giant (non-recursively), except in kdb mode don't
even try to acquire Giant.  Everything here is a hack, but it often
works.  Even if mtx_trylock() succeeds, this might be a LOR.

Keyboard input also needs screen locking, to handle screen updates
and switches.  Add this, using the same simplistic screen locking
as for sc_cnputc().

Giant must be acquired before the screen lock, and the screen lock
must be dropped when calling the keyboard driver (else it would get a
harmless LOR if it tries to acquire Giant).  It was intended that sc
cn open/close hide the locking calls, and they do for i/o functions
functions except for this complication.

Non-console keyboard input is still only Giant-locked, with screen
locking in some called functions.  This is correct for the keyboard
parts only.

When Giant cannot be acquired properly, atkbd and kbdmux tend to race
and work (they assume that the caller acquired Giant properly and don't
try to acquire it again or check that it has been acquired, and the
races rarely matter), while ukbd tends to deadlock or panic (since it
does the opposite, and has other usb threads to deadlock with).

The keyboard (Giant) locking here does very little, but the screen
locking completes screen locking for console mode except for not
detecting or handling deadlock.
2016-08-31 11:10:39 +00:00
Jared McNeill
63dc81d861 Add support for Allwinner A64 USB PHY.
Reviewed by:	manu
2016-08-31 10:45:53 +00:00
Bjoern A. Zeeb
4c0e176d9c After r305113, try to properly replace the magic numbers with
proper #defines for this driver (not using the wrong header).
2016-08-31 10:45:33 +00:00
Toomas Soome
9edcae95e4 recvtftp() is broken for large files, report file size
The tftp download for large files will cause internal block id
to wrap to 0 as the data type is unsigned short.

Also provide file size information for stat.

PR:		200500
Reported by:	tsoome
Reviewed by:	allanjude
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D7660
2016-08-31 09:23:09 +00:00
Luiz Otavio O Souza
bf77189f92 Add a driver for the AM335x bandgap sensor, an on-die temperature sensor
as part of the AM335x control module extension.

TI says that the bandgap sensor is not very accurate on AM335x, but in our
tests it seems to be a good reference for the SoC temperature.

TI details:
http://processors.wiki.ti.com/index.php/AM335x_Thermal_Considerations#Measuring_Case_Temperature

Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-08-31 07:42:46 +00:00
Luiz Otavio O Souza
73e6944164 Allow the use of control module extensions to cope with specific platform
features.

Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-08-31 07:22:14 +00:00
Luiz Otavio O Souza
0ba9f0ab1b Replace more magic numbers with the proper register names.
Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-08-31 07:03:06 +00:00
Luiz Otavio O Souza
a089112fdf Replace a magic number with the proper register name.
Sponsored by:	Rubicon Communications, LLC (Netgate)
2016-08-31 06:46:47 +00:00
Sepherosa Ziehau
4bddf0c813 hyperv/timesync: Rework time adjustment policy
- By default, adjust time upon SYNC request.  It can be disabled
  through hw.hvtimesync.ignore_sync_req.  SYNC request will be
  sent by hypervisor the host is resumed, rebooted, etc.
- By default, adjust time upon SAMPLE request, if there is 100ms
  difference between VM time and hypervisor time.  This can be
  disabled through hw.hvtimesync.sample_drift.

And nuke the unnecessary task, since channel callback is running
in a Hyper-V taskqueue nowadays.

Submitted by:	YanZhe Chen <t-yachen microsoft com>
Discussed with:	Dexuan Cui <decui microsoft com>, Hongjiang Zhang <honzhan microsoft com>, sephe
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7707
2016-08-31 06:00:20 +00:00
Sepherosa Ziehau
cf38cf1b7a hyperv/hn: Consolidate NVS transaction execution.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7704
2016-08-31 05:27:30 +00:00
Nathan Whitehorn
09c697016b Back out misfired extra file in r305108. 2016-08-31 04:03:55 +00:00