Commit Graph

213902 Commits

Author SHA1 Message Date
Andrey A. Chernov
75a1631e30 Undo r302599 and partially r302594 case 2):
since WCHAR_MAX can be not a valid wchar value, it is easier to stay
inside wint_t.
2016-07-12 04:29:34 +00:00
Andrey A. Chernov
239e5577a2 Undo r302601, WCHAR_MAX may not be a valid wchar value. 2016-07-12 04:20:44 +00:00
Konstantin Belousov
8f01bee46b Revive the check, disabled in r197963.
Despite the implication (process has pending signals -> the current
thread marked for AST and has TDF_NEEDSIGCHK set) is not true due to
other thread might manipulate its signal blocking mask, it should still
hold for the single-threaded processes.  Enable check for the condition
for single-threaded case, and replicate it from userret() to ast() as
well, where we check that ast indeed has no signal to deliver.

Note that the check is under DIAGNOSTIC, it is not enabled for INVARIANTS
but !DIAGNOSTIC since it imposes too heavy-weight locking for day-to-day
used debugging kernel.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-07-12 03:53:15 +00:00
Konstantin Belousov
4f4c35bb38 Add assert to complement r302328.
AST must not execute with TDF_SBDRY or TDF_SEINTR/TDF_SERESTART thread
flags set, which is asserted in userret(). As the consequence, -1 return
from cursig() must not be possible.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-07-12 03:52:05 +00:00
Sepherosa Ziehau
1f175550a0 hyperv: Nuke unused stuffs
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6913
2016-07-12 03:38:29 +00:00
Sepherosa Ziehau
e90ec741f9 hyperv/vmbus: Use post message Hypercall APIs for GPA disconnect
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6912
2016-07-12 03:32:07 +00:00
Sepherosa Ziehau
e9bd7c4417 hyperv/vmbus: Use post message Hypercall APIs for channel close
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6906
2016-07-12 03:25:36 +00:00
Sepherosa Ziehau
2bf62f9a89 hyperv/vmbus: Use post message Hypercall APIs for GPADL connect.
This also fixes memory leakge if sub-connect messages are needed.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6878
2016-07-12 03:19:40 +00:00
Sepherosa Ziehau
df9f40d810 hyperv/vmbus: Remove unnecessary check and unapplied comment
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6877
2016-07-12 03:14:35 +00:00
Sepherosa Ziehau
fc1208d658 hyperv/vmbus: Use post message Hypercall APIs for channel open
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6876
2016-07-12 03:09:10 +00:00
Sepherosa Ziehau
796a90bf5d hyperv/vmbus: Reorganize vmbus scan process.
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6875
2016-07-12 03:03:17 +00:00
Sepherosa Ziehau
7a49521a4b hyperv/stor: Save the response status and xfer length properly.
The current command response handling discards status and xfer
length unconditionally, so that all of the commands would be
considered successful, even if errors happened.  When errors
really happens, this causes all kinds of wiredness, since the
buffer will not be filled on the host side and sense data will
be ignored.

Most of the time, errors do not happen, however, error does
happen for the request sent immediately after the disk resizing.
Discarding the SCSI status (SCSI_STATUS_CHECK_COND) and sense
data (capacity changes) prevents the disk resizing from working
properly.

This commit saves the response status and xfer length properly
for later use.

Submitted by:	Dexuan Cui <decui microsoft com>
Noticed by:	sephe
MFC after:	3 days
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D7181
2016-07-12 02:57:13 +00:00
Landon J. Fuller
fdedcd9f95 bhnd(4): Add bus pass-aware discovery of platform devices (PMU,
NVRAM, ChipCommon, etc).

This extends the existing handling of NVRAM core discovery to support
locating additional devices that may be attached either directly as real
cores, or indirectly via ChipCommon (e.g. bhnd_pmu).

When attached as a SoC root bus (as opposed to a bridged WiFi device),
the platform devices may not be attached until later bus passes,
necessitating delayed discovery/initialization.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D6962
2016-07-12 02:16:48 +00:00
Landon J. Fuller
494fa6b933 mips/ddb: fix MIPS backtrace truncation and MIPS32 register printing.
- Cast 32-bit register values to uintmax_t for use with %jx.
 - Add special-case return address handling for MipsKernGenException to
   avoid early termination of stack walking in the exception handler
   stack frame.

