Commit Graph

224541 Commits

Author SHA1 Message Date
Mark Johnston
aa2b6b4957 Add device_is_registered() to the LinuxKPI.
MFC after:	1 week
2017-07-08 18:53:02 +00:00
Mark Johnston
8cd823ecf7 Add TASK_COMM_LEN to the LinuxKPI.
MFC after:	1 week
2017-07-08 18:52:29 +00:00
Bryan Drewery
0f827d7a96 makeman: Don't show META_MODE ABI rebuild warnings.
Reported by:	dim
Sponsored by:	Dell EMC Isilon
2017-07-08 17:53:00 +00:00
Bruce Evans
28bbe30cce Add many bitmaps (now there are 13) for mouse cursors and logic to try
to choose the best one.

The old 9x13 cursor was was sort of correct for CGA 640x200 text mode,
but distorted for all other modes.  This mode is still available on
all systems with VGA, but stopped being useful in ~1985.  It has very
unsquare pixels with an aspect ratio of 240:100 on 4:3 monitors.  On
16:9 monitors, the unsquareness in this mode is reduced to only 180:100
iff the monitor stretches the pixels to the full screen.

Newer modes and systems have smaller distortions, but with many more
variations.  Square pixels first became common with VGA 640x480 mode
on 4:3 monitors.  However, standard VGA text mode also has 9-bit wide
characters and only 25 lines, so it has 720x400 pixels.  This has
unsquare pixels with an aspect ratio of 135:100 on 4:3 monitors.  On
16:9 monitors, it gives almost-square pixels with an aspect ration of
101:100 iff the monitor stretches, but in modes that were square on
4:3 monitors square similar monitor stretching breaks the squareness.

Guess the physical aspect ratio using heuristics.  The old version of
X that I use is further from doing this using info from PnP monitors
that is unavailable in syscons (X doesn't understand if the monitor
is doing stretching and doesn't even understand how its its own mode
changes affect the pixel size).  Monitors with aspect ratio control
should be configured to _not_ stretch 4:3 modes to 16:9.  Otherwise,
use the machdep.vga_aspect_scale sysctl to compensate.  Only 1 of my
4 monitors/laptops requires this.  It always stretches to 16:9.

The mouse data has new aspect ratio fields for selecting the best
cursor and a new name field for display in debugging messages.

Selecting the mouse cursor is now a slow operation so it is not done
for every drawing of the cursor.  To avoid a new initialization method,
it is done whenever the text cursor is set or changed.  Also remove
dead code in settings of text cursors.

Use larger mouse cursors (sometimes the full 10x16 one) for 8x8 fonts
in cases where this works better (mostly in graphics mode).
2017-07-08 17:30:33 +00:00
Alan Somers
761e666303 stdbuf(1): Add buffer definition "B" to the usage message
This option has been missing from the usage message ever since the program
was first imported.

Submitted by:	shivansh
Reviewed by:	asomers
MFC after:	3 weeks
Sponsored by:	Google, Inc (GSoC 2017)
Differential Revision:	https://reviews.freebsd.org/D11529
2017-07-08 17:08:42 +00:00
Bryan Drewery
9bb3819b32 SYSTEM_COMPILER: Ensure there is not a stale compiler in WORLDTMP.
In a scenario of cross-building it is possible that an OBJDIR's WORLDTMP
contains an older compiler in WORLDTMP/usr/bin/cc that is not rebuilt
if SYSTEM_COMPILER logic is triggered.  This compiler was still
incorrectly used.  Address this by removing WORLDTMP/usr/bin/cc and all
of the hardlinked files associated with it.  Also do this for c++ for
GCC builds.

Sponsored by:	Dell EMC Isilon
MFC after:	1 week
2017-07-08 16:39:55 +00:00
Bruce Evans
aa24f48b36 Add files to help manage the (vga) syscons mouse cursor.
To mostly fix distortion of mouse cursors by non-square pixels, I
needed 8 variants of the same cursor shape for large fonts and
another 7 variants for small fonts.  Some variants are shared,
leaving only 13 variants in 26 glyphs altogether.  Keep these in
the BDF source file cursor.bdf.  cursor.bdf has another 5 unused
experimental cursors in 10 glyphs.  cursor.awk is a simple awk
script for converting this and similar bdf files into C declarations
for copying into scvgarndr.c.  syscons doesn't use any of this yet.
2017-07-08 15:01:55 +00:00
Konstantin Belousov
f2c18deb0e Fix handling of one more possible exception on return to usermode.
If %ss is loaded with a segment pointing to a non-present descriptor
by the IRETD instruction, a kernel-mode #SS exception is generated.
Resulting T_STKFLT trap must be checked against doreti_iret_fault
location and handled, otherwise userspace may panic the kernel.

