Commit graph

231492 commits

Author SHA1 Message Date
Conrad Meyer 7953f98e23 vmci(4): Fix GCC build and rationalize vmci_kernel_defs.h
To fix the GCC build, remove multiple redundant declarations of
vmci_send_datagram() (the copy in vmci.h as well as the extern definition in
vmci_queue_pair.c were wholly redundant).

Also to fix the GCC build, include a non-empty format string in the vmci(4)
definition of ASSERT().  It seems harmless either way, but adding the
stringified invariant is easier than masking the warning.

The other vmci_kernel_defs.h changes are cosmetic and simply match macros to
existing definitions.

Reported by:	GCC 6.4.0
Sponsored by:	Dell EMC Isilon
2018-03-26 19:53:02 +00:00
Kyle Evans ec88403d3f lua-lint: Hint that try_include is now an accepted global
try_include was added in r331563.
2018-03-26 19:08:19 +00:00
Kyle Evans 892b3a5272 lualoader: Actually re-raise error in try_include
It was previously only printed, but we do actually want to raise it as a
full blown error so that things don't look OK when they've actually gone
wrong.

The second parameter to error, level, is set to 2 here so that the error
message reflects the position of the try_include caller, rather than the
try_include itself. Example:

LUA ERROR: /boot/lua/loader.lua:46: /boot/lua/local.lua:1: attempt to call a
nil value (global 'cxcint').
2018-03-26 19:06:25 +00:00
Kyle Evans 07faaf7815 lualoader: Implement try_include and use it for including the local module
This provides a way to optionally include a module without having to wrap it
in filesystem checks. try_include is a little more robust, using the lua
search path instead of forcing us to explicitly consider all of the places
we could want to include a module. Errors are still generally raised from
trying to load the module, but ENOENT will not get raised unless we're doing
a verbose load.

This will also be used to split out logo/brand graphics into their own files
so that we can safely scale up the number of graphics included without
worrying about the extra memory consumption- opting to lazily load graphics
instead.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D14658
2018-03-26 19:01:22 +00:00
Emmanuel Vadot 60fde7ce5d release: arm: Copy boot.scr from ports
Latest u-boot update need u-boot script to load and start ubldr.
(See D14230 for more details)
Copy this file for our arm release on the fat partition.

Approved by:	gjb
2018-03-26 18:39:38 +00:00
Jeff Roberson e8cbe51a04 Fix a bug introduced in r329612 that slowly invalidates all clean bufs.
Reported by:	bde
Reviewed by:	bde
Sponsored by:	Netflix, Dell/EMC Isilon
2018-03-26 18:36:17 +00:00
Glen Barber 5db02b50ce Escape trailing newlines in a long variable list for consistency.
Submitted by:	garga
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2018-03-26 18:24:16 +00:00
Konstantin Belousov 8ec533d336 Allow to specify for vm_fault_quick_hold_pages() that nofault mode
should be honored.

We must not sleep or acquire any MI VM locks if TDP_NOFAULTING is
specified.  On the other hand, there were some callers in the tree
which set TDP_NOFAULTING for larger scope than needed, I fixed the
code which I wrote, but I suspect that linuxkpi and out of tree drm
drivers might abuse this still.

So only enable the mode for vm_fault_quick_hold_pages() where
vm_fault_hold() is not called when specifically asked by user.  I
decided to use vm_prot_t flag to not change KPI.  Since number of
flags in vm_prot_t is limited, I reused the same flag which was
already consumed for vm_map_lookup().

Reported and tested by:	pho (as part of the larger patch)
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D14825
2018-03-26 16:31:12 +00:00
Kyle Evans 6dd381416b aw_sid(4): Release resources and destroy mutex on failure
Submitted by:	Eugene Sevastyanov <eval@iptk.ru>
2018-03-26 14:03:39 +00:00
Kyle Evans 76e00374d2 loader efifb: implement uga_autoresize as a call to text_autoresize
UGA does not have the same kind of mode enumeration that GOP does. Implement
it instead as a call to text_autoresize so that firmwares with only UGA
present still get some kind of autoresizing behavior.