Submitted by:	Michael Zhilin <mizhka@gmail.com>
Reviewed by:	ray
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D6907
2016-07-12 02:12:31 +00:00
Landon J. Fuller
692f593c23 bhnd(4): print extra register information on chipc SPI timeout.
Submitted by:	Michael Zhilin <mizhka@gmail.com>
Reviewed by:	imp
Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D6993
2016-07-12 01:15:00 +00:00
Andrey A. Chernov
713a61670c I don't know why unsigned int is choosed for wchar_t here, but WCHAR_MAX
should be <= WINT_MAX. It is bigger, __UINT_MAX > INT32_MAX
2016-07-12 00:37:48 +00:00
Andrey A. Chernov
1cdf6eaaaf Cast WCHAR_MAX to wint_t, it can be unsigned on some systems. 2016-07-11 23:06:11 +00:00
Glen Barber
6cdb0cba3e Fix TARGET_TRIPLE for 12.0-CURRENT.
Submitted by:	rene
Sponsored by:	The FreeBSD Foundation
2016-07-11 21:55:56 +00:00
Nathan Whitehorn
8c636a11dc Remove assumptions in MI code that the BSP is CPU 0.
MFC after:	2 weeks
2016-07-11 21:25:28 +00:00
Andrey A. Chernov
1ef4039ac7 1) Following r302512 (remove collation support for [a-z]-ranges in libc)
remove collation support for a-z ranges here too.
It was implemented for single byte locales only in any case.

2) Reduce [Cc]flag loop to WCHAR_MAX, WINT_MAX here includes WEOF which is
not a character.

3) Optimize [Cc]flag case: don't repeatedly add the last character of
string2 to squeeze cset when string2 reach its EOS state.

4) Reflect in the manpage that [=equiv=] is implemented for single
byte locales only.
2016-07-11 21:23:50 +00:00
Jared McNeill
9f2b8101d7 Add support for Allwinner A64.
Reviewed by:	andrew, manu
2016-07-11 20:15:46 +00:00
Jared McNeill
d1d50b7010 Return early from bus_dmamap_load callback if the error indicator is set.
Reviewed by:	andrew, manu
2016-07-11 20:14:50 +00:00
Jared McNeill
d40e52436e Add support for arm64. The allwinner_soc_family() function is not available
on arm64 and all SoCs using the old FIFO register location are 32-bit only,
so unconditionally use the new location for arm64.

Reviewed by:	andrew, manu
2016-07-11 20:13:46 +00:00
Jared McNeill
2d36de5fb7 Add support for Allwinner A64 CPUx-PORT and CPUs-PORT Port Controllers.
Reviewed by:	andrew, manu
2016-07-11 20:09:17 +00:00
Jared McNeill
25cd5941be Add Allwinner A64 padconf settings.
Reviewed by:	andrew, manu
2016-07-11 20:06:21 +00:00
Jared McNeill
eefa8817b0 Add SOC_ALLWINNER_A64 option for Allwinner A64 (sun50i) SoCs. 2016-07-11 20:05:03 +00:00
Jared McNeill
2274551aba Include sys/rman.h to fix build on arm64. 2016-07-11 20:03:31 +00:00
Jared McNeill
221a9d6dd6 Attach RSB early. Children of RSB may provide resources necessary for
other devices such as interrupts, GPIOs, and regulators.
2016-07-11 20:02:51 +00:00
Jared McNeill
7dd6227263 Build fix for arm64. The phy interface uses intptr_t for the "phy"
parameter, not int.
2016-07-11 20:00:57 +00:00
Jared McNeill
18c3530813 Remove unused bus_space prototypes. 2016-07-11 19:58:00 +00:00
Enji Cooper
092af585e1 Remove redundant declaration for tcp_dooptions, similar to r302576
netinet/tcp_var.h already defines this function

Differential Revision:	https://reviews.freebsd.org/D7189
MFC after:	1 week
PR:	209920
Reported by:	Mark Millard <markmi@dsl-only.net>
Reviewed by:	np
Tested with:	clang 3.8.0, gcc 4.2.1, gcc 5.3.0
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 17:11:18 +00:00
Konstantin Belousov
725496ced5 Fix grammar.
Submitted by:	alc
MFC after:	2 weeks
2016-07-11 17:04:22 +00:00
Nathan Whitehorn
c506e956ba Remove dead code. This should have been removed in r297392, when these
files were moved to dev/ofw, but wasn't, apparently due to some version
control issue.

MFC after:	1 week
2016-07-11 17:02:17 +00:00
Enji Cooper
e3c76b36f6 Add missing default case to capable(..) function definition
By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN
aren't possible. Add in a KASSERT safety belt and return false in
!INVARIANTS case if an invalid value is passed in, as it would be a
programmer error.

This fixes a -Wreturn-type error with gcc 5.3.0.

Differential Revision:	https://reviews.freebsd.org/D7188
MFC after:	1 week
Reported by:	devel/amd64-gcc (5.3.0)
Reviewed by:	dumbbell
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 17:01:07 +00:00
Enji Cooper
763a7be673 (Re-do r302574 with corrected commit message..)
Remove redundant declaration for tcp_dooptions

netinet/tcp_var.h already defines this function

