Commit Graph

208963 Commits

Author SHA1 Message Date
David Malone
95bcaf513b Following revision r295924, the changes to a db file should be fsynced
before the file is closed. Consequently, it shouldn't be necessary to
open the file with O_SYNC any more.

This improves the performance of building large .db files for large
password files a lot and should resolve this problem:

	https://forums.freebsd.org/threads/10-2-pre-pwd_mkdb-slow-on-larger-master-passwd.52700/

Differential Revision:	https://reviews.freebsd.org/D5186
Reviewed by:	garga, vangyzen, bapt, se
MFC after:	1 week
2016-02-23 15:28:13 +00:00
David Malone
efb7dae251 If we close or sync a hash-based db file, make sure to call fsync to
make sure the changes are on disk. The people at pfSense noticed that
it didn't always make it to the disk soon enough with soft updates.

Differential Revision:	https://reviews.freebsd.org/D5186
Reviewed by:	garga, vangyzen, bapt, se
MFC after:	1 week
2016-02-23 15:21:13 +00:00
Hans Petter Selasky
ecc7ce0f3e Be more verbose when truncating number of HID items.
Suggested by:	Larry Rosenman <ler@lerctr.org>
MFC after:	1 week
2016-02-23 14:58:20 +00:00
Ruslan Bukin
48eeabc1a9 Set a dependencies for stack(9) RISC-V MD part.
Pointed out by:	andrew
2016-02-23 14:29:22 +00:00
Ruslan Bukin
cea32c0742 o Grab physical memory regions information from the device tree.
o Increase memory size.
2016-02-23 14:21:46 +00:00
Svatopluk Kraus
fe6928058c Remove redundant __ARM_ARCH >= 6 check in armv6 specific files. 2016-02-23 10:12:50 +00:00
Sepherosa Ziehau
1b3ce7e39f hyperv/stor: Fix print format
Detected by:	PVS Static Analysis
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5388
2016-02-23 09:29:45 +00:00
Sepherosa Ziehau
b87683cb78 hyperv/hn: Use IFQ_DRV_PREPEND instead of IF_PREPEND
IF_PREPEND promises out-of-order packet sending when the TX desc list
is depleted. It was overlooked and copied blindly when the transmission
path was partially rewritten.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5386
2016-02-23 09:25:20 +00:00
Ed Schouten
70907712be Make handling of mmap()'s prot argument more strict.
- Make the system call fail if prot contains bits other than read, write
  and exec.
- Similar to OpenBSD's W^X, don't allow write and exec to be set at the
  same time. I'd like to see for now what happens if we enforce this
  policy unconditionally. If it turns out that this is far too strict,
  we'll loosen this requirement.
2016-02-23 09:22:00 +00:00
Sepherosa Ziehau
a0a3cf18ec hyperv/hn: Factor out hn_send_pkt() from hn_start_locked()
It will be shared w/ the upcoming ifnet.if_transmit method
implementation.

No functional change.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5385
2016-02-23 09:20:33 +00:00
Xin LI
876964d12a MFV r295913:
Partially apply upstream changeset 6e06b1c8 (kientzle).

Limit filter recursion level to 25 (instead of infinite).  This fixes a
potential crash issue discovered by Alexander Cherepanov.

PR:		207362
Reported by:	Robert Clausecker
Obtained from:	libarchive github project
2016-02-23 07:13:22 +00:00
Xin LI
c5f9310ca9 Apply upstream commit 6e06b1c8 (partial, by kientzle):
Fix a potential crash issue discovered by Alexander Cherepanov:
It seems bsdtar automatically handles stacked compression. This is a
nice feature but it could be problematic when it's completely
unlimited.  Most clearly it's illustrated with quines:

$ curl -sRO http://www.maximumcompression.com/selfgz.gz
$ (ulimit -v 10000000 && bsdtar -tvf selfgz.gz)
bsdtar: Error opening archive: Can't allocate data for gzip decompression

