Commit Graph

215373 Commits

Author SHA1 Message Date
Cy Schubert
383236844f Revert r298887 (spelling fix) and remove $FreeBSD$ because text changes
to leap-seconds invaldidates validation hash at the end of the file.

Remove svn:keywords and replace with fbsd:nokeywords=yes to
support this change.

MFC after:	1 day
2016-08-25 02:40:14 +00:00
Allan Jude
335906de4b Increase the default rotation threshold of log files from 100kb to 1000kb
Submitted by:	Sean Kelly <smkelly@freebsd.org>
Differential Revision:	https://reviews.freebsd.org/D6792
2016-08-24 23:02:20 +00:00
Bruce Evans
e866ca565f Flesh out the state and flags args to sccnopen(). Set state flags to
indicate (potentially partial) success of the open.  Use these to
decide what to close in sccnclose().  Only grab/ungrab use open/close
so far.

Add a per-sc variable to count successful keyboard opens and use
this instead of the grab count to decide if the keyboad state has
been switched.

Start fixing the locking by using atomic ops for the most important
counter -- the grab level one.  Other racy counting will eventually
be fixed by normal mutex or kdb locking in most cases.

Use a 2-entry per-sc stack of states for grabbing.  2 is just enough
to debug grabbing, e.g., for gets().  gets() grabs once and might not
be able to do a full (or any) state switch.  ddb grabs again and has
a better chance of doing a full state switch and needs a place to
stack the previous state.  For more than 3 levels, grabbing just
changes the count.  Console drivers should try to switch on every i/o
in case lower levels of nesting failed to switch but the current level
succeeds, but then the switch (back) must be completed on every i/o
and this flaps the state unless the switch is null.  The main point
of grabbing is to make it null quite often.  Syscons grabbing also
does a carefully chosen screen focus that is not done on every i/o.

Add a large comment about grabbing.

Restore some small lost comments.
2016-08-24 18:59:24 +00:00
Bruce Evans
2078bf6ef0 Reorganise a little to prepare for locking fixes:
- in sccnopen(), open the keyboard before the screen.  The keyboard
  currently requires Giant (although it must be spinlocked to work
  correctly as a console), so the previous order would be a LOR if
  it has any semblance of locking.
- add a (currently dummy) state arg to scgetc().
2016-08-24 17:26:11 +00:00
Ed Maste
903b0dd702 Don't build libdevdctl if MK_CXX is no 2016-08-24 17:15:32 +00:00
Nathan Whitehorn
e21d69e9a7 Close a race when making the CPU idle under pHyp. If an interrupt occurs
between the beginning of the idle function and actually going idle, the
CPU could go to sleep with pending work.

MFC after:	1 month
2016-08-24 16:49:14 +00:00
Andrey A. Chernov
95f9709424 Use current locale (f.e. set by thread). It was global locale always
previously.

MFC after:      7 days
2016-08-24 16:44:27 +00:00
Toomas Soome
792ee5d5f2 Bug 212038 - svn commit: r304321 broken bhyve zvol VM bhyveload hang 100% WCPU
As the support for large blocks was enabled in loader zfs code, the
heap in userboot was left not changed, resulting with failure of detecting
and accessing zfs pools for bhyve virtual machines.

This fix does set the heap to use same amount of memory as the zfsloader
is using. To make it possible to test and verify loader functions, bhyve
is providing very useful option, but it also means, we like to keep feature
parity with [zfs]loader as close as possible.

PR:		212038
Reported by:	dfh0522@gmail.com
Reviewed by:	allanjude, grehan
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D7635
2016-08-24 16:40:29 +00:00
Toomas Soome
f1624ed8c4 Bug 212114 - loader: zio_checksum_verify() must test spa for NULL pointer
The issue was introduced with adding support for salted checksums, and
was revealed by bhyve userboot.so.

During pool discovery the loader is reading pool label from disks, and
at that time the spa structure is not yet set up, so the NULL pointer
is passed for spa. This condition must be checked to avoid the corruption
of the memory and NULL pointer dereference.

