Commit Graph

239455 Commits

Author SHA1 Message Date
Gleb Smirnoff
938864b71b Allow some nesting of ng_iface(4) interfaces and add a configuration knob.
PR:		235500
MFC after:	1 week
2019-02-08 06:19:28 +00:00
Konstantin Belousov
7cdb0b9d82 Fix renameat(2) for CAPABILITIES kernels.
When renameat(2) is used with:
- absolute path for to;
- tofd not set to AT_FDCWD;
- the target exists
kern_renameat() requires CAP_UNLINK capability on tofd, but
corresponding namei ni_filecap is not initialized at all because the
lookup is absolute.  As result, the check was done against empty filecap
and syscall fails erronously.

Fix it by creating a return flags namei member and reporting if the
lookup was absolute, then do not touch to.ni_filecaps at all.

PR:	222258
Reviewed by:	jilles, ngie
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
X-MFC-note:	KBI breakage
Differential revision:	https://reviews.freebsd.org/D19096
2019-02-08 04:18:17 +00:00
Konstantin Belousov
6f26dd50c3 do_execve(): lock vnode when needed.
Code after exec_fail_dealloc label expects that the image vnode is
locked if present.  When copyout() of the strings or auxv vectors fails,
goto to the error handling did not relocked the vnode as required.

The copyout() can be made failing e.g. by creating an ELF image with
PT_GNU_STACK segment disabling the write.

Reported by:	Jonathan Stuart <n0t.jcs@gmail.com> (found by fuzzing)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2019-02-08 04:06:48 +00:00
Navdeep Parhar
c0a248ef93 cxgbev(4): Initialize debug_flags from the environment like in the PF driver. 2019-02-08 03:31:38 +00:00
Brooks Davis
60835849e5 GC a historical artifact.
Back in 1993, the fgetln (then fgetline) interface was changed to not
return a C string.  The change was accomplished by ifdefing out the code
that did the termination.  Changing the interface would violate our API
stability rules so remove the old implementation.

Sponsored by:	DARPA, AFRL
2019-02-07 23:17:44 +00:00
Sean Eric Fagan
18bb746b40 r343881 had an uninitialized error. This fixes that.
PR:             233849
Reported by:    Andre Albsmeier
MFC after:      1 month
Sponsored by:   iXsystems Inc
Differential Revision:  https://reviews.freebsd.org/D18785
2019-02-07 22:10:20 +00:00
Sean Eric Fagan
148d31b83d r339008 broke repquota for UFS. This rectifies that.
Refactor the function calls and tests so that, on UFS, the proper fields
are filled out.

PR:		233849
Reported by:	Andre Albsmeier
Reviewed by:	mav, delphij
MFC after:	1 month
Sponsored by:	iXsystems Inc
Differential Revision:	https://reviews.freebsd.org/D18785
2019-02-07 21:51:39 +00:00
Bryan Drewery
10e3bebf9e Fix build of r343877
MFC after:	2 weeks
X-MFC-with:	r343877
Pointyhat to:	bdrewery
2019-02-07 21:41:27 +00:00
Bryan Drewery
2b3d664738 ipfw table list: Fix showing header outside of 'all'.
Properly pass down is_all to table_show_list().  This restores the behavior
before r272840 so that only 'ipfw table all list' shows the headers.

MFC after:	2 weeks
Relnotes:	yes
2019-02-07 21:05:44 +00:00
Andrew Turner
4f33c38083 Add missing data barriers after storeing a new valid pagetable entry.
When moving from an invalid to a valid entry we don't need to invalidate
the tlb, however we do need to ensure the store is ordered before later
memory accesses. This is because this later access may be to a virtual
address within the newly mapped region.

Add the needed barriers to places where we don't later invalidate the
tlb. When we do invalidate the tlb there will be a barrier to correctly
order this.

This fixes a panic on boot on ThunderX2 when INVARIANTS is turned off:
panic: vm_fault_hold: fault on nofault entry, addr: 0xffff000040c11000

