Commit Graph

213686 Commits

Author SHA1 Message Date
Hans Petter Selasky
e4d1732068 Fix interrupt loop when switching from USB device to USB host mode by
clearing all endpoint interrupt bits.

PR:		210736
Approved by:	re (glebius)
MFC after:	1 week
2016-07-04 17:12:22 +00:00
Ed Maste
0f3454e465 boot1.efi: fix assignment / comparison expression
PR:		210706
Submitted by:	David Binderman <dcb314@hotmail.com>
Approved by:	re (kib)
MFC after:	1 week
2016-07-04 16:50:21 +00:00
Peter Grehan
2cf9911fc1 Import bhyve_graphics into CURRENT. Thanks to all who tested
this on the branch.

Original commit message:
  Initial bhyve native graphics support.

  This adds emulations for a raw framebuffer device, PS2 keyboard/mouse,
  XHCI USB controller and a USB tablet.

  A simple VNC server is provided for keyboard/mouse input, and graphics
  output.

  A VGA emulation is included, but is currently disconnected until an
  additional bhyve change to block out VGA memory is committed.

  Credits:
   - raw framebuffer, VNC server, XHCI controller, USB bus/device emulation
      and UEFI f/w support by Leon Dang
   - VGA, console/g, initial VNC server  by tychon@
   - PS2 keyboard/mouse jointly done by tychon@ and Leon Dang
   - hypervisor framebuffer mem support by neel@

  Tested by: Michael Dexter, in a number of revisions of this code.

  With the appropriate UEFI image, FreeBSD, Windows and Linux guests can
  installed and run in graphics mode using the UEFI/GOP framebuffer.

Approved by:	re (gjb)
2016-07-04 03:19:06 +00:00
Baptiste Daroussin
3c2db7e010 Add the forgotten "svn mv" from r302329
Reported by:	Ivan Klymenko <fidaj@ukr.net>
Approved by:	re (implicit)
2016-07-03 19:31:21 +00:00
Enji Cooper
d39abb6f67 Remove ftp(1) related files when MK_FTP == no
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D6969
MFC after: 1 week
Reviewed by: ngie
Submitted by: rakuco
Sponsored by: EMC / Isilon Storage Division
2016-07-03 18:27:00 +00:00
Baptiste Daroussin
3cf6509d70 Posixify the locales name for variants
For all locales with variants:
- if no ambiguity on the locale (only one variant) just use the regular name
- if ambiguity, pick one as default and append @<variant> to the others
  respecting POSIX

As a result:
- All the 3 components locales added recently are renamed to the usual 2
  components version for all but sr_RS.UTF-8
- Set sr_RS.UTF-8 to the cyrillic variant
- Add sr_RS.UTF-8@latin
- Remove the symlinks aliases they were created to represent the 2 components
  version as aliasas and are now useless
- Update the OptionalObsoleteFiles.inc and ObsoleteFiles.inc to reflect those
  changes

Discussed with:	ache@
Approved by:	re@ (gjb)
2016-07-03 18:21:11 +00:00
Konstantin Belousov
46e47c4f8d Provide helper macros to detect 'non-silent SBDRY' state and to
calculate appropriate return value for stops.  Simplify the code by
using them.

Fix typo in sig_suspend_threads().  The thread which sleep must be
aborted is td2. (*)

In issignal(), when handling stopping signal for thread in
TD_SBDRY_INTR state, do not stop, this is wrong and fires assert.
This is yet another place where execution should be forced out of
SBDRY-protected region.  For such case, return -1 from issignal() and
translate it to corresponding error code in sleepq_catch_signals().
Assert that other consumers of cursig() are not affected by the new
return value. (*)

Micro-optimize, mostly VFS and VOP methods, by avoiding calling the
functions when SIGDEFERSTOP_NOP non-change is requested. (**)

Reported and tested by:	pho (*)
Requested by:	bde (**)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Approved by:	re (gjb)
2016-07-03 18:19:48 +00:00
Enji Cooper
b943c77347 Fix .../usr.bin/lastcomm/legacy_test:main on i386
The time in the output files was ahead by 3 hours on i386. Fix the incorrect
offset.

Differential Revision: https://reviews.freebsd.org/D7079 (as part of a larger diff)
MFC after: 1 week
PR: 210329
Reported by: asomers
Approved by: re (gjb)
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division
2016-07-03 17:52:21 +00:00
Enji Cooper
a96a4734c0 Output the diffs to standard error when comparing the expected vs the
obtained output from lastcomm instead of just printing out a summary, e.g.
"they differed".