PR:		212114
Reported by:	tsoome@freebsd.com
Reviewed by:	allanjude
Approved by:	allanjude (mentor)
Differential Revision:	https://reviews.freebsd.org/D7634
2016-08-24 16:30:15 +00:00
Andrey A. Chernov
6a58af48d3 Bump __FreeBSD_version for LC_*_MASK fix for newlocale(3) and querylocale(3) 2016-08-24 15:36:48 +00:00
Alexander Motin
6377527147 Fix minor copy/paste bug.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2016-08-24 15:13:42 +00:00
Andrew Turner
aa9872243a Allow superpages on arm64 to be enabled. It is disabled for now to allow
for more testing across more hardware.

Obtained from:	ABT Systems Ltd
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-08-24 13:00:50 +00:00
Andrew Turner
262432bbb1 Add support to promote and demote managed superpages. This is the last part
needed before enabling superpages on arm64. This code is based on the amd64
pmap with changes as needed to handle the differences between the two
architectures.

Obtained from:	ABT Systems Ltd
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-08-24 12:57:40 +00:00
Ed Schouten
7c5f97dfcd Document the existence of the cloudabi32 kernel module. 2016-08-24 12:53:54 +00:00
Cy Schubert
affba8c71c MFV r304732.
Update from sqlite3-3.12.1 (3120100) to sqlite3-3.14.1 (3140100).

This commit addresses the tmpdir selection vulnerability fixed in
sqlite3-1.13.0.  See VuXML entry 546deeea-3fc6-11e6-a671-60a44ce6887b.

Security:	VuXML 546deeea-3fc6-11e6-a671-60a44ce6887b
Security:	CVE-2016-6153
2016-08-24 12:32:24 +00:00
Andrew Turner
3969d2f921 Teach the parts of the arm64 pmap that need to iterate over pages to also
iterate over superpages. We don't yet create these, but soon will.

Obtained from:	ABT Systems Ltd
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-08-24 12:32:18 +00:00
Ed Schouten
e4df2955d3 Add a Makefile for building the cloudabi32 kernel module.
Where the cloudabi64 kernel can be used to execute 64-bit CloudABI
binaries, this one should be used for 32-bit binaries. Right now it
works on i386 and amd64.
2016-08-24 11:35:49 +00:00
Ed Schouten
22f2f875ad Make execution of 32-bit CloudABI executables work on amd64.
A nice thing about requiring a vDSO is that it makes it incredibly easy
to provide full support for running 32-bit processes on 64-bit systems.
Instead of letting the kernel be responsible for composing/decomposing
64-bit arguments across multiple registers/stack slots, all of this can
now be done in the vDSO. This means that there is no need to provide
duplicate copies of certain system calls, like the sys_lseek() and
freebsd32_lseek() we have for COMPAT_FREEBSD32.

This change imports a new vDSO from the CloudABI repository that has
automatically generated code in it that copies system call arguments
into a buffer, padding them to eight bytes and zero-extending any
pointers/size_t arguments. After returning from the kernel, it does the
inverse: extracting return values, in the process truncating
pointers/size_t values to 32 bits.

Obtained from:	https://github.com/NuxiNL/cloudabi
2016-08-24 10:51:33 +00:00
Ed Schouten
3b36d1e469 Remove an unused header file.
The native CloudABI data types header file used to be pulled in by the
vDSOs when they were still written in C. Since they are now all
rewritten in assembly, this can go away.
2016-08-24 10:36:52 +00:00
Ed Schouten
48734c99d3 Convert pointers obtained from the threadattr_t structure with TO_PTR().
In all of these source files, the userspace pointer size corresponds
with the kernelspace pointer size, meaning that casting directly works.
As I'm planning on making 32-bit execution on 64-bit systems work as
well, use TO_PTR() here as well, so that the changes between source
files remain minimal.
2016-08-24 10:13:18 +00:00
Julio Merino
647672e21f Skip ls tests that use sparse files if these are not supported.
Some of the ls(1) tests create really large sparse files to validate
the number formatting features of ls(1).  Unfortunately, those tests fail
if the underlying test file system does not support sparse files, as is the
case when /tmp is mounted on tmpfs.