Reported by:	jchandra
Tested by:	jchandra
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D19097
2019-02-07 20:58:45 +00:00
Andrew Turner
8308d2a251 Add a missing data barrier to the start of arm64_tlb_flushID.
We need to ensure the page table store has happened before the tlbi.

Reported by:	jchandra
Tested by:	jchandra
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D19097
2019-02-07 20:50:39 +00:00
Emmanuel Vadot
057c416c9b mtree: Add dtb subdir to the mtree file
makefs will fails otherwise

Reported by:	emaste
MFC after:	1 week
2019-02-07 18:54:25 +00:00
Emmanuel Vadot
bcdb59e767 arm64: dtb: allwinner: Add the new pine64-lts dtb file to the build
MFC after:	1 month
X-MFC-With:	r342936
2019-02-07 18:07:17 +00:00
Leandro Lupori
59a8224976 [ppc64] fix /dev/kmem
For direct mapped kernel addresses, ppc64 function was not
performing the dmap to physical conversion, before jumping
to the code that fetched the value from physical memory.

Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D19086
2019-02-07 17:30:44 +00:00
Andriy Voskoboinyk
ec835c9dec recoverdisk(1): fclose() file supplied via '-r readlist' parameter when
it's no longer needed

PR:		204952
Reported by:	David Binderman <dcb314@hotmail.com>
MFC after:	5 days
2019-02-07 14:40:28 +00:00
Andriy Voskoboinyk
558fe07149 ipcs(1): drop obsolete error checking
This code is not reached since r77551.

PR:		201728
MFC after:	5 days
2019-02-07 14:29:45 +00:00
Ed Maste
f0cdb4cbc8 Mention clang-format in WITH_CLANG_EXTRAS
It's a useful tool and gives a further hint at the types of additional
binaries enabled by the option.
2019-02-07 14:05:21 +00:00
Andriy Voskoboinyk
984aff2894 Correct ypldap(8) install path in OptionalObsoleteFiles.inc
It's installed to /usr/sbin, not to /usr/bin (and was always here).

While here, add missing manpages and /var/yp directory to the list.

MFC after:	1 week
2019-02-07 13:12:43 +00:00
Vincenzo Maffione
1ef2a88149 netmap: revert netmap_attach_ext() to pre-r343772
Reported by:	marius
MFC after:	1 week
2019-02-07 11:28:53 +00:00
Navdeep Parhar
644b22ae36 cxgbe(4): Auto-dump the CIM block's logic analyzer on a TIMER0 interrupt.
Sponsored by:	Chelsio Communications
2019-02-07 05:40:51 +00:00
Navdeep Parhar
286fd42ba6 cxgbe(4): Auto-dump the device log on a mailbox timeout or when the
firmware reports an error in pcie_fw.

Sponsored by:	Chelsio Communications
2019-02-07 05:06:29 +00:00
Jayachandran C.
13607f6db5 pci_host_generic_acpi: use IORT data for MSI/MSI-X
Use the information from IORT parsing to translate the PCI RID to
GIC ITS device ID. And similarly, use the information to find the
PIC XREF identifier to be used for PCI devices.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D18004
2019-02-07 04:50:16 +00:00
Konstantin Belousov
fd90aeaabd Add comment noting that the strange spelling of GenuineIntel is for reason.
Requested by:	rpokala
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-02-07 03:58:29 +00:00
Gleb Smirnoff
ad66f95865 Now that there is only one way to allocate a slab, remove uz_slab method.
Discussed with:	jeff
2019-02-07 03:55:05 +00:00
Gleb Smirnoff
b47acb0a4d Report cache zones in UMA stats sysctl, that 'vmstat -z' uses. This
should had been part of r251826.
2019-02-07 03:32:45 +00:00
Jayachandran C.
73d8c81f38 arm64 gicv3: add IORT and NUMA support
acpi_iort.c has added support to query GIC proximity and MSI XREF
ID for GIC ITS blocks. Use this when GIC ITS blocks are initialized
from ACPI.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D18003
2019-02-07 03:01:54 +00:00
Konstantin Belousov
5925a98339 Use ifunc to select the barrier instruction for RDTSC.
This optimizes out runtime switch and removes yet another cpuid from
libc.