This will make failures with results more apparent when running kyua debug,
kyua report-html, etc.

Differential Revision: https://reviews.freebsd.org/D7079 (as part of a larger diff)
MFC after: 1 week
Approved by: re (gjb)
Reviewed by: cem
Sponsored by: EMC / Isilon Storage Division
2016-07-03 17:51:24 +00:00
Bryan Drewery
e7debdcb15 Fix race for incrementally rebuilding VERSION_MAP.
The dependency is needed in PROG_FULL since only the build of PROG_FULL
is using the LDFLAGS and depending on VERSION_MAP.  This was not a problem
with MK_DEBUG_FILES==no since it only builds PROG.

This should probably be using bsd.lib.mk instead [1]

Reported by:	swills, gjb
Reviewed by:	emaste
Noted by:	rgrimes [1]
Sponsored by:	EMC / Isilon Storage Division
Approved by:	re (kib)
2016-07-03 17:28:39 +00:00
Baptiste Daroussin
a8bacd6f93 Fix a bad test resulting in a segfault with ISO-8859-5 locales
Reported by:	Lauri Tirkkonen from Illumos
Approved by:	re@ (gjb)
2016-07-03 15:00:12 +00:00
Konstantin Belousov
d12d6a8476 Remove racy assert. The thread which changes vnode usecount from 0 to 1
does it under the vnode interlock, but the interlock is not owned by the
asserting thread.  As result, we might read increased use counter but also
still see VI_OWEINACT.

In collaboration with: nwhitehorn
Hardware donated by: IBM LTC
Sponsored by:	The FreeBSD Foundation (kib)
Approved by:	re (gjb)
2016-07-03 01:56:48 +00:00
Enji Cooper
066a2c8969 Update libxo to 0.6.3
This fixes the 02 testcases on i386 (at least), and may fix the testcases
in general on 32-bit platforms

Differential Revision: https://reviews.freebsd.org/D7052
Approved by: phil (maintainer)
Approved by: re (gjb)
Reported by: asomers
Reviewed by: phil
Submitted by: phil
Sponsored by: EMC / Isilon Storage Division
2016-07-03 01:35:27 +00:00
Allan Jude
e302644618 Add more machines to the bsdinstall workaround blacklist
Apply the LenovoFix (fake partition in pMBR is 2nd rather than 1st)
and GPT Active fix (mark the fake pMBR partition active) to respective
hardware that is confirmed to require such to boot correct.

Submitted by:	Sam Fourman Jr. <sfourman@gmail.com> (ThinkPad W520)
Submitted by:	Matthias Apitz <guru@unixarea.de> (Latitude E6330)
Approved by:	re (gjb)
Sponsored by:	ScaleEngine Inc.
2016-07-03 01:23:38 +00:00
Allan Jude
ca13d5d23a Fix an error in bsdinstall when ZFS installation uses a bootpool
A separate bootpool is used when the selected partition type is MBR
or when the disk is GELI encrypted and a UEFI loader is selected.

BIOS avoids the bootpool by using bootcode and loader that support GELI.

bsdinstall did not remount the bootpool after creating the main pool,
which caused an error when mkdir tried to create /boot/zfs

PR:		210717
Approved by:	re (gjb)
Sponsored by:	ScaleEngine Inc.
2016-07-03 01:22:59 +00:00
Konstantin Belousov
3f1c66b8d2 Change type of the 'dead' variable to boolean.
Requested by:	alc
MFC after:	1 week
Approved by:	re (gjb)
2016-07-03 00:08:17 +00:00
Andrey V. Elsukov
e62cd31f75 Hide warning about non-existent lookup tables and informational messages
about modified table entry when quied mode enabled.

Approved by:	re (hrs)
Obtained from:	Yandex LLC
2016-07-02 11:54:20 +00:00
Enji Cooper
a7390ff330 Update libxo to 0.6.3
Obtained from: https://github.com/Juniper/libxo/tree/0.6.3
Sponsored by: EMC / Isilon Storage Division
2016-07-02 05:30:27 +00:00
Navdeep Parhar
bf9363d72c cxgbe(4): Avoid a NULL dereference while dumping the L2 table. Entries
used by switching filters that rewrite L2 information do not have any
associated ifnet.

Approved by:	re@ (gjb@)
Sponsored by:	Chelsio Communications
2016-07-01 23:18:49 +00:00
Nathan Whitehorn
5ecf8e3852 Clean up some FDT-related code in the PowerPC bootloader, improving error
checking and robustness. Prevents errors and crashes in FDT commands on
PowerMac G5 systems.