While here, rename a typo'd "gop" to "uga", although it will remain unused
for the time being.
2018-03-26 13:45:17 +00:00
Kristof Provost b93a1086cf pf: reload and resync do the same thing
The reload and resync commands for the startup script do exactly the same
thing, so implement one as a call to the other.

MFC after:	3 weeks
2018-03-26 09:36:22 +00:00
Mark Johnston 18628b74bd Clamp IFLIB_RX_COPY_THRESH to MHLEN in iflib_rxd_pkt_get().
If one has added fields to struct mbuf such that MHLEN is smaller than
this threshold (128), iflib_rxd_pkt_get() may otherwise overrun the
internal mbuf buffer while copying.

Reviewed by:	mmacy
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D14843
2018-03-25 23:23:19 +00:00
Benno Rice 72bf324ced Add an entry dealing with the makefs ISO9660 EFI tagging changes.
If you're building -CURRENT releases and it fails when building ISO images on
amd64 you'll need to update makefs.

Reported by:	dch
Sponsored by:	iXsystems, Inc.
2018-03-25 21:07:59 +00:00
Mark Johnston 803c11a3a6 Use LIST_FOREACH_SAFE in sleepq_chains_remove_matching().
We may remove a sleepqueue from the hash table in
sleepq_resume_thread().

Reviewed by:	kib
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D14847
2018-03-25 20:12:14 +00:00
Warner Losh e05b3850c7 Note that MODULE_PNP_INFO has to come after a DRIVER_MODULE. 2018-03-25 17:12:09 +00:00
Eitan Adler 583a5f393f [pci-vendors] Update to 2018-03-21
MFC After:	3 days
2018-03-25 16:57:21 +00:00
Warner Losh b722027307 The PNP info has to follow the module definition. Move it from just
after the array to its proper location. Otherwise, the linker.hints
file has things out of order and we associated it with whatever was
the previous module.
2018-03-25 16:56:49 +00:00
Hans Petter Selasky 9a3d0cf097 Remove redundant prototype to fix compilation with GCC.
Reported by:	jeff@
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-25 08:55:53 +00:00
Jeff Roberson ac8f2d6e4b Add missing file from 4331508
Document cpuset_{get,set}domain()
2018-03-25 07:42:44 +00:00
Scott Long d3d9a343c7 Update a TBD string with a real model number
Submitted by:	Sam Gwydir
2018-03-25 06:08:18 +00:00
Mark Peek 63a938566d Add VMCI (Virtual Machine Communication Interface) driver
In a virtual machine, VMCI is exposed as a regular PCI device. The primary
communication mechanisms supported are a point-to-point bidirectional
transport based on a pair of memory-mapped queues, and asynchronous
notifications in the form of datagrams and doorbells. These features are
available to kernel level components such as vSockets through the VMCI
kernel API. In addition to this, the VMCI kernel API provides support for
receiving events related to the state of the VMCI communication channels,
and the virtual machine itself.

Submitted by: Vishnu Dasa <vdasa@vmware.com>
Reviewed by: bcr, imp
Obtained from: VMware
Differential Revision: https://reviews.freebsd.org/D14289
2018-03-25 00:57:00 +00:00
Jeff Roberson 93f31533df Document new NUMA related syscalls and utility options.
Sponsored by:	Netflix, Dell/EMC Isilon
2018-03-24 23:58:44 +00:00
Emmanuel Vadot c2f5940db3 Add dtb overlays support
DTB Overlays are useful to change/add nodes to a dtb without the need to
modify it.
Add support for building dtbo during buildkernel.
The goal of DTBO present in the FreeBSD source tree is to fill a gap in
time when we submit changes upstream (Linux). Instead of waiting 2 to 4 months
we can add a DTBO in tree in the meantime.
This is not for adding DTBO for capes/hat/addon boards, those will be
better to put in a ports.
This is also not for enabling a i2c/spi/pwm controller on certain pins,
each user have a different use case for those (which pins to use etc ...)
and we cannot have all possible configuration.

Add a dtbo for sun8i-h3-sid which add the SID node missing in upstream dts.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D14782
2018-03-24 21:30:24 +00:00
Kirk McKusick fb15890a8c When freeing a superblock returned by ffs_sbget, be sure to also
free the superblock summary information.