Without ulimit, bsdtar will eat all available memory. This could also
be a problem for other applications using libarchive.
2016-02-23 07:04:54 +00:00
Ian Lepore
3f817dd216 Stop using the global fdtbus_bs_tag and instead use the tag from the softc
that was set up properly at init time.
2016-02-23 03:34:36 +00:00
Ian Lepore
b1c2e02c10 This code no longer references fdtbus_bs_tag, no need for a special extern
declaration of it for aarch64.
2016-02-23 03:01:46 +00:00
Ian Lepore
99c4102214 Now that we have OF_decode_addr(), with proper MD implementations, to obtain
the bus space tag and handle for a uart console, use the values returned by
that routine to set the global uart_bus_space_mem, instead of assuming that
there will be a global variable named fdtbus_bs_tag to set it from.

Also, use OF_getencprop() instead calling fdt32_to_cpu() separately.
2016-02-23 02:57:45 +00:00
Justin Hibbits
9ef05032c0 Allow the size argument for law_enable() to be non-power-of-2.
Although the local access windows are powers of 2 in size, allow arguments that
aren't power of 2, and round up.
2016-02-23 02:28:19 +00:00
Kevin Lo
c9b6e63dd3 Add device ID for 'AboCom 802.11n' usb.
PR:	207412
Submitted by:	Philippe Michaud-Boudreault <pitwuu at gmail dot com>
2016-02-23 01:56:58 +00:00
Marius Strobl
0a01ff4d7d Fix and clean up usage of DMA and TSO segments:
- At Intel it is believed that most of their products support "only"
  40 DMA segments so lower {EM,IGB}_MAX_SCATTER accordingly. Actually,
  40 is more than plenty to handle full size TSO packets so it doesn't
  make sense to further distinguish between MAC variants that really
  can do 64 DMA segments. Moreover, capping at 40 DMA segments limits
  the stack usage of {em,igb}_xmit() that - given the rare use of more
  than these - previously hardly was justifiable, while still being
  sufficient to avoid the problems seen with em(4) and EM_MAX_SCATTER
  set to 32.
- In igb(4), pass the actually supported TSO parameters up the stack.
  Previously, the defaults set in if_attach_internal() were applied,
  i. e. a maximum of 35 TSO segments, which made supporting more than
  these in the driver pointless. However, this might explain why no
  problems were seen with IGB_MAX_SCATTER at 64.
- In em(4), take the 5 m_pullup(9) invocations performed by em_xmit()
  in the TSO case into account when reporting TSO parameters upwards.
  In the worst case, each of these calls will add another mbuf and,
  thus, the requirement for an additional DMA segment. So for best
  performance, it doesn't make sense to advertize a maximum of TSO
  segments that typically will require defragmentation in em_xmit().
  Again, this leaves enough room to handle full size TSO packets.
- Drop TSO macros from if_lem.h given that corresponding MACS don't
  support TSO in the first place.

Reviewed by:	erj, sbruno, jeffrey.e.pieper_intel.com
Approved by:	erj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D5238
2016-02-23 01:19:26 +00:00
Ian Lepore
e28fbecafb Make imx6 systems work again after recent import of new dts files.
Linux-driven changes to the way the chip's two interrupt controllers are
defined (we only support one of them) led to no interrupt processing, so
the system would hang after device instantiation.  This workaround just
rewrites the FDT data on the fly to get interrupt handling back under the
control of the main GIC device.

If/when we ever support deep sleep modes that involve powering down the
main GIC, we'll have to undo this change, write a driver for the GPC-PIC,
and somehow manage the handoff of responsibilities between the two drivers
as the chip transitions in/out of deep sleep mode.
2016-02-23 01:08:39 +00:00
Dimitry Andric
72e8ce06c0 Fix a problem in ld, causing it to sometimes print messages similar to
"invalid string offset 65521 >= 27261 for section `.strtab'". for object
files produced by recent versions of clang.

In BFD's elf_create_symbuf() function, the size of the symbol buffer
('ssymbuf') is not calculated correctly, and the initial value for the
'ssym' variable is off by one, since 'ssymbuf' has shndx_count + 1
members.