Approved by:	re (gjb)
2016-07-01 21:09:30 +00:00
Steven Kreuzer
8c40ee420e Document 300777, Add support for GPIO, Sensors and interrupts on AXP209 PMIC
Approved by:	re (gjb, implicit, relnotes)
2016-07-01 20:25:59 +00:00
Steven Kreuzer
f4b78aa84a Document r299688, Add support for H3 SoC
Approved by:	re (gjb, implicit, relnotes)
2016-07-01 20:19:02 +00:00
Steven Kreuzer
b0eabf2d92 Document r263698, Add code for enabling second CPU core for A20 SoC.
Approved by:	re (gjb, implicit, relnotes)
2016-07-01 20:16:35 +00:00
Konstantin Belousov
e18ee4957d When a process knote was attached to the process which is already exiting,
the knote is activated immediately.  If the exit1() later activates
knotes, such knote is attempted to be activated second time.  Detect
the condition by zeroed kn_ptr.p_proc pointer, and avoid excessive
activation.

Before r302235, such knotes were removed from the knlist immediately
upon activation.

Reported by:	truckman
Sponsored by:	The FreeBSD Foundation
Approved by:	re (gjb)
2016-07-01 20:11:28 +00:00
Adrian Chadd
eec8884595 [net80211] teach AMRR to log the initial MCS rate as "MCS X"
Otheriwse it logs it as the rate value, which is 0x80 (MCS flag) + MCS,
which isn't that helpful.

Approved by:	re (gjb)
2016-07-01 19:58:13 +00:00
Hans Petter Selasky
2d8904583c Fix detection of USB device disconnects in USB host mode when the USB
device is connected directly to the USB port of the DWC OTG, in this
case a RPI-zero.

PR:		210695
Approved by:	re (gjb)
MFC after:	1 week
2016-07-01 07:27:33 +00:00
Xin LI
be8aff81c1 MFV r302260: expat 2.2.0
Approved by:	re (kib)
2016-07-01 05:48:45 +00:00
Glen Barber
193d700fe2 Update 11.0 to ALPHA6.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2016-07-01 00:00:35 +00:00
Bjoern A. Zeeb
9ac51e7911 In case of the global eventhandler make sure the current VNET
is still operational before doing any work;  otherwise we might
run into, e.g., destroyed locks.

PR:		210724
Reported by:	olevole olevole.ru
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Obtained from:	projects/vnet
Approved by:	re (gjb)
2016-06-30 19:32:45 +00:00
Bjoern A. Zeeb
6d8a5eacae Virtualise ipfilter.
Split initializzation an teardown into module (global state) and VNET
(per virtual network stack) parts.  Virtualise global state, which is
not "const".

Cleanup eventhandlers, so that we can make use of the passed in argument
to get the vnet state from the ifp;  disable the "cloner" event as it is
too early, has no state, and can fire before initialisation (see comment
in the source).

Handle the dynamic sysctls specially.  The problem is that "ipmain"
is the virtualized struct, but the fields used for the sysctls are
hanging off memory allocated and attached to the virtualized "ipmain"
thus standard VNET macros and sysctl handling do not work.
We still say it is VNET sysctls to get the proper protection checks
in the VIMAGE case;  to solve the problem of accessing the right bit
of memory hanging of each per-VNET ipmain, we use a dedicated handler
function wrapping around sysctl_ipf_int() undoing the base calculation
from kern_sysctl.c and then adding the passed-in offset into the right
struct depending on handler.  A bit of a mess exposing VNET-internals
this way but the only way to keep the code without having to massively
restructure ipf internals.

Approved by:		re (hrs)
Sponsored by:		The FreeBSD Foundation
Obtained from:		projects/vnet
MFC after:		2 weeks
Reviewed by:		cy
Differential Revision:	https://reviews.freebsd.org/D7000
2016-06-30 15:01:07 +00:00
Alexander Motin
e36599916f Revert r299454 and r299448.
Those changes were found confusing FreeBSD libc ACL code, that doesn't
differentiate ACL for directories and files, and report ACLs for all
directories created after those patches as non-trivial.  On the other
side these changes were considered wrong from POSIX and NFSv4 points of
view.  Until further investigation done upstream, revert those changes
locally in preparation for FreeBSD 11.0 release.