Differential Revision:	https://reviews.freebsd.org/D7187
MFC after:	1 week
PR:		209920
Reported by:	Mark Millard <markmi@dsl-only.net>
Reviewed by:	np
Tested with:	clang 3.8.0, gcc 4.2.1, gcc 5.3.0
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 16:56:51 +00:00
Enji Cooper
d8d21a717c Revert r302574. I botched the commit message in more way than 1 2016-07-11 16:54:19 +00:00
Enji Cooper
ca733c43ff Remove redundant declaration for tcp_dooptions
netinet/tcp_var.h already defines this function

PR:		209924
Reported by:	Mark Millard <markmi@dsl-only.net>
Reviewed by:	np
Tested with:	clang 3.8.0, gcc 4.2.1, gcc 5.3.0
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 16:52:04 +00:00
Konstantin Belousov
b42dfd6dff Fill tf_trapno for trap frames created for syscall.
If tf_trapno contains garbage which appears to be equal to T_NMI,
e.g. due to thread previously entered kernel due to NMI, doreti
sequence skips ast, and does so until a trap or hardware interrupt
occur.

The visible effects of the issue are quite confusing.  First, signals
delivery is postponed in observable ways.  In particular, the
guarantee that unblocked async signals queue is flushed before a
return from syscall, is broken.  Second, if there are pending signals,
all interruptible sleeps of the stuck thread are aborted immediately.

Since modern CPUs are relatively fast and tickless kernel generates
low interrupt rate, the faulty condition might exist for long time (in
an application time scale).

In collaboration with:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2016-07-11 15:52:52 +00:00
Enji Cooper
75f09ab639 Remove redundant declarations for intel_fbc_enabled(..) and
i915_gem_dump_object(..) to fix -Wredundant-decls warning

MFC after:	1 week
PR:		209924
Reported by:	Mark Millard <markmi@dsl-only.net>
Tested with:	devel/amd64-gcc (5.3.0)
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 15:50:06 +00:00
Enji Cooper
966d9ae5b6 Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix
-Wredundant-decls warning

MFC after:	1 week
PR:		209924
Reported by:	Mark Millard <markmi@dsl-only.net>
Tested with:	devel/amd64-gcc (5.3.0)
Sponsored by:	EMC / Isilon Storage Division
2016-07-11 15:47:43 +00:00
Konstantin Belousov
19efd8a5a8 In vgonel(), postpone setting BO_DEAD until VOP_RECLAIM() is called,
if vnode is VMIO.  For VMIO vnodes, set BO_DEAD in vm_object_terminate().

The vnode_destroy_object(), when calling into vm_object_terminate(),
must be able to flush buffers.  BO_DEAD purpose is to quickly destroy
buffers on write when the underlying vnode is not operable any more
(one example is the devfs node after geom is gone).  Setting BO_DEAD
for reclaiming vnode before object is terminated is premature, and
results in unability to flush buffers with live SU dependencies from
vinvalbuf() in vm_object_terminate().

Reported by:	David Cross <dcrosstech@gmail.com>
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2016-07-11 14:19:09 +00:00
Glen Barber
f6a1d618ad Fix the naming of -CURRENT
Sponsored by:	The FreeBSD Foundation
2016-07-11 14:07:24 +00:00
Cy Schubert
b04471d88a r302561 broke buildworld. This patch fixes that.
MFC after:	3 days
X-MFC with:	r302561
2016-07-11 13:41:40 +00:00
Robert Watson
98daa3e5db Add AUE_WAIT6 handling to the BSM conversion switch statement, reusing
the BSM encoding used for AUE_WAIT4.

MFC after:	3 days
Sponsored by:	DARPA, AFRL
2016-07-11 13:06:17 +00:00
Andrey V. Elsukov
fcbdb770aa Flush buffer after output. This fixes adding new data to already
printed flows.

PR:		210882
MFC after:	3 days
2016-07-11 12:44:58 +00:00
Michal Meloun
fc3466adda OFWPCI: Fix style(9).
No functional change.

MFC after: 3 weeks
2016-07-11 08:24:04 +00:00
Sepherosa Ziehau
60169cb210 hyperv/vmbus: Embed channel detach task in channel itself.
GC work queue stuffs.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6864
2016-07-11 08:12:04 +00:00
Pietro Cerutti
5a4d1cc66f Do not truncate lines longer than 512 chars.
PR:		210344
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D6881
2016-07-11 08:05:46 +00:00
Sepherosa Ziehau
3e1c325e63 hyperv/vmbus: Save vmbus softc to channels.
So that we don't need to access the global vmbus softc.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6863
2016-07-11 07:54:58 +00:00
Sepherosa Ziehau
fd5831c624 hyperv/vmbus: Create channel synchronously.
The device probe/attach has been move to a different thread, so the
reasons to create the channel asynchronously are no longer valid.

MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D6862
2016-07-11 07:45:31 +00:00