Note that this is the first use of ifunc in i386 libc, so
ifunc-capable toolchain is required for building runnable userspace on
i386, same as on amd64.

Discussed with:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-02-07 02:56:10 +00:00
Jayachandran C.
9088a4751c arm64 acpi: Add support for IORT table
Add new file arm64/acpica/acpi_iort.c to support the "IO Remapping
Table" (IORT). The table is specified in ARM document "ARM DEN 0049D"
titled "IO Remapping Table Platform Design Document".  The IORT table
has information on the associations between PCI root complexes, SMMU
blocks and GIC ITS blocks in the system.

The changes are to parse and save the information in the IORT table.
The API to use this information is added to sys/dev/acpica/acpivar.h.

The acpi_iort.c also has code to check the GIC ITS nodes seen in the
IORT table with corresponding entries in MADT table (for validity)
and with entries in SRAT table (for proximity information).

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D18002
2019-02-07 02:30:33 +00:00
Konstantin Belousov
eb785fab3b Port sysctl kern.elf32.read_exec from amd64 to i386.
Make it more comprehensive on i386, by not setting nx bit for any
mapping, not just adding PF_X to all kernel-loaded ELF segments.  This
is needed for the compatibility with older i386 programs that assume
that read access implies exec, e.g. old X servers with hand-rolled
module loader.

Reported and tested by:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-02-07 02:17:34 +00:00
Konstantin Belousov
f76b5ab6cc Fix resume on i386 PAE.
It was broken before PAE/no-PAE merge, but since now PAE is the
default, resume is apparently becomes for all machines.

The corrected issues:
- the trampoline page is not mapped executable, so machine faults when
  paging is on;
- MSR.EFER and %cr4 both should be loaded before paging is enabled,
  otherwise paging structures are invalid (cr4.PAE and EFER.NX).
- MSR.EFER and %cr4 should be only loaded if present.  I attempt to handle
  this by not touching the registers if the value is zero.

There are some more bits still not quite correct, e.g. unconditional
access to %cr4 in resumectx.

Reported and debugging help by:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2019-02-07 02:09:34 +00:00
Konstantin Belousov
d22ff6e6a2 contigmalloc: handle M_EXEC.
Reviewed by:	alc, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D19092
2019-02-07 02:00:23 +00:00
Enji Cooper
04d6e324fc Clean up all directories created by make hier
The logic I introduced in r322511 unfortunately left chflags schg'ed
directories behind created by `make hier` (in the stock /etc/mtree
files, this is limited to /var/empty).

The proposed change calls `chflags -R 0` and `rm -Rf ...` to clean all
of the directories that could not be removed by `${MAKE} clean`.
`${MAKE} clean` in bsd.obj.mk calls `cleandir`/`cleanobj`, which handles
the first directory tree walk/removal.

Approved by:	emaste (mentor)
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D18641
2019-02-06 21:24:44 +00:00
Gavin Atkinson
afa9b0368f Support the Lenovo OneLink in ure(4).
MFC after:	1 week
2019-02-06 20:18:22 +00:00
Ed Maste
ac979af451 riscv: default to non-executable stack
There's no need to worry about potential backwards compatibility issues
in a brand-new architecture, so avoid stack PROT_EXEC as with arm64.

Discussed with:	br
2019-02-06 19:22:15 +00:00
Ed Maste
0235d5e283 vtfontcvt: whitespace cleanup
PR:		205707
Submitted by:	Dmitry Wagin
2019-02-06 18:50:48 +00:00
Ed Maste
e26563b8c7 Retire SPX_HACK option unused after r342244 2019-02-06 17:21:25 +00:00
Ed Maste
26fcd29066 Retire CTM option after r342126 2019-02-06 16:30:08 +00:00
Andriy Voskoboinyk
545619f3f2 net80211(4): validate supplied roam:rate values from ifconfig(8)
MFC after:	4 days
2019-02-06 13:01:21 +00:00
Michal Meloun
64d41eddd7 Adapt FreeBSD specific DT stub for Jetson TK1 board to be consistent with
update of devicetree to 4.19 in r340337.
Our build system doesn't provide dependencies for included DTS files, so
nobody noticed this issue for long time.