Approved by:	re (hrs)
2016-06-30 14:55:49 +00:00
Cy Schubert
53362bdcc5 Remove dead code.
Approved by:	re@ (hrs@)
MFC after:	1 week
2016-06-30 14:53:46 +00:00
Martin Matuska
ae5876ea19 MFV r302264:
Sync libarchive with vendor, bugfixes for tests:
- fix tests on filesystems without birthtime support, e.g. UFS1 (1)
- vendor issue #729: avoid use of C99 for-scope declarations in
  test_write_format_gnutar_filenames.c

MFC after:	1 week
PR:		204157 (1)
Approved by:	re (hrs)
2016-06-30 08:51:50 +00:00
Michael Tuexen
e75f31c1d0 This patch fixes two bugs related to the setting of the I-Bit
for SCTP DATA and I-DATA chunks.
* For fragmented user messages, set the I-Bit only on the last
  fragment.
* When using explicit EOR mode, set the I-Bit on the last
  fragment, whenever SCTP_SACK_IMMEDIATELY was set in snd_flags
  for any of the send() calls.

Approved by:	re (hrs)
MFC after:	1 week
2016-06-30 06:06:35 +00:00
Wojciech Macek
cadab29308 ARM, ARM64: Workaround for buf_ring reordering
This patch offers a workaround to buf_ring reordering
    visible on armv7 and armv8. This is supposed to be
    removed once new buf_ring implementation is integrated
    into the tree.

    Obtained from:         Semihalf
    Reviewed by:           alc,emaste
    Differential Revision: https://reviews.freebsd.org/D6986
    Approved by:           re (gjb)
2016-06-30 05:18:37 +00:00
Wojciech Macek
e46f2622b4 ARM64: fix DMAP calculation
Use arithmetic operators instead of logical. This fixes
    DMAP ranges calculation for ThunderX Dual Socket.

    Obtained from:         Semihalf
    Sponsored by:          Cavium
    Reviewed by:           zbb
    Differential Revision: https://reviews.freebsd.org/D7023
    Approved by:           re (gjb)
2016-06-30 04:58:19 +00:00
Bjoern A. Zeeb
31fe4e62fa Move the ipfw_log_bpf() calls from global module initialisation to
per-VNET initialisation and virtualise the interface cloning to
allow a dedicated ipfw log interface per VNET.

Approved by:		re (gjb)
MFC after:		2 weeks
Sponsored by:		The FreeBSD Foundation
2016-06-30 01:33:14 +00:00
Bjoern A. Zeeb
e88e125d77 Remove unused global variables as well as unused memory
allocations from ipfilter in preparation for VNET support.

Suggested by:		cy (see D7000)
Sponsored by:		The FreeBSD Foundation
MFC after:		2 weeks
Approved by:		re (gjb)
2016-06-30 01:32:12 +00:00
Colin Percival
4d1afa14d5 Enable indirect segment I/Os by default in the Xen blkfront driver when
running on EC2.  Due to improvements in EC2, the performance penalty which
was present on some EC2 instances no longer exists, and enabling this
feature now consistently yields ~20% higher throughput with equal or lower
latency.

Reverts:	r286063
Approved by:	re (gjb)
MFC after:	2 weeks
Relnotes:	Improved disk throughput on EC2
2016-06-29 23:56:24 +00:00
Oleksandr Tymoshenko
4b61754c68 Fixed FreeBSD/mips MALTA support for QEMU
Recource management functions in GT PCI controller driver
treated memory/IO resources as KSEG1 addresses, later during
activation these values would be increased by KSEG1 base again
rendering the address invalid and causing "bus error" trap.

Actual logic was converted to use real physical addresses,
so mapping takes place only during activation.

Submitted by:	Aleksandr Rybalko <ray@FreeBSD.org>
Approved by:	re (gjb)
2016-06-29 23:33:44 +00:00
Bryan Drewery
eb39a64db8 Flush every line when using meta mode and no -j or with -B.
Otherwise the output is buffered and it appears that make is stuck on something
long-running.  This problem is not present with -j as it uses different
code that was already flushing.