Before running these tests, check if the test file system supports sparse
files by using getconf(1) and skip them if not.  Note that the support for
this query was just added to getconf(1) in r304694.

Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D7609
2016-08-24 10:10:26 +00:00
Ed Schouten
102754b3cf Add missing header dependency.
This header depends on sigaltstack32 being declared.
2016-08-24 09:57:19 +00:00
Michael Tuexen
884d8c53e6 When aborting an association, send the ABORT before notifying the upper
layer. For the kernel this doesn't matter, for the userland stack, it does.
While there, silence a clang warning when compiling it in userland.
2016-08-24 06:22:53 +00:00
Bruce Evans
1a58327bc3 Fix key delay and repeat, part 2.
Use sbintime_t timeouts with precision control to get very accurate
timing.  It costs little to always ask for about 1% accuracy, and the
not so new event timer implementation usual delivers that, and when
it can't it gets much closer than our previous coarse timeouts and
buggy simple countdown.

The 2 fastest atkbd repeat rates have periods 34 and 38 msec, and ukbd
pretended to support rates in between these.  This requires
sub-microsecond precision and accuracy even to handle the 4 msec
difference very well, but ukbd asked the timeout subsystem for timeouts
of 25 msec and the buggy simple countdown of this gave a a wide range
of precisions and accuracies depending on HZ and other timer
configuration (sometimes better than 25 msec but usually more like 50
msec).  We now ask for and usually get precision and accuracy of about
1% for each repeat and much better on average.

The 1% accuracy is overkill.  Rounding of 30 cps to 34 msec instead of
33 already gives an error of +2% instead of -1%, and ut AT keyboards on
PS/2 interfaces have similar errors.

A timeout is now scheduled for every keypress and release.  This allows
some simplifications that are not done.  It allows removing the timeout
scheduling for exiting polled mode where it was unsafe in ddb mode.  This
is done.  Exiting polled mode had some problems with extra repeats.  Now
exiting polled mode lets an extra timeout fire and the state is fudged
so that the timeout handler does very little.

The sc->time_ms variable is unsigned to avoid overflow.  Differences of
it need to be signed.  Signed comparisons were emulated by testing an
emulated sign bits.  This only works easily for '<' comparisonss, but
we now need a '<=' comparison.  Change the difference variable to
signed and use a signed comparison.  Using unsigned types here didn't
prevent overflow bugs but just reduced them.  Overflow occurs with
n repeats at the silly repeat period of [U]INT_MAX / n.  The old countdown
had an off by 1 error, and the simplifications would simply count down
1 to 0 and not need to accumulate possibly-large repeat repeats.
2016-08-24 05:54:11 +00:00
Cy Schubert
fec4731491 Import sqlite3-3.14.1 (3140100) 2016-08-24 04:57:29 +00:00
Sepherosa Ziehau
8f555c7d0a hyperv/ic: Redefine IC version negotiate message.
And stringent input IC version negotiate message checks.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7614
2016-08-24 04:36:04 +00:00
Sepherosa Ziehau
aa4a62df05 hyperv/hn: Log a warning for RESET_CMPLT.
RESET is not used by the hn(4) at all, and RESET_CMPLT does not even
have a rid to match with the pending requests.  So, let's put it
onto an independent switch branch and log a warning about it.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7602
2016-08-24 04:21:15 +00:00
Justin Hibbits
60152a4037 Fix system hang when large FDT is in use
Summary:
Kernel maps only one page of FDT. When FDT is more than one page in size, data
TLB miss occurs on memmove() when FDT is moved to kernel storage
(sys/powerpc/booke/booke_machdep.c, booke_init())

This introduces a pmap_early_io_unmap() to complement pmap_early_io_map(), which
can be used for any early I/O mapping, but currently is only used when mapping
the fdt.