MFC after:	1 week
2016-02-22 22:16:32 +00:00
Alan Somers
01368cfa26 Fix the usr.sbin/iostat build with GCC, broken by r295768
Renamed some local variables for compatibility with -Wshadow

Reported by:	Andrew Turner
Tested by:	ken
MFC after:	4 weeks
X-MFC-with:	295768
Sponsored by:	Spectra Logic Corp
2016-02-22 21:40:53 +00:00
Bryan Drewery
590363ef99 Always remove .depend.* in case switching between FAST_DEPEND on/off.
This was missed in r295666.

Sponsored by:	EMC / Isilon Storage Division
2016-02-22 21:01:25 +00:00
Ian Lepore
0d2550a169 If the user has set a u-boot env var named rootpath, automatically
import it into the loader(8) env as dhcp.root-path, so that it overrides
any dhcp/bootp server-provided path.

Now if you have a dhcp server available you can easily net-boot a u-boot
system even if you don't control the dhcp server config, by setting just
two variables in the u-boot env:

  loaderdev=net
  rootpath=<nfsserverip>:<pathname>

Previously you had to either accept all the dhcp parameters from the
server without the ability to locally provide the rootpath, or you had
to forego dhcp and set more vars (ipaddr, netmask, serverip, rootpath).
2016-02-22 18:53:55 +00:00
Ruslan Bukin
e1b6d4a9f4 Add basic trap handlers for illegal instruction and breakpoint
exceptions.
2016-02-22 14:54:50 +00:00
Ruslan Bukin
041c26e7ff Fix comment. 2016-02-22 14:19:45 +00:00
Ruslan Bukin
c7977d4cee Remove duplicates. 2016-02-22 14:13:05 +00:00
Ruslan Bukin
0b7bfc0beb Provide stack(9) MD stubs for RISC-V so ktr(9) can be compiled in. 2016-02-22 14:01:46 +00:00
Ruslan Bukin
dfb5ca561e Fix ktrace call. 2016-02-22 13:52:08 +00:00
Wojciech Macek
0422bce8b2 Add Intel 10Gb support to ARM64 GENERIC kernel config
Obtained from:         Semihalf
Sponsored by:          Cavium
Approved by:           cognet (mentor)
Reviewed by:           zbb
Differential revision: https://reviews.freebsd.org/D5347
2016-02-22 13:34:43 +00:00
Svatopluk Kraus
eb21eee06e Remove armv6 specific part from armv4 specific file and update comment.
No functional change.
2016-02-22 12:57:08 +00:00
Svatopluk Kraus
7758916f44 Move ARM_L2_PIPT option to std.armv6 for all armv6 platforms.
Only L2 PIPT cache is supported for __ARM_ARCH >= 6.

In fact, this is just a pure proclamation as this option is used
only in armv4 specific files now.
2016-02-22 11:47:28 +00:00
Svatopluk Kraus
b352b10400 As <machine/vm.h> is included from <vm/vm.h>, there is no need to
include it explicitly when <vm/vm.h> is already included.

Reviewed by:	alc, kib
Differential Revision:	https://reviews.freebsd.org/D5380
2016-02-22 09:10:23 +00:00
Svatopluk Kraus
35a0bc1260 As <machine/vmparam.h> is included from <vm/vm_param.h>, there is no
need to include it explicitly when <vm/vm_param.h> is already included.

Suggested by:	alc
Reviewed by:	alc
Differential Revision:	https://reviews.freebsd.org/D5379
2016-02-22 09:08:04 +00:00
Svatopluk Kraus
d6849317c5 As <machine/param.h> is included from <sys/param.h>, there is no need
to include it explicitly when <sys/param.h> is already included.

Reviewed by:	alc, kib
Differential Revision:	https://reviews.freebsd.org/D5378
2016-02-22 09:04:36 +00:00
Svatopluk Kraus
a1e1814d76 As <machine/pmap.h> is included from <vm/pmap.h>, there is no need to
include it explicitly when <vm/pmap.h> is already included.