PR:		235362
MFC after:	1 week
2019-02-06 06:03:44 +00:00
Jason A. Harmening
f048354550 r341692 changed cap_syslog(3) to preserve the stdio descriptors inherited
from its parent so that LOG_PERROR would work.  However, this caused
dhclient(8)'s stdio streams to remain open across daemonization, breaking
the ability to capture its foreground output as done in netconfig_ipv4.

Fix this by reverting r341692 and instead passing the parent's stderr
descriptor as an argument to cap_openlog() only when LOG_PERROR is specified
in logopt.

PR:	234514
Suggested by:	markj
Reported by:	Shawn Webb
Reviewed by:	markj, oshogbo
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D18989
2019-02-06 04:36:28 +00:00
Yuri Pankov
d70ad055e0 pwm.8: fix markup in synopsis, add -f description
Reviewed by:	bcr, manu
Differential revision:	https://reviews.freebsd.org/D18829
2019-02-06 04:00:37 +00:00
Yuri Pankov
6ef91a2136 pwm.9: fix markup in interfaces description
Reviewed by:	manu
Differential revision:	https://reviews.freebsd.org/D18830
2019-02-06 03:57:51 +00:00
Justin Hibbits
4290b4b849 powerpc: Bind IRQs to only one interrupt on QorIQ SoCs
The QorIQ SoCs don't actually support multicast interrupts, and the
references state explicitly that multicast is undefined behavior.  Avoid the
undefined behavior by binding to only a single CPU, using a quirk to
determine if this is necessary.

MFC after:	3 weeks
2019-02-06 03:52:14 +00:00
Andriy Voskoboinyk
61b38ede81 iwn(4): plug initialization path vs interrupt handler races
There are few places in interrupt handler where the driver
lock is dropped; ensure that device is still running before
processing remaining ring entries.

PR:		192641
MFC after:	5 days
2019-02-06 01:34:14 +00:00
Warner Losh
a49077d365 Add quirk for Sansisk X400 drives
Certain versions of Sandisk x400 firmware can hang under extremely
heavly load of large I/Os for prolonged periods of time. Newer /
current versions work fine, and should be used where possible. Where
not possible, this quirk ensures that I/O requests are limited to 128k
to avoids the bug, even under extreme load. Since MAXPHYS is 128k,
only users with custom kernels are at risk on the older firmware.
Once all known users of the older firmware have upgraded, this quirk
will be removed.

Sponsored by: Netflix, Inc.
2019-02-05 22:53:36 +00:00
Warner Losh
e9f9c34796 Remove obsolete controller
We removed support for the super-old samsung s3xxxx parts, but this is
a straggler. Remove it too.
2019-02-05 21:37:45 +00:00
Warner Losh
d3f1313287 Remove All Rights Reserved
Remove the all rights reserved clause from my copyright, and make
other minor tweaks needed where that might have created ambiguity.
2019-02-05 21:37:34 +00:00
Warner Losh
8590b14e9d Remove a few stray "All Rights Reserved." declarations on stuff I've
written.
2019-02-05 21:28:29 +00:00
Konstantin Belousov
2648ed9275 Make it possible to override PAE mode on boot.
Initialize the static kenv in pmap_cold() and fetch user opinion on
vm.pmap.pae_mode tunable if hardware is capable.  Note that the static
environment is reinitilized in init386() later when paging is enabled.

Reviewed by:	bde
Discussed with:	kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	2 months
2019-02-05 20:09:31 +00:00
Konstantin Belousov
c7301c6b2c Remove pointless initial value for i386 vm.pmap.pat_works sysctl definition.
The OID is served by external data.

Submitted by:	bde
MFC after:	3 days
2019-02-05 20:02:16 +00:00