Commit Graph

228291 Commits

Author SHA1 Message Date
Warner Losh
700b6f8e23 When building standalone, include stand.h rather than the kernel
includes or the userland includes.

Sponsored by: Netflix
2017-12-05 21:37:32 +00:00
Bryan Drewery
9b43e3da5e native-xtools: Ensure GCC files are cleaned up.
Because we force enable MK_GCC when building we need to also force
enable it for the cleaning phase.  Otherwise the NXB_TARGET files
are found in the next build's kernel-toolchain phase and cause
an error.

Reported by:	sbruno
X-MFC-With:	r325001
MFC after:	1 month
Sponsored by:	Dell EMC
2017-12-05 21:36:08 +00:00
Bryan Drewery
154733e844 Deal with bmake-20170301 no longer resolving -C like it used to.
Several checks assume .CURDIR is resolved, such as for determining RELDIR from
SRCTOP/.CURDIR.  If -C is used then the path is no longer resolved like it was
before which is problematic for symlinked source trees.  A similar change was
also made to ports post bmake-20170301.

This fixes 'make -C <symlinked path> buildworld' using the wrong OBJDIR.

Reported by:	rstone
Sponsored by:	Dell EMC
2017-12-05 21:30:22 +00:00
Bryan Drewery
302bf4c180 Handle writable-but-not-a-directory cases for writable OBJDIR check.
Sponsored by:	Dell EMC
2017-12-05 21:30:17 +00:00
Bryan Drewery
e22224a5c2 AUTO_OBJ: For all top-level targets enforce using an OBJDIR.
This will cause an error if the wanted OBJDIR is not writable.  Previously it
would cause the files to generate to the source tree.  This was too obscure and
things like buildworld really expect a proper OBJDIR layout.

Sponsored by:	Dell EMC
2017-12-05 21:29:47 +00:00
Emmanuel Vadot
34b8ef3d77 Allwinner H5: Enhance support
Add proper gpio and clock support
2017-12-05 21:21:23 +00:00
Stephen Hurd
d14c853ba3 iflib: Support to padding Ethernet frames to a min size
Some bnxt devices do not correctly send frames smaller than
52 bytes (without CRC), so add a quirk that will pad frames to an
arbitrary size before passing off to the encap routine.

Reported by:	Bhargava Chenna Marreddy <bhargava.marreddy@broadcom.com>
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D13269
2017-12-05 21:00:31 +00:00
Stephen Hurd
fe1bcada9b Avoid calling CURVNET_[SET|RESTORE] for each packet
The LRO possible test was calling CURVNET_SET once for IPv4 or IPv6 for
each packet in a chain. Only call it once per chain instead.

Submitted by:	Matthew Macy <mmacy@mattmacy.io>
Reviewed by:	cem, ae
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D13368
2017-12-05 20:43:24 +00:00
Ed Maste
19164ee6cd use @@@ instead of @@ in __sym_default
Using
    .symver foo,foo@@VER
causes foo and foo@@VER to be output to the .o file. This requires foo
to be weak since the linker handles foo@@VER as foo.

Using
    .symver foo,foo@@@VER
causes just foo@@ver to be output and avoid the need for making foo
weak. It also reduces the constraint on how exactly a linker has to
handle foo and foo@@VER being present.

Submitted by:	Rafael Espíndola
Reviewed by:	dim, kib
Differential Revision:	https://reviews.freebsd.org/D11653
2017-12-05 20:19:13 +00:00
Cy Schubert
ca94a1c6ca Fix build after r326554; reconnect sponge to build again. 2017-12-05 20:06:53 +00:00
Gleb Smirnoff
65547fb33d Generate fully RFC3164 compliant messages, with timestamp and hostname.
Allow to set hostname to any string with -H.

MFC after:	2 months
2017-12-05 19:55:53 +00:00
Gleb Smirnoff
50387adce2 When parsing remote messages, require them to have standard timestamp
field, and support properly parse out the hostname as described by RFC3164,
which wasn't done before.  However, don't discard message if it doesn't
have hostname, for compatibility.

Enable logging of the message supplied hostname instead of real hostname
with -H switch.

PR:		200933
Reported by:	Konstantin Pavlov <thresh nginx.com>
MFC after:	2 months
2017-12-05 19:54:55 +00:00
Conrad Meyer
08f16d0c01 ioat(4): Add Skylake Xeon PCI-ID
SKX IOAT is just another 3.2 version of the CBDMA engine.