Reported by: Peter Holm (pho@)
Tested by: Peter Holm (pho@)
2018-03-24 15:36:25 +00:00
Konstantin Belousov ed9e8bc468 Account the size of the vslock-ed memory by the thread.
Assert that all such memory is unwired on return to usermode.

The count of the wired memory will be used to detect the copyout mode.

Tested by:	pho (as part of the larger patch)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2018-03-24 13:51:27 +00:00
Konstantin Belousov 63b5d112b6 For vm_zone_stats() sysctl handler, do not drain sbuf calling
copyout(9) while owning zone lock.

Despite old value sysctl buffer is wired, spurious faults might still
occur.

Note that we still own the uma_rwlock there, but this lock does not
participate in sensitive lock orders.

Reported and tested by:	pho (as part of the larger patch)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2018-03-24 13:48:53 +00:00
Jonathan T. Looney 20cb3e2557 This change adds a flag to the DAD entry to indicate whether it is
currently on the queue. This prevents accidentally doubly-removing a DAD
entry from the queue, while also simplifying some of the logic in
nd6_dad_stop().

Reviewed by:	ae, hrs, vangyzen
MFC after:	2 weeks
Sponsored by:	Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D10943
2018-03-24 13:18:09 +00:00
Konstantin Belousov 161bf65f8a In vn_io_fault1(), reduce the scope where pagefaults are disabled.
Most important for the future use, do not call
vm_fault_quick_hold_pages() with disabled pagefaults.

Reported and tested by:	pho (as part of the larger patch)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2018-03-24 13:13:52 +00:00
Konstantin Belousov a37d4032ed Improve the lcall $7,$0 syscall emulation on amd64.
Current code, which copies the potential syscall arguments into the
current frame, puts an arbitrary limit on the number of syscall
arguments.  Apparently, mmap(2) and lseek(2) (?) require larger
number.  But there is an issue that stack is only need to be mapped to
contain the number of arguments required by the syscall, so copying
arbitrary large number of words from the stack is not completely safe.

Use different approach to convert lcall frame into int $0x80 frame in
place, by doing the retl in kernel.  This also allows to stop proceed
vfork case specially, and stop making assumptions about %cs at the
syscall time.

Also, improve comments with the formulations provided by bde.

Reviewed and tested by:	bde
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2018-03-24 12:57:58 +00:00
Jonathan T. Looney e24e568336 Make the TCP blackbox code committed in r331347 be an optional feature
controlled by the TCP_BLACKBOX option.

Enable this as part of amd64 GENERIC. For now, leave it disabled on
other platforms.

Sponsored by:	Netflix, Inc.
2018-03-24 12:48:10 +00:00
Jonathan T. Looney c187c03466 Remove some unneccessary variable sets in IPv6 code, as detected by
clang's static analyzer.

Reviewed by:	bz
MFC after:	2 weeks
Sponsored by:	Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D10940
2018-03-24 12:43:34 +00:00
Jonathan T. Looney 9959c8b9e6 Fix compilation for platforms that don't support atomic_fetchadd_64()
after r331347.

Reported by:	avg, br, jhibbits
Sponsored by:	Netflix, Inc.
2018-03-24 12:40:45 +00:00
Matthias Fechner 4bc7ec2c66 Added myself to committers-ports.dot.
Reviewed by:	tz (mentor)
Approved by:	tz (mentor)
Differential Revision:	https://reviews.freebsd.org/40631
2018-03-24 09:10:50 +00:00
Philip Paeps 46bee4edc2 Import tzdata 2018d
Changes: https://github.com/eggert/tz/blob/2018d/NEWS