Note that this is i386 variant of FreeBSD-SA-15:21.amd64, but unlike
amd64, there is no swapgs on i386 and the issue is arguably not
exploitable.

Reported by:	Maxime Villard <max@m00nbsd.net>
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-07-08 11:07:39 +00:00
Edward Tomasz Napierala
1f3aded066 Fix "mount -uw /" when the filesystem type doesn't match.
This basically makes "mount -uw /" work when the filesystem
mounted on / is NFS, but the one configured in fstab(5) is UFS,
which can happen when you forget to modify fstab.

Note that the whole special case ("else if (argv[0][0] == '/'")
is probably not needed anyway.  I'll take a look at removing it
altogether; for now this is a minimally intrusive fix.

MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D11323
2017-07-08 11:06:27 +00:00
Kristof Provost
2ca5f390c4 Allow more services to run in vnet jails
After some tests, here are the services that run into a vnet jail:
  - defaultroute
  - dhclient
  - ip6addrctl
  - natd
  - pf
  - pfsync
  - pflog (deamon runs, pflog0 interface usable, but /var/log/pflog not filled)
  - rarpd
  - route6d (do nothing anyway because obsolete)
  - routed (do nothing anyway because obsolete)
  - rtsold
  - static_arp
  - static_ndp

PR:		220530
Submitted by:	olivier@freebsd.org
2017-07-08 09:28:31 +00:00
Konstantin Belousov
dd5ef26e97 Simplify language.
Submitted by:	wblock
MFC after:	3 days
2017-07-08 07:33:30 +00:00
Kyle Evans
79c9a695c3 Correctly ignore branch operators in the top-level parser when applicable.
An oversight in r320742 caused BREs to become sensitive to the branching operator prematurely, which caused
breakage in some limited situations -- namely, those that tried to use branching in a BRE. Most of these scenarios
had already been corrected beforehand to properly use gsed or grep for GNU extensions, so the damage is
slightly mitigated.

Reported by: antoine

Reported by:	antoine
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D11522
2017-07-07 22:00:39 +00:00
Warner Losh
bbbfb2a922 Bump date for today's commit. 2017-07-07 16:58:40 +00:00
Warner Losh
1e001b99a5 Improve wording for -E and -t flags. -E never writes the entire disk,
so don't imply that. Note that if BIO_DELETE isn't supported, the
operation will fail (as opposed to writing the entire disk with
zeros). Thin storage also benefits from trim. List more accurate
reason why trim helps flash-memory.
2017-07-07 16:54:18 +00:00
Glen Barber
9f861cfc6b Connect ena(4) to the build.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2017-07-07 16:22:09 +00:00
Andrew Turner
9ce763a0db Remove the MULTIDELAY option from arm. It's now enabled when PLATFORM is
enabled.
2017-07-07 13:55:11 +00:00
Hans Petter Selasky
611572285a Complete r320189 which allows a NULL VM fault handler in the LinuxKPI.
Instead of mapping a dummy page upon a page fault, map the page
pointed to by the physical address given by IDX_TO_OFF(vmap->vm_pfn).
To simplify the implementation use OBJT_DEVICE to implement our own
linux_cdev_pager_fault() instead of using the existing
linux_cdev_pager_populate().

Some minor code factoring while at it.

Reviewed by:	markj @
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2017-07-07 13:44:14 +00:00
Hans Petter Selasky
ea16525413 Fix a bug in synchronize RCU when the calling thread is bound to a CPU.
Set "td_pinned" to zero after "sched_unbind()" to prevent "td_pinned"
from temporarily becoming negative during "sched_bind()". This can
happen if "sched_bind()" uses "sched_pin()" and "sched_unpin()".

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2017-07-07 13:15:00 +00:00
Hans Petter Selasky
a90f44b281 Implement fix for BULK IN-token retry mechanism. When the hardware is
programmed for infinite IN token retry after NAK, the SAF1761
hardware, however, does not retry the IN-token. This problem is
described in the SAF1761 errata, section 18.1.1.

While at it:
- Add some minor chip specific initialization for RTEMS.
- Add debug print for status registers in the interrupt filter.

Submitted by:	Christian Mauderer <christian.mauderer@embedded-brains.de>
MFC after:	1 week
2017-07-07 12:03:58 +00:00
Ryan Libby
5228ad10d4 amd-vi: gcc build errors
amdvi_cmp_wait: gcc complained about a malformed string behind an ifdef.