Submitted by:	Ivan Krivonos <int0dster_gmail.com>
Differential Revision: https://reviews.freebsd.org/D7605
2016-08-24 03:51:40 +00:00
Kevin Lo
e626c40eb5 Bring datasheet URL up to date. 2016-08-24 03:44:16 +00:00
Sepherosa Ziehau
d51ce2d164 hyperv/hn: Remove the redundant rid setting for RNDIS HALT.
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7595
2016-08-24 03:28:58 +00:00
Sepherosa Ziehau
6d79d63a7b net/rndis: Fix RNDIS_STATUS_PENDING definition.
While I'm here, sort the RNDIS status in ascending order.

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7594
2016-08-24 03:16:25 +00:00
Sepherosa Ziehau
48ef7b17f0 net/rndis: Add canonical RNDIS major/minor version as of today.
Reviewed by:	hps
MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7593
2016-08-24 03:08:13 +00:00
Cy Schubert
41a68a79bb Fixup man page formatting.
Submitted by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
Discussed with:	bjk@
MFC after:	3 days
2016-08-24 02:41:24 +00:00
Mike Karels
0f5687f2ae Fix L2 caching for UDP over IPv6
ip6_output() was missing cache invalidation code analougous to
ip_output.c. r304545 disabled L2 caching for UDP/IPv6 as a workaround.
This change adds the missing cache invalidation code and reverts
r304545.

Reviewed by:	gnn
Approved by:	gnn (mentor)
Tested by:	peter@, Mike Andrews
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D7591
2016-08-24 00:52:30 +00:00
Brooks Davis
2438d9a0e1 Avoid a redecleartion of __getosreldate().
Sponsored by:	DARPA, AFRL
2016-08-24 00:02:20 +00:00
Brooks Davis
f1f548d0e9 Spell MIPS more traditionally in "bfd_elf32_ntradbigmips_vec".
Sponsored by:	DAPRA, AFRL
2016-08-24 00:00:54 +00:00
Emmanuel Vadot
1f3b7bbb56 Allwinner: Add thermal sensor driver for A10/A20
The thermal sensor lives in the touch screen controller. Touch screen part
isn't done for now.
Temperature is read every ~2 seconds and exposed via sysctl.
2016-08-23 22:26:50 +00:00
Andrey A. Chernov
2f5007f6d2 LC_*_MASK bit shifting order was partially broken from the initial commit
time at year 2012. Only LC_COLLATE_MASK and LC_CTYPE_MASK are in the
right order.

The order here should match XLC_* from "xlocale_private.h" which, in turn,
match LC_* publicly visible order from <locale.h> which determines how
locale components are stored in the structure.
LC_*_MASK -> XLC_* translation done as "ffs(mask) - 1" in the querylocale()
and equivalent shift loop in the newlocale(), so mapped to some wrong
components (excluding two mentioned above).

Formally the fix is ABI breakage, but old code using those masks
never works properly in any case.
Only newlocale() and querylocale() are affected.