MFC after:	3 days
2018-03-24 04:52:29 +00:00
Philip Paeps 52b750c8ae Import tzdata 2018d 2018-03-24 04:41:49 +00:00
John-Mark Gurney 3762b440dc minor work smithing... 2018-03-24 04:21:22 +00:00
Kyle Evans dbef52531e lualoader: Privatize some more config.lua bits
These functions are also not quite suitable for a public API, so privatize
them to config.
2018-03-24 04:03:55 +00:00
Kyle Evans 64c91742f3 lualoader: Make config env-related bits private API
This pertains exclusively to the set/restore functionality that we offer,
where any changes made by loader.conf previously will be effectively removed
upon reload of the configuration. We don't currently have a need to export
these, so don't bother.
2018-03-24 04:00:01 +00:00
Kyle Evans bc40337bb0 loader consoles: Implement SGR 24, 25
Mostly for completeness sake- implement 24 (no underline) and 25 (no blink)

MFC after:	3 days
2018-03-24 02:01:25 +00:00
Kyle Evans 1c1692795a efi loader: Choose a console mode instead if hw.vga.textmode is set
Not all systems use efifb; pull hw.vga.textmode and choose a good console
mode instead if it's set to something non-zero. This is basically a revival
of the code that used to live in boot1, but instead rebased onto this
different way of doing mode selection in loader.efi.

Interestingly enough, the regression that was previously introduced where
GOP would not reflect the console setting does not seem to exist when
console mode selection is done here. I've not done any investigation as to
why this is the case. Nevertheless, boot1.efi is still not the best place to
do mode selection.
2018-03-24 01:53:43 +00:00
Navdeep Parhar d57241d2e7 cxgbe(4): Always initialize requested_speed to a valid value.
This fixes an avoidable EINVAL when the user tries to disable AN after
the port is initialized but l1cfg doesn't have a valid speed to use.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2018-03-24 01:07:58 +00:00
Kyle Evans bd868d67bc loader.conf(5): Convert list of values to much better looking table format
Discussed with:	jhb, rpokala
2018-03-23 23:46:59 +00:00
Kyle Evans 9ee31ef21c loader.conf(5): Document efi_max_resolution 2018-03-23 23:02:50 +00:00
Benno Rice 633cb765d8 Don't try to modify El Torito section headers if there aren't any.
MFC after:	1 week
2018-03-23 22:59:45 +00:00
Benno Rice ebf1c08960 Correctly mark the last El Torito section header.
Reported by:	Thomas Schmitt <scdbackup@gmx.net>
Reviewed by:	emaste, imp
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14812
2018-03-23 22:52:26 +00:00
John Baldwin 7091608617 Add a workaround to the hypervisor detection for older versions of KVM.
Originally KVM set %eax to 0 in the cpuid leaf 0x4000000 rather than
to the highest supported leaf in the hypervisor "branch".  Detect this
case and fixup the %eax value so that the hypervisor is still
detected.

Reported by:	jpaetzel
Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D14810
2018-03-23 22:36:24 +00:00
Kyle Evans 05e8899d7d efi loader: Respect efi_max_resolution in loader.conf(5)
Default the max resolution to 1080p, we'll accept Width x Height
specifications along with the following presets:

- 480p
- 720p
- 1080p
- 2160p or 4k
- 5k

PR:		224825
Differential Revision:	https://reviews.freebsd.org/D14801
2018-03-23 21:02:46 +00:00
Benno Rice 8dbc390581 Allow makefs to properly tag UEFI El Torito boot images. Use them in amd64 ISOs.
UEFI booting requires an EFI System Partition (ESP). On most storage devices
this will be in a specific partition type. To allow booting from CD/ISO
filesystems, UEFI will look for an ESP in the form of a FAT filesystem image
embedded in the image. Historically FreeBSD has added one of these to its
amd64 ISO images but marked it as simply another i386 boot image. Luckily for
us most UEFI implementations are rather forgiving and work this out for us.

This change adds the ability to mark a boot image as being a UEFI image. It
also modifies our ISO generation to use this marking for the UEFI image we
embed.

Reported by:	Thomas Schmitt <scdbackup@gmx.net>
Reviewed by:	emaste, imp
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D14809
2018-03-23 20:56:18 +00:00
Ed Maste f8268d4d97 Remove redundant cast from Linuxulator SYSINITs 2018-03-23 20:32:54 +00:00
John Baldwin 8356a9abbb Move remaining EF_MIPS_* flags to <sys/elf_common.h>.
Reviewed by:	brooks
Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D14789
2018-03-23 19:31:52 +00:00