Submitted by:	Deepak Veliath <deepak.veliath AT isilon.com>
Sponsored by:	Dell EMC Isilon
2017-12-05 18:48:58 +00:00
Eric Joyner
b0f3e715fa ifconfig(8): Display extended compliance code string for SFP transceivers
- Updates tables in affected files with new entries from newer spec
revisions of SFF-8472, SFF-8024, and SFF-8636

- Change ifconfig to read and display the extended compliance code for
SFP media if the extended compliance code is not 0. This was being displayed
for QSFP transceivers only, but SFP28 media uses this to report 25G
capability.

Reviewed by:	melifaro, sbruno
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D13286
2017-12-05 18:42:07 +00:00
Dimitry Andric
8b9fd94981 For now, disconnect usr.bin/sponge from the build, to unbreak world
after r326557.

Noticed by:	many
Pointy hat to:	eadler
2017-12-05 18:26:34 +00:00
Bryan Drewery
488adf43d4 Fix cyclic dependency after r326552.
The OBJS_DEPEND_GUESS mechanism was making vmx_genassym.o depend
on all headers along with vmx_assym.h, though vmx_assym.h depends
on having vmx_genassym.o present to generate.  Moving the headers
to DPSRCS is enough to resolve the issue as they will no longer
be implicit dependencies for all objects.  Because of this we
need explicit OBJS_DEPEND_GUESS entries to ensure the headers
are generated when needed for the *_support.o files that need
them.

X-MFC-With:	r326552
MFC after:	2 weeks
Sponsored by:	Dell EMC
2017-12-05 17:23:33 +00:00
Andriy Gapon
6e1c5d187c ddb: fix validation of cpu id in 'set db_cpu=x'
MFC after:	1 week
2017-12-05 14:22:08 +00:00
Cy Schubert
d1755e2845 Fix cut & paste error from r326558.
Reported by:	ed
MFC after:	1 week
X-MFC with:	r326558
Pointy hat to:	cy
2017-12-05 13:41:21 +00:00
Colin Percival
4a93691064 Make EC2 instances use Amazon's NTP service for time synchronization.
Since Amazon provides NTP servers within their network, this should
be far superior to using the default NTP pools; and since the service
is provided by Amazon there's very little risk in enabling it by
default.  (If someone is able to compromise Amazon's NTP servers and
exploit them to attack EC2 instances, they would almost certainly be
able to compromise EC2 instances even without ntpd running...)

MFC after:	1 week
Relnotes:	EC2 instances now keep their clocks synchronized using
		the Amazon Time Sync Service (aka. NTP).