Discussed with:	sjg
Approved by:	re (blanket, META_MODE)
Sponsored by:	EMC / Isilon Storage Division
2016-06-29 22:54:01 +00:00
Bryan Drewery
78ed2a6fc4 WITH_META_MODE: Avoid false-positive error due to missing .meta with build commands.
Sponsored by:	EMC / Isilon Storage Division
Approved by:	re (blanket, META_MODE)
2016-06-29 22:39:22 +00:00
Maxim Sobolev
74ba4047a3 1.Improve handling around last compressed block of the file, which is
necessary because CLOOP format lacks explicit EOF or length, so that
  in the presence of padding or when the CLOOP is put onto a larger
  partition upper level provider size may be larger. Bound amount
  of extra data that we might touch to the max length of the compressed
  block and detect zero-padding in the last cluster, which when
  sector is all-zero might cause us to emit bogus I/O error after
  decompression of that fails. To not make code any more complicated
  that it needs to be deal with it in lazy-manner, i.e. when we
  first access that specific cluster.

  This change also fixes stupid mistake in the LZMA code, inherited
  from geom_lzma, which does not share length of the output buffer
  buffer with the decompression routine, so that in the presence
  of corrupted or purposedly tailored data may easily cause heap
  overflow and kernel memory corruption.

  Beef up validation of the CLOOP TOC by checking that lengths of
  all but the last compressed clusters match upper limit set by
  the decompressor and improve some error diagnostic output while
  I am here.

2.Add kern.geom.uzip.attach_to tunable to artifically limit
  attaching uzip to certain devices in the dev tree only.

    For example the following only makes us attaching to the
    GPT labels:

    kern.geom.uzip.attach_to="gpt/*"

3.Add kern.geom.uzip.noattach_to, which does opposite to the (2)
  above, i.e. prevents geom_uzip from tasting / attaching to
  providers matching some pattern. By default we don't attach
  to our own kind, i.e. kern.geom.uzip.noattach_to="*.uzip".
  It saves us quite some CPU cycles, esp on low-end embedded
  systems.

Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D7013
2016-06-29 18:19:05 +00:00
Andriy Voskoboinyk
cdc0cf21eb net80211: fix LOR/deadlock in ieee80211_ff_node_cleanup().
Add new lock for stageq (part of ieee80211_superg structure) and
ni_tx_superg (part of ieee80211_node structure);
drop com_lock protection where it is used to protect them.

While here, drop duplicate OPACKETS counter incrementation.

ni_tx_ampdu is not protected with it (however, it is also used without
locking in other places; probably, it requires some other solution
to be thread-safe).

Tested with RTL8188CUS (AP) and RTL8188EU (STA).

NOTE: Since this change breaks KBI, all wireless drivers need to be
recompiled.

Reviewed by:	adrian
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D6958
2016-06-29 17:25:46 +00:00
Bryan Drewery
d95fa04249 Don't warn about needing filemon for makeman.
r287879 wasn't quite enough here since Makefile.inc1 is running
'make -C release -V VERSION' and hitting the warning.

Reported by:	lattera
Sponsored by:	EMC / Isilon Storage Division
Approved by:	re (blanket, META_MODE)
2016-06-29 16:45:01 +00:00
Sean Bruno
3f7606d5a3 Correct PERSISTENT RESERVE OUT command and populate scsi_cmd->length.
PR:	202625
Submitted by:	niakrisn@gmail.com
Reviewed by:	scottl kenm
Approved by:	re (gjb)
MFC after:	2 weeks
2016-06-29 16:41:37 +00:00
Nathan Whitehorn
f8204502c2 Fix fat-fingering: #if AIM should have been #ifdef AIM to avoid failures on
Book-E kernels.

Approved by:	re (gjb)
Pointy hat to:	nwhitehorn
2016-06-29 16:34:56 +00:00
Nathan Whitehorn
0081393d79 Do not rely on firmware having pre-enabled the MMU in a reasonable way for
late boot: enable it explicitly after installing the page tables. If booting
from an FDT, also make sure to escape the firmware's MMU context early
before overwriting firmware page tables.

Approved by:	re (gjb)
2016-06-29 14:40:43 +00:00
Ed Maste
b689d9268f libcxxrt: correct mangled "typeinfo name" symbols in Version.map
r260553 added missing C++ typinfos to libcxxrt's version script.
It appears that a number of duplicate mangled symbols were added due to
a cut and paste error. Switch the second instances to _ZTS*,
typeinfo name for *.

Found by lld, which produces an error or warning for duplicate symbols.

Reviewed by:	dim
Approved by:	re (gjb)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7011
2016-06-29 11:48:42 +00:00
Steven Hartland
f535b2d7d8 Allow ZFS ARC min / max to be tuned at runtime
Prior to this change ZFS ARC min / max could only be changed using
boot time tunables, this allows the values to be tuned at runtime
using the sysctls:
* vfs.zfs.arc_max
* vfs.zfs.arc_min

When adjusting ZFS ARC minimum the memory used  will only reduce
to the new minimum given memory pressure.

Reviewed by:	allanjude
Approved by:	re (gjb)
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	Multiplay
Differential Revision:	https://reviews.freebsd.org/D5907
2016-06-29 07:55:45 +00:00