MFC after:      7 days
2016-08-23 20:33:56 +00:00
Gleb Smirnoff
a5ae1a9829 The -f check here is used to determine whether we have a single kernel
config or a list of them.  Put the variable into quotes, to avoid syntax
error from [ in case of list.  Without this change list is still working,
but an error is reported in the build log file.

Reviewed by:	imp
2016-08-23 20:04:23 +00:00
Bruce Evans
e99472e0d6 Fix key delay and repeat, part 1.
kbdcontrol -r fast is documented to give a non-emulated atkbd's fastest
rate of 250.34, but is misimplemented to request this as 0.0.  ukbd
supports many nonstandard rates, although it is currently too inaccurate
by a factor of several hundred for non-huge nonstandard rates to be
useful.  It mapped 0.0 to 200.0.  A repeat delay of 0 means a rate of
infinity which is quite fast, but physical constraints limit this to
a few MHz and the inaccuracies made it almost usable.

Convert 0.0 to the documented 250.34.

Also convert negative args and small args to the 250.34 minimal ones,
like atkbd does.  This is for KDSETREPEAT -- the 2 versions of the
deprecated KDSETRAD have bounds checking.  Keep not doing any bounds
checking or conversions for upper limits since nonstandard large
delays are useful for testing.

The inaccuracies are dependent on HZ and the timeout implementation.
With the old timeout implementation and HZ = 1000, 200.0 probably
worked better to emulate 250.34 than 250.34 itself.  HZ = 100 gives
roundoff errors that accidentally reduce the inaaccuracies, and
event timers reduce the inaccuracies even more, so 200.0 was giving
more like itself (perhaps 215.15 on average but sometimes close to
10 msec repeat which is noticebly too fast).  This commit makes 0.0
noticeably too slow, like 250.34 always was.
2016-08-23 19:50:16 +00:00
Enji Cooper
bb323b9e7b Add support for _PC_ACL_NFS4 as TRUSTEDBSD_ACL_NFS4
The TRUSTEDBSD prefix was chosen for consistency with the other
related `_PC_ACL*` prefixed variables.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2016-08-23 19:41:49 +00:00
Bryan Drewery
c30c436a58 FAST_DEPEND: Fix 'make all install' not properly rebuilding based on .depend.* files.
An optimization is in place to skip reading the .depend.* files with
'make install'.  This was too strong and broke 'make all install' and
'make foo.o foo install'.  Now only skip reading the dependency files
if all make targets ran are install targets.

The problem comes about because headers are only added in as a guessed
dependency if .depend.* files do not yet exist.  If they do exist, even
if being skipped from being read, then the header dependencies are not
applied.  This applies to all #included files, and not just headers.

Reported by:	kib
MFC after:	1 day
Sponsored by:	EMC / Isilon Storage Division
2016-08-23 19:37:18 +00:00
Dimitry Andric
1075729090 In addition to creating subdirectories under .OBJDIR for SRCS with
relative paths, also create them for DPSRCS.  This is needed for builds
that generate files during the depend stage, which cannot be compiled by
themselves, since those have to be put in DPSRCS.
2016-08-23 19:31:43 +00:00
Bryan Drewery
4d611b2b2d Fix in-tree GCC builds after r304681.
There were a few issues.
- In-tree GCC won't have X_COMPILER_TYPE defined but will have
  WANT_COMPILER_TYPE==gcc set from the SYSTEM_COMPILER logic that can
  be used.  Make the clang check specific to clang as well to ensure
  -target doesn't leak into a GCC build.
- When using a cross-compiler GCC (with a default sysroot or arch) and also
  passing --sysroot, it basically forgets all internal paths for
  libraries.  We've already worked around this quite a bit for
  the external toolchains.  Now for the in-tree bootstrap cross-compiler
  GCC, also pass in the needed -B${WORLDTMP}/usr/lib to find the crt
  object files, but also -isystem and -L to fix the paths.  This creates
  quite a spammy build log, but it is clear and still achieves the goals
  and stays consistent between internal and external build flags.
  Reducing the spam by using the '=' prefix feature will help and be
  done later.

MFC after:	3 days
X-MFC-With:	r304681
Reported by:	bz
Pointyhat to:	bdrewery
Sponsored by:	EMC / Isilon Storage Division
2016-08-23 19:29:37 +00:00
Enji Cooper
de7b37e618 Add MIN_HOLE_SIZE pathconf(2) support to getconf
This allows shell programs to programmatically determine whether
or not a filesystem supports sparse files

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2016-08-23 19:28:01 +00:00
Enji Cooper
11b0c200fb Clean up trailing whitespace
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2016-08-23 19:15:01 +00:00
Landon J. Fuller
7ba0628f07 bhndb(4): Fix unsigned integer underflow in dynamic register window
handling. This resulted in the window target being left uninitialized
when an underflow occured.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D7617
2016-08-23 19:03:11 +00:00
Ed Maste
ce437beff1 bspatch: apply style(9)
Make style changes (and trivial refactoring of open calls) now in order
to reduce noise in diffs for future capsicum changes.

Reviewed by:	oshogbo
No objection:	cperciva
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7610
2016-08-23 17:42:03 +00:00
Andrew Turner
e0a66c6379 Also adjust the virtual address passed to vm_page_pa_tryrelock.
Reported by:	alc
Obtained from:	ABT Systems Ltd
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-08-23 16:37:34 +00:00
Andrew Turner
56d9fe8567 Map memory as read-only in pmap_enter_quick_locked as is done in other
pmap implementations.

Obtained from:	ABT Systems Ltd
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-08-23 16:20:56 +00:00