struct amdvi_dte: widen the type of the first reserved bitfield so that
the packed representation would not cross an alignment boundary for that
type. Apparently that causes in-tree gcc (4.2) to insert padding
(despite packed, resulting in a wrong structure definition), and causes
more modern gcc to emit a warning.

ivrs_hdr_iterate_tbl: delete a misleading check about header length
being less than 0 (the type is unsigned) and replace it with a check
that the length doesn't exceed the table size.

Reviewed by:	anish, grehan
Approved by:	markj (mentor)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D11485
2017-07-07 06:37:19 +00:00
Konstantin Belousov
e967aa2682 Improve BIT_FLS() documentation.
Submitted by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after:	6 days
2017-07-07 05:43:44 +00:00
Xin LI
95595f99b9 - Use strlcat() instead of strncat().
- Use asprintf() and handle allocation errors.

Reviewed by:	kevlo
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D11486
2017-07-07 02:48:55 +00:00
Rick Macklem
3ab05e8674 Document the changes done to nfsuserd by r320757.
This is a content change.
2017-07-06 22:34:34 +00:00
Rick Macklem
77193c0508 Modify the nfsuserd daemon so that it uses an AF_LOCAL socket for upcalls.
This patch modifies the nfsuserd daemon so that it uses an AF_LOCAL socket
for upcalls by default. This should fix the problem with using a UDP
socket upcall to 127.0.0.1 when jails are used.
The AF_LOCAL socket case only supports a single server daemon, since hangs
were observed by the original problem reporter when multiple daemons
were used.
The patch adds a command line option called "-use-udpsock" which makes
the daemon revert to its prepatched behaviour.

Suggested by:	dfr
PR:		205193
Relnotes:	yes
2017-07-06 22:04:37 +00:00
Konstantin Belousov
1550c62236 Add BIT_FLS() analogous to BIT_FFS().
The benefit of BIT_FLS() is that ffsl() can be implemented with a
count leading zeros instruction which is more widespread available.

Submitted by:	Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after:	1 week
2017-07-06 21:47:17 +00:00
Kyle Evans
26e1c38fbb Update copyright e-mail address to @FreeBSD.org address
Approved by:	emaste (mentor)
Differential Revision:	https://reviews.freebsd.org/D11508
2017-07-06 19:53:30 +00:00
Kyle Evans
3ea376f690 Fix sparc64 libc build after r320742.
p_branch_empty was declared but never used due to an oversight. Use it as
designed, further comment on its return value.

Reported by:	Jenkins (head-sparc64)
Reviewed by:	emaste
Approved by:	emaste (mentor)
MFC with:	r320742
Differential Revision:	https://reviews.freebsd.org/D11506
2017-07-06 18:21:30 +00:00
Glen Barber
8f229143b1 Allow passing NOPKG= to make(1) to prevent the pkg-stage target
from getting executed.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2017-07-06 17:54:03 +00:00
Ian Lepore
a14af83085 Fix drivers that assume ticks starts at zero. These drivers all have logic
similar to "if (ticks > localvar+interval) {localvar=ticks; ...}" where
localvar is initialized to zero.  Ticks is initialized to a negative value
since r278230, and that leads to these if statements never being true.
2017-07-06 17:03:22 +00:00
Kyle Evans
15ae9efabe The impending libregex will implement GNU extensions to bring BREs and
EREs closer together. Prepare for this and reduce the diff of libregex changes by
refactoring and combining the top-level parsers for EREs/BREs ahead of time.

Branching functionality has been split out to make it easier to follow the combined
version of the top-level parser. It may also be enabled in the parsing context to make
it easier when libregex enables branching for BREs.

A branching context was also added for the various branching functions and so that
BREs, for instance, can determine if they're the first expression in a chain of expressions
within the current branch and treat '*' as ordinary if so.

This should have no functional impact and negligible performance impact.