Reviewed by:	alc, kib
Differential Revision:	https://reviews.freebsd.org/D5373
2016-02-22 09:02:20 +00:00
Sepherosa Ziehau
ed3960349b hyperv/hn: Add TX method for txeof processing.
Preamble to implement ifnet.if_transmit method.

Reviewed by:	adrian
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5346
2016-02-22 06:28:18 +00:00
Sepherosa Ziehau
5cb0a42c8c hyperv/hn: Staticize and rename packet TX done function
It is only used in hv_netvsc_drv_freebsd.c; and rename it to hn_tx_done()
mainly to reserve "xmit" for ifnet.if_transmit implement.

While I'm here, remove unapplied comment.

Reviewed by:	adrian
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5345
2016-02-22 06:22:47 +00:00
Sepherosa Ziehau
009a73c4ba hyperv/hn: Rename TX related function and struct fields a bit
Preamble to implement the ifnet.if_transmit method.

Reviewed by:	adrian
Approved by:	adrian (mentor)
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5344
2016-02-22 06:17:26 +00:00
Andriy Voskoboinyk
6e2ab41693 urtwn: shutdown the device properly
- R92C path: NetBSD (mostly)
- R88E path: TP-Link driver

Tested with RTL8188EU and RTL8188CUS.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5198
2016-02-22 01:15:02 +00:00
Pyun YongHyeon
15b185341d ifnet lock was changed to use sx(9) long time ago.
Don't hold a driver lock for if_free(9).
2016-02-22 00:58:04 +00:00
Andriy Voskoboinyk
7873b2abd6 urtwn: add an option to compile the driver without firmware specific code
- Add URTWN_WITHOUT_UCODE option (will disable any firmware specific code
when set).
- Do not exclude the driver from build when MK_SOURCELESS_UCODE is set
(URTWN_WITHOUT_UCODE will be enforced unconditionally).
- Do not abort initialization when firmware cannot be loaded;
behave like the URTWN_WITHOUT_UCODE option was set.
- Drop some unused variables from urtwn_softc structure.

Tested with RTL8188EU and RTL8188CUS in HOSTAP and STA modes.

Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4849
2016-02-22 00:48:53 +00:00
Andrew Turner
fe3232f39a Make efi_time and EFI_GetTimeOfDay static, neither are used by other parts
of the efi code.

Sponsored by:	ABT Systems Ltd
2016-02-21 21:20:23 +00:00
Jilles Tjoelker
2ece338651 sh: Don't hash alias name when there are no aliases. 2016-02-21 20:58:24 +00:00
Ian Lepore
8be85b352b Document the ability to override compiled-in env and hints using variables
in the bootloader-provided env.
2016-02-21 18:58:05 +00:00
Jilles Tjoelker
c39f3bac71 sh: Optimize setprompt(0).
Avoid doing work to print an empty prompt (such as when reading scripts).
2016-02-21 18:54:17 +00:00
Andriy Voskoboinyk
5036353a49 rtwn: import r290048.
- Fix scanning from AUTH state.

Tested by: Simone Mario Lombardo <evil.lombo@gmail.com>

PR:		203105
Reviewed by:	kevlo
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D4820
2016-02-21 18:51:48 +00:00
Ian Lepore
85143dd18d Allow a dynamic env to override a compiled-in static env by passing in the
override indication in the env data.

Submitted by:	bde
2016-02-21 18:35:01 +00:00
Ian Lepore
37d65816e1 Minor style cleanups.
Submitted by:		bde
2016-02-21 18:17:09 +00:00
Jilles Tjoelker
3b3c9ccf08 sh: Remove unnecessary flushouts while reading script.
Output is flushed when a builtin is done or immediately after writing it
(error messages, set -v output, prompts).
2016-02-21 16:48:37 +00:00
Pedro F. Giffuni
99c006f9ba ostiInitiatorIOCompleted(): wrong sizeof() argument.
Detected by:	PVS Static Analysis
CID:		1331601, 1331523
2016-02-21 16:45:22 +00:00