2017-12-05 09:22:14 +00:00
Colin Percival
4ba35bc4db Resurrect r321659: Turn off ChallengeResponseAuthentication for EC2 AMIs.
EC2 instances are normally launched with an SSH public key specified,
which is then used for logging in (by default, as 'ec2-user').  Having
ChallengeResponseAuthentication enabled (as FreeBSD's default sshd_config
does) has no functional effect in a new EC2 instance, since you can't log
in using a password until a password has been set -- but having this
enabled results in alerts from automated scanning tools which can detect
that sshd advertises support for keyboard-interactive logins (since they
can't detect that accounts have no password set).

EC2 users who want to use passwords to log in to their instances will need
to set 'ChallengeResponseAuthentication yes' in FreeBSD 12.0 and later.

Discussed with:	gjb, gtetlow, emaste, des
Requested by:	Amazon
X-MFC:		No
Relnotes:	ChallengeResponseAuthentication is turned off by default in
		Amazon EC2 AMIs.
2017-12-05 09:08:48 +00:00
Hans Petter Selasky
be28698cf2 Correctly prefix the infiniband include directory for buildworld. This fixes
the OFED buildworld target, WITH_OFED=YES, when the include files are not
already installed locally, but only in the temporary object directory.

Found by:	kib
Sponsored by:	Mellanox Technologies
2017-12-05 08:25:17 +00:00
Xin LI
69097cd8da Use strlcpy().
MFC after:	2 weeks
2017-12-05 07:21:47 +00:00
Xin LI
aff7b6c709 Use strlcpy().
MFC after:	2 weeks
2017-12-05 07:11:56 +00:00
Xin LI
807e955710 Create links for xzdiff.
MFC after:	2 weeks
2017-12-05 07:01:10 +00:00
Cy Schubert
4451f1426c fdformat is a sysadmin command and thus its man page should be in
volume 8 instead of volume 1.

Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D13370
2017-12-05 05:02:46 +00:00
Eitan Adler
8d4a7aab40 sponge(1): fix my tests
Reviewed by:	kevans
2017-12-05 04:43:39 +00:00
Alan Somers
95639a80ef dc(1): fix input of non-decimal fractional numbers
Inputting fractional non-decimal numbers has never worked correctly in our
OpenBSD-derived dc(1). It truncates the input to a number of decimal places
equal to the number of hexadecimal (or whatever base) places given on the
input. That's unacceptable, because many numbers require more precision to
represent in base 10 than in their original bases.

Fix this bug by using as many decimal places as needed to represent the
input, up to the maximum of the global scale factor.

This has one mildly surprising side effect: the scale of a number entered in
non-decimal mode will no longer necessarily equal the number of hexadecimal
(or whatever base) places given on the input. I think that's an acceptable
behavior change, given that inputting fractional non-decimal numbers never
worked in the first place, and the man page doesn't specify whether trailing
zeros on the input should affect a number's scale.

PR:		206230
Reported by:	nibbana@gmx.us
Reviewed by:	pfg
Differential Revision:	https://reviews.freebsd.org/D13336
2017-12-05 04:22:35 +00:00
Eitan Adler
cea266bd9f sponge(1) Minor commit for commit log
Differential Revision:	https://reviews.freebsd.org/D12900
RelNotes:		yes
2017-12-05 03:57:51 +00:00
Eitan Adler
7202e5e8f6 sponge(1): initial commit
sponge(1) is a utility that reads input until
complete, then opens the output file, then
writes to it. This makes it useful in pipelines
that read and write to the same file.

Reviewed by:	wblock, jilles, imp, cem, danfe (all: various iterations)
Inspired by:	https://joeyh.name/code/moreutils/
2017-12-05 03:55:10 +00:00
Bryan Drewery
4a51c7085e native-xtools: Fix build without META_MODE for GCC archs.
The initial kernel-toolchain is built with TARGET=MACHINE but
we want GCC to have files generated for TARGET=NXB_TARGET
instead later on.  Just clean the files between building of
the toolchain and nxb binaries which will let it rebuild
when needed.

Reported by:	sbruno
X-MFC-With:	r325001
MFC after:	1 month
Sponsored by:	Dell EMC
2017-12-05 02:23:36 +00:00
Bryan Drewery
a854949ff1 Fix DPSRCS not getting .depend.* files.
Reported by:	jhb
MFC after:	2 weeks
Sponsored by:	Dell EMC
2017-12-05 02:23:33 +00:00
Bryan Drewery
649fed8e37 Allow Makefiles to append to DEPENDSRCS.
Sponsored by:	Dell EMC
2017-12-05 02:23:30 +00:00
Bryan Drewery
7cc780d771 DEPENDSRCS not used here.
Sponsored by:	Dell EMC
2017-12-05 02:23:27 +00:00
Bryan Drewery
b4585565d5 Rename DEPENDFILES_OBJS to DEPENDFILES.
This is to be consistent with bsd.dep.mk using DEPENDFILES after
r325677.

Sponsored by:	Dell EMC
2017-12-05 02:23:23 +00:00
Ed Maste
a6aca65caf lld: make -v behave similarly to GNU ld.bfd
Previously, lld exited with an error status if the only option given to
the command was -v. GNU linkers gracefully exit in that case. This patch
makes lld behave like GNU.

Note that even with this patch, lld's -v and --version options behave
slightly differently than GNU linkers' counterparts. For example,
if you run ld.bfd -v -v, the version string is printed out twice.
But that is an edge case that I don't think we need to take care of.

Fixes https://bugs.llvm.org/show_bug.cgi?id=31582

Obtained from:	LLVM r319717
MFC after:	1 week
2017-12-05 01:47:41 +00:00
Rick Macklem
b07bc39a23 Avoid the overhead of acquiring a lock in nfsrv_checkgetattr() when
there are no write delegations issued.

manu@ reported on the freebsd-current@ mailing list that there was
a significant performance hit in nfsrv_checkgetattr() caused by
the acquisition/release of a state lock, even when there were no
write delegations issued.
This patch add a count of outstanding issued write delegations to the
NFSv4 server. This count allows nfsrv_checkgetattr() to return without
acquiring any lock when the count is 0, avoiding the performance hit
for the case where no write delegations are issued.

Reported by:	manu
Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D13327
2017-12-04 21:50:27 +00:00
Emmanuel Vadot
eb1eebb9aa Allwinner: Add H5 compatible to aw_ccu
Recent DTS (from Linux 4.14) specify a compatible "allwinner,sun50i-h5-ccu"
for H5 SoC. Since we get the DTB from u-boot this wasn't noticed.
Add the compatible so later version of u-boot will not fail for us.
2017-12-04 20:45:15 +00:00
Andriy Gapon
a7437a3e9d amd-vi: set iommu msi configuration using pci_enable_msi method
This is better than directly changing PCI configuration space of the
device because it makes the PCI bus aware of the configuration.
Also, the change allows to drop a bunch of code that duplicated
pci_enable_msi() functionality.

I wonder if it's possible to further simplify the code by using
pci_alloc_msi().
2017-12-04 17:10:52 +00:00
Andriy Gapon
df92c28d6a vmm/amd: add ivhd device with a higher order
ivhd should attach after the root PCI bus and, thus, after the ACPI
Host-PCI bridge off which the bus hangs.  This is because ivhd changes
PCI configuration of a PCI IOMMU device that is located on the root bus.
If the bus attaches after ivhd it clears the MSI portion of the
configuration.  As a result IOMMU event interrupts would never be
delivered.

For regular ACPI devices the order is calculated as
    ACPI_DEV_BASE_ORDER + level * 10
where level is a depth of the device in the ACPI namespace.
I expect the depth of the Host-PCI bridge to be two or three,
so ACPI_DEV_BASE_ORDER + 10 * 10 should be a sufficiently safe order
for ivhd.

This should fix the setup of the AMD-Vi event interrupt when vmm is
preloaded (as opposed to kldload-ed).
2017-12-04 17:08:03 +00:00
Andriy Gapon
8f09494d1e amd-vi: clear event interrupt and overflow bits upon handling the interrupt
This ensures that we can receive further event interrupts.
See the description of the bits in the specification for
MMIO Offset 2020h IOMMU Status Register.
The bits are defined as set-by-hardware write-1-to-clear, same as all
the bits in the status register.

Discussed with:	anish
2017-12-04 17:02:53 +00:00
Warner Losh
1f99cce2b0 Just use the last line of the output from getting .OBJDIR. The
buildenv target prints other stuff too that needs to be ignored.

Sponsored by: Netflix
2017-12-04 16:38:20 +00:00
Emmanuel Vadot
aabe1bb37a dts: arm: Remove imx6 related dts
Everything should work with dts from sys/gnu/dts

Discussed with:	ian
2017-12-04 13:28:56 +00:00
Baptiste Daroussin
625490e842 Only skip looking for manpages if both man directory and cat directory
are not existing.

This allows man(1) to read catpages when no man directories are available at all

PR:		223559
Reported by:	wosch
MFC after:	3 days
2017-12-04 12:51:05 +00:00
Baptiste Daroussin
d9405a926c In case man(1) found a catpage to display skip looking ".so" which is manpage
only.

In case we are trying to read a catpage, the manpage variable is not defined.
It results in the "cattool" having no arguments.

In case the catpage is compressed, the cattool used is "zcat" which dies if the
standard input is a terminal, meaning the function calling it is exiting as if
there were no ".so"
In case the catpage is uncompressed, the cattool used is "zcat -f" which waits
reading standard input, making the man(1) command hang.

PR:		223560
Reported by:	wosch
MFC after:	3 days
2017-12-04 12:33:46 +00:00
Andrew Turner
78f23de54c Use the module pointer to find the address we need to map to in the early
arm64 boot sequence. This will be a virtual address in the kernel space
after the kernel and any modules loaded by loader so we can use this to
find the size of the kernel + modules. We can then add on a level 2 page for
the module data and round up the size to be aligned to a level 2 page.

This allows more than 8 MiB of modules to be loaded by loader, e.g. zfs.ko
and opensolaris.ko.

Reported by:	Shawn Webb
MFC after:	1 week
Sponsored by:	DARPA, AFRL
2017-12-04 11:25:34 +00:00
Andrew Turner
5be9377857 Print the correct value when freelist is out of range.
Security:	:
Sponsored by:	DARPA, AFRL
2017-12-04 11:16:51 +00:00
Baptiste Daroussin
2c7292e5b4 Properly name the 2013 edition
Reported by:	ed
2017-12-04 09:58:38 +00:00
Baptiste Daroussin
ec5c474feb Add Posix 2013 référence for manpages
PR:		223930
Reported by:	Mateusz Piotrowski <mpp302@gmail.com>
MFC after:	2 days
2017-12-04 09:48:55 +00:00
Andrey V. Elsukov
49ba44e765 Fix format string warning with enabled DEBUGGING.
MFC after:	1 week
2017-12-04 09:17:28 +00:00
Toomas Soome
61da91207d loader.efi: add note about iPXE into the efipart.c
Commant update.
2017-12-04 08:50:00 +00:00