Reviewed by:	cem, emaste, pfg
Approved by:	emaste (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D10920
2017-07-06 17:01:51 +00:00
Edward Tomasz Napierala
81e12dd187 Make ^c work in ddb(4).
Obtained from:	CheriBSD
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-07-06 15:27:34 +00:00
Edward Tomasz Napierala
eeb6101e04 Make ^w work in ddb(4).
Obtained from:	CheriBSD
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-07-06 15:21:57 +00:00
Edward Tomasz Napierala
a71f4ea813 Make ddb(4) disassembler (x/i) use n32 register names.
Obtained from:	CheriBSD
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-07-06 15:08:51 +00:00
Andrew Gallatin
a5169546ee Simplify UIO_SYSSPACE and UIO_NOCOPY paths in uiomove
Uiomove can only block when the segflag is UIO_USERSPACE,
otherwise we end up just doing a bcopy (or nothing) and
moving cursors. So only emit witness warnings and
set deadlock thread flags in the UIO_USERSPACE case.

Reviewed by:	kib
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D11489
2017-07-06 15:03:54 +00:00
Alan Somers
eaca103d94 Fix cleanup in lib/libc/gen/setdomainname_test
ATF cleanup routines run in separate processes from the tests themselves, so
they can't share global variables.

Also, setdomainname_test needs to be is_exclusive because the test cases
access a global resource.

PR:		219967
Reviewed by:	ngie
MFC after:	3 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D11188
2017-07-06 14:47:59 +00:00
Ed Maste
f5d0a8f7c7 acpidump: warn and exit loop on invalid subtable length
Submitted by:	Guangyuan Yang <yzgyyang@outlook.com>
Sponsored by:	The FreeBSD Foundation
2017-07-06 14:35:47 +00:00
Ed Maste
d9ad2b357b compiler_rt: provide bswap buildins on sparc64
Attempting to build sparc64 world with GCC 6.3 previously failed with
zstd_compress.c:(.text+0x8fc): undefined reference to `__bswapsi2'
2017-07-06 13:27:01 +00:00
Edward Tomasz Napierala
9990da25ea Improve ddb(4) error reporting a bit.
Obtained from:	CheriBSD
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-07-06 12:30:39 +00:00
Edward Tomasz Napierala
b5bd6c7383 Make ddb(4) a bit more user-friendly by improving "help".
Obtained from:	CheriBSD
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-07-06 12:27:14 +00:00
Bartek Rutkowski
2669f7ebf1 usr.sbin/bsdinstall/scripts/hardening: fix options numbers
Submitted by:	Bartek Rutkowski <robak@FreeBSD.org>
Reviewed by:	bapt
Approved by:	bapt
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D11505
2017-07-06 12:19:15 +00:00
Alexander Motin
321728cef1 Report device descr in addition to ident.
Serial number without device model is somewhat less useful.

MFC after:	2 weeks
2017-07-06 09:05:38 +00:00
Alexander Motin
1631690677 Add GEOM::descr attribute for symmetry with GEOM::ident.
MFC after:	2 weeks
2017-07-06 08:36:14 +00:00
Enji Cooper
13464e4a44 Chase upstream change deprecating LIBXO_OPTIONS similar to r320521
LIBXO_OPTIONS was deprecated in favor of the --libxo options.

Inspired by:	https://github.com/Juniper/libxo (02272d5c6d7d)
2017-07-06 08:05:57 +00:00
Enji Cooper
1c227d0049 :snprintf_float: don't blindly set RLIMIT_DATA and RLIMIT_AS to 1 MB -- raise
the limit to 32MB instead.

Require user=root and memory=64MB+ first so one can be reasonably sure that
the test will function appropriately.

MFC after:	1 month
MFC with:	r320726
PR:	220502
2017-07-06 07:59:00 +00:00
Enji Cooper
1f73e6d888 Expect :snprintf_float to segfault
This issue started occurring within the past month or so.

PR:	220502
Reported by:	Jenkins (amd64-head job)
2017-07-06 07:45:20 +00:00
Andriy Voskoboinyk
c5ad99fc69 rtwn: add Rx descriptor structures for common code.
Remove any chipset specific usage of Rx descriptor structure / bits
from common code to prevent misuse of fields that may differ
between various chipsets.

Checked with: 	RTL8821AU in STA mode.
2017-07-06 07:37:33 +00:00
Enji Cooper
faef91fab6 :l_flag:: be more aggressive when normalizing whitespace
Save output from ls -ldT and stat -l, then normalize all repeating whitespace using
sed to single column spaces.

This makes the test flexible with single-digit days, etc, similar to r320723. This
approach is just a bit more of a hammer approach because of how the columns are
ordered/spaced in both ls and stat.

MFC after:	1 week
MFC with:	r319841
2017-07-06 07:37:03 +00:00
Enji Cooper
5e8e7af348 Use %e instead of %d with x_output_date(..)
stat -x doesn't 0-fill days so %d is inappropriate. %e is correct.

MFC after:	1 week
MFC with:	r319841
2017-07-06 06:15:44 +00:00
Enji Cooper
5c021049f0 Regenerate src.conf(5) 2017-07-06 05:43:04 +00:00
Enji Cooper
92d1d8a571 Add WITH_RCMDS for parity with WITHOUT_RCMDS 2017-07-06 05:40:51 +00:00