Commit Graph

241143 Commits

Author SHA1 Message Date
Lev A. Serebryakov
26e8ed624e Make mdmfs verbose if diskless boot is verbose.
Approved by:	ian@
Differential Revision:	D17104
2019-04-26 14:44:50 +00:00
Rebecca Cran
c1ffbf2da0 Fix tools/boot/ci-qemu-test.sh and make some improvements
Update ci-qemu-test.sh

o Update the path to the OVMF file, which is now in /usr/local/share/uefi-edk2-qemu.
o Use the more modern q35, pc-q35-3.0 (Q35 + ICH9, 2009) QEMU machine
  instead of the default, obsolete pc, pc-i440fx-3.0 (i440FX + PIIX, 1996).
  For example this adds ACPI support.
o Specify the system firmware using the newer pflash drive syntax instead
  of bios.
o Remove extra, unneeded devices by passing -nodefaults.
o Change text to talk about 'firmware' instead of 'bios', since UEFI
  isn't a BIOS.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D20074
2019-04-26 14:44:46 +00:00
Bruce Evans
d05368940d Remove save/restore of the crtc and gdc registers when showing and
hiding the mouse cursor.  The showing and hiding is often done
asynchronously in a not very safe signal handler, but the state of
these registers and much more is protected from the signal handler
in a better way by deferring mouse signals while the state is in use.
2019-04-26 14:44:20 +00:00
Bruce Evans
ea0a990509 Fix the only known remaining (libvgl) bug for 24-bit modes, and enable
support for 24-bit modes.

The non-segmented case has worked for a long time, but the segmented
case could never have worked since 24-bit accesses may cross a window
boundary but the window was not changed in the middle of the specialized
24-bit accesses for writing a single pixel.
2019-04-26 13:49:06 +00:00
Bruce Evans
a73b15498c Restore the line width in VGLEnd(). The line width may be changed by
VGLSetVScreenSize(), but is not restored by mode switches to at least
standard text mode, so must be restored explicitly.  Standard text mode
displayed blanks when the line width was doubled.
2019-04-26 13:22:54 +00:00
Bruce Evans
7181920238 Fix an off-by-1 error for copying overlapping bitmaps in r346416. For
nonzero height, the first line in the original order was not copied, and
for zero height, garbage lines before the first were copied until a crash
occurred.
2019-04-26 13:04:10 +00:00
Ed Maste
5803d72f7e make sysent after r346273 (readlinkat arg correction)
PR:		197915
Reminded by:	dchagin
2019-04-26 12:55:52 +00:00
Justin Hibbits
17b72853f4 powerpc64: Clear FSCR SPR, so that it's in a known state
This now turns any access to the DSCR SPR into a SIGILL.  Later commits will
make DCSR work correctly on POWER8 and POWER9.

PR:		237208
2019-04-26 03:18:49 +00:00
Justin Hibbits
38a6d5495b powerpc: Fix whitespace in SPR header. 2019-04-26 03:13:44 +00:00
Justin Hibbits
da54cd8721 powerpc: Add another feature2 flag, and update power9 definition
Also fix the definition of PPC_FEATURE2_HTM_NOSUSPEND, a bad line copy.

This now closer matches Linux's definition.
2019-04-26 02:30:03 +00:00
Rodney W. Grimes
3facfc7560 Make bhyve SMBIOS table topology aware
When the CPU Topology was added to bhyve in r332298 the SMBIOS table was
missed, this table passes topology information to the system and was still
using the old concept of each vCPU is a socket with 1 core and 1 thread.
This code did not even try to use the old sysctl information to adjust
this data.

Correct that by building a proper SMBios table, mapping the > 254 cases to
0 per the SMBios 2.6 specification that is claimed by the structure.

Reviewed by:		Patrick Mooney <patrick.mooney@joyent.com>
Approved by:		bde and/or phk (mentor), jhb (maintainer)
MFC:			3 days
Differential Revision:	https://reviews.freebsd.org/D18998
2019-04-25 22:53:55 +00:00
Rodney W. Grimes
77be224862 Acpi MADT table correction for VM_MAXCPU > 21
The bhyve acpi MADT table was given a static space of 256 (0x100) bytes,
this is enough space to allow VM_MAXCPU to be 21, this patch changes that
so VM_MAXCPU can be of arbitrary value and not overflow the space by
actually calculating the space needed for the table.

PR:			212782
Reviewed by:		Patrick Mooney <patrick.mooney@joyent.com>
Approved by:		bde (mentor), jhb (maintainer)
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D18815
2019-04-25 22:52:44 +00:00
Rodney W. Grimes
a488c9c99a Add accessor function for vm->maxcpus
Replace most VM_MAXCPU constant useses with an accessor function to
vm->maxcpus which for now is initialized and kept at the value of
VM_MAXCPUS.

This is a rework of Fabian Freyer (fabian.freyer_physik.tu-berlin.de)
work from D10070 to adjust it for the cpu topology changes that
occured in r332298

Submitted by:		Fabian Freyer (fabian.freyer_physik.tu-berlin.de)
Reviewed by:		Patrick Mooney <patrick.mooney@joyent.com>
Approved by:		bde (mentor), jhb (maintainer)
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D18755
2019-04-25 22:51:36 +00:00
Ian Lepore
20105d31ee Fix typo: the 4th argument to GPIO_PIN_ACCESS_32 is the set of pins to
change, not the variable used to return the original pin state.

PR:		237378
Reported by:	Mori Hiroki <yamori813@yahoo.co.jp>
2019-04-25 22:27:56 +00:00
Johannes Lundberg
af248a7cee Don't call cdev_init where cdev_alloc is called. cdev_alloc already
handles initialization.

Reported by:	johalun
Reviewed by:	hps
Approved by:	imp (mentor), hps
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D19565
2019-04-25 21:54:32 +00:00
Rick Macklem
f736b5f9e9 Add support to nfsdumpstate for printing of INET6 addresses for locks.
r346190 added support for printing of INET6 addresses for the "-o" option
(all opens) but missed adding support for INET6 addresses for the "-l" option.
This patch adds that support.

PR:		223036
MFC after:	1 week
2019-04-25 21:25:32 +00:00
Stephen Hurd
f154ece02e iflib: Better control over queue core assignment
By default, cores are now assigned to queues in a sequential
manner rather than all NICs starting at the first core. On a four-core
system with two NICs each using two queue pairs, the nic:queue -> core
mapping has changed from this:

0:0 -> 0, 0:1 -> 1
1:0 -> 0, 1:1 -> 1

To this:

0:0 -> 0, 0:1 -> 1
1:0 -> 2, 1:1 -> 3

Additionally, a device can now be configured to use separate cores for TX
and RX queues.

Two new tunables have been added, dev.X.Y.iflib.separate_txrx and
dev.X.Y.iflib.core_offset. If core_offset is set, the NIC is not part
of the auto-assigned sequence.

Reviewed by:	marius
MFC after:	2 weeks
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D20029
2019-04-25 21:24:56 +00:00
Kyle Evans
f0baac9e32 libbe(3): Fix libcompat build
SHLIBDIR should still be optionally set, just before src.opts.mk is included
so that libcompat can properly override it. This fixes lib32 failures
reported by both Jenkins and Michael Butler.

Reported by:	Michael Butler <imb@protected-networks.net>
MFC after:	3 days
X-MFC-With:	r346546
2019-04-25 20:48:25 +00:00
Warner Losh
125e3b9d9b Add the proper range of years for Netflix's copyright on this
file. Note that I wrote it.
2019-04-25 20:23:13 +00:00
Warner Losh
8c914c579e Move initialization of the block device handles earlier (we're just
snagging them from UEFI BIOS). Call the device type init routines
earlier as well, as they don't depend on how the console is
setup. This will allow us to read files earlier in boot, so any rare
error messages that this might move only to the EFI console will be an
acceptable price to pay. Also tweak the order of has_kbd so it resides
next to the rest of the console code. It needs to be after we initialize
the buffer cache.
2019-04-25 20:10:02 +00:00
Warner Losh
751241a7c7 Add efi_freebsd_delenv
Add a wrapper around efi_delenv akin to efi_freebsd_getenv and
efi_getenv.
2019-04-25 20:09:49 +00:00
Emmanuel Vadot
0eb610e8e3 loader: fdt: Add fdt_is_setup function
When efi_autoload is called it will call fdt_setup_fdtp which setup the
dtb and overlays. If a user already loaded at dtb or overlays or just
printed the efi provided dtb, this will re-setup everything and also
re-applying the overlays.
Test that everything is setup before doing it again.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D20059
2019-04-25 20:08:43 +00:00
Kyle Evans
0b24d24d80 libbe(3): Fix mis-application of patch (SHLIBDIR)
Rob's patch in D18564 cemented the SHLIBDIR because bsd.own.mk (included by
src.opts.mk) sets it to /usr/lib. r346546 did somehow not apply this part of
the patch, leaving it to get installed to the wrong place and subsequently
removed via ObsoleteFiles.

Reported by:	jkim
MFC after:	3 days
X-MFC-With:	r346546
2019-04-25 20:02:11 +00:00
Emmanuel Vadot
16de4430fe arm: allwinner: aw_pwm: compile it as module too
MFC after:	1 month
2019-04-25 18:44:03 +00:00
Emmanuel Vadot
3de3007594 arm: allwinner: Add pnp info to aw_rsb and compile it as module too
MFC after:	1 month
2019-04-25 18:43:01 +00:00
Emmanuel Vadot
56c37d89b8 arm: allwinner: Add pnp info to if_awg and compile it as module too
While here make it depend on aw_sid as it's needed for mac generation.

MFC after:	1 month
2019-04-25 18:42:27 +00:00
John Baldwin
83bf5ec367 Remove p_code from struct proc.
Contrary to the comments, it was never used by core dumps or
debuggers.  Instead, it used to hold the signal code of a pending
signal, but that was replaced by the 'ksi_code' member of ksiginfo_t
when signal information was reworked in 7.0.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D20047
2019-04-25 18:42:07 +00:00
Emmanuel Vadot
abc15d70b0 arm: allwinner: Add pnp info to aw_rtc and compile it as module too
MFC after:	1 month
2019-04-25 18:41:05 +00:00
Emmanuel Vadot
dbc8d8a261 arm: allwinner: Add pnp info to axp81x and compile it as module too
MFC after:	1 month
2019-04-25 18:40:23 +00:00
Emmanuel Vadot
f9b1c6a029 arm: allwinner: Add pnp info to aw_thermal and compile it as module too
MFC after:	1 month
2019-04-25 18:39:41 +00:00
Emmanuel Vadot
db0e5bf390 arm: allwinner: Add pnpinfo for aw_sid and add module Makefile
MFC after:	1 month
2019-04-25 18:38:38 +00:00
Kyle Evans
e3a883c386 tap(4): Correct driver name...
Reported by:	rgrimes
Pointy hat to:	kevans
MFC after:	3 days
X-MFC-With:	r346688
2019-04-25 18:26:34 +00:00
Kyle Evans
9ea63b2caa tap(4): Add a MODULE_VERSION
Otherwise tap(4) can be loaded by loader despite being compiled into the
kernel, causing a panic as things try to double-initialize.

PR:		220867
MFC after:	3 days
2019-04-25 18:22:22 +00:00
Tycho Nightingale
b09626b330 LinuxKPI buildfix for ppc64 after r346645.
Proposed by:	hselasky
Sponsored by:	Dell EMC Isilon
2019-04-25 18:13:55 +00:00
Emmanuel Vadot
9160989fc2 bsdinstall: up the interface before calling dhclient
MFC after:	1 week
2019-04-25 16:47:15 +00:00
Emmanuel Vadot
12ef023dce mtree: Add more runtime package tag
When using pkgbase those empty directories aren't packaged otherwise.

Reviewed by:	bapt
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20056
2019-04-25 16:45:24 +00:00
Kyle Evans
be13d48c66 libbe(3): Copy received properties as well
This was inherently broken on send|recv datasets.

Reported and tested by:	Wes Maag <jwmaag gmail com>
MFC after:	3 days
2019-04-25 15:51:09 +00:00
Bruce Evans
73416eeccd Restore doing nothing for calls to VGLEnd() after the first. I broke this
in r346631.  VGLEnd() clears some state variables as it restores state,
but not all of them, so it still needs to clear a single state variable
to indicate that it has completed.  Put this clearing back where it was
(at the start instead of the end) to avoid moving bugs in the signal
handling.
2019-04-25 15:48:23 +00:00
Andrew Gallatin
50575ce11c Track TCP connection's NUMA domain in the inpcb
Drivers can now pass up numa domain information via the
mbuf numa domain field.  This information is then used
by TCP syncache_socket() to associate that information
with the inpcb. The domain information is then fed back
into transmitted mbufs in ip{6}_output(). This mechanism
is nearly identical to what is done to track RSS hash values
in the inp_flowid.

Follow on changes will use this information for lacp egress
port selection, binding TCP pacers to the appropriate NUMA
domain, etc.

Reviewed by:	markj, kib, slavash, bz, scottl, jtl, tuexen
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D20028
2019-04-25 15:37:28 +00:00
Ian Lepore
e77f4eb2a0 Restore the ability to open a raw disk or partition in loader(8).
The disk_open() function searches for "the best partition" when slice and
partition information is not provided as part of the device name.  As of
r345477 the slice and partition fields of a disk_devdesc are initialized to
D_SLICEWILD and D_PARTWILD; in the past they were initialized to -1, which
was sometimes interpreted as meaning 'wildcard' and sometimes as 'open the
raw partition' depending on the context.  So as an unintended side effect of
r345477 it became basically impossible to ever open a disk or partition
without doing the 'best partition' search.  One visible effect of that was
the inability to open the raw disk to read the partition table correctly in
zfs_probe_dev(), leading to failures to find the zfs pool unless it was on
the first partition.

Now instead of always initializing slice and partition to wildcards, the
disk_parsedev() function initializes them based on the presence of a
path/file name following the device.  If there is any path or filename
following the ':' that ends the device name, then slice and partition are
initialized to D_SLICEWILD and D_PARTWILD.  If there is nothing after the
':' then it is considered to be a request to open the raw device or
partition itself (not a file stored within it), and the fields are
initialized to D_SLICENONE and D_PARTNONE.

With this change in place, all the tests in src/tools/boot are succesful
again, including the recently-added cases of booting from a zfs pool on
a partition other than slice 1 of the device.

PR:		236981
2019-04-25 15:09:21 +00:00
Kyle Evans
c83651445b tun(4): Don't allow open of open or dying devices
Previously, a pid check was used to prevent open of the tun(4); this works,
but may not make the most sense as we don't prevent the owner process from
opening the tun device multiple times.

The potential race described near tun_pid should not be an issue: if a
tun(4) is to be handed off, its fd has to have been sent via control message
or some other mechanism that duplicates the fd to the receiving process so
that it may set the pid. Otherwise, the pid gets cleared when the original
process closes it and you have no effective handoff mechanism.

Close up another potential issue with handing a tun(4) off by not clobbering
state if the closer isn't the controller anymore. If we want some state to
be cleared, we should do that a little more surgically.

Additionally, nothing prevents a dying tun(4) from being "reopened" in the
middle of tun_destroy as soon as the mutex is unlocked, quickly leading to a
bad time. Return EBUSY if we're marked for destruction, as well, and the
consumer will need to deal with it. The associated character device will be
destroyed in short order.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D20033
2019-04-25 13:46:12 +00:00
Kyle Evans
d91262603b tun/tap: close race between destroy/ioctl handler
It seems that there should be a better way to handle this, but this seems to
be the more common approach and it should likely get replaced in all of the
places it happens... Basically, thread 1 is in the process of destroying the
tun/tap while thread 2 is executing one of the ioctls that requires the
tun/tap mutex and the mutex is destroyed before the ioctl handler can
acquire it.

This is only one of the races described/found in PR 233955.

PR:		233955
Reviewed by:	ae
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D20027
2019-04-25 12:44:08 +00:00
Hans Petter Selasky
d4fedb75ec LinuxKPI buildfix for 32-bit DMA architectures after r346645.
The <sys/pctrie.h> APIs expect a 64-bit DMA key.
This is fine as long as the DMA is less than or equal to 64 bits, which
is currently the case.

Sponsored by:		Mellanox Technologies
2019-04-25 09:13:15 +00:00
Rebecca Cran
56a70105df ACPI SPCR: handle BaudRate=0
From 7d8dc6544c

"The mcbin (and likely others) have a nonstandard uart clock. This means
that the earlycon programming will incorrectly set the baud rate if it is
specified. The way around this is to tell the kernel to continue using the
preprogrammed baud rate. This is done by setting the baud to 0."

Our drivers (uart_dev_ns8250) do respect zero, but SPCR would error. Let's
not error.

Submitted by:	Greg V <greg@unrelenting.technology>
Reviewed by:	mw, imp, bcran
Differential Revision:	https://reviews.freebsd.org/D19914
2019-04-25 02:16:48 +00:00
Ian Lepore
0c0ffba5d6 For the geli-gpt-zfs test images, both bios and uefi flavors, add a dummy
ufs partition as p2, and put the zfs partition at p3, to test the ability
of the zfs probe code to find a zfs pool on something other than the first
partition.
2019-04-25 00:08:15 +00:00
Ian Lepore
827f1973cb The zfs module has grown a dependency on zcl_nfs4.ko, so copy it into all
the test images.
2019-04-24 23:52:38 +00:00
Ian Lepore
f576caac25 Complain and exit the script if the 'make install' phase fails. Also,
there is no need to install any debug files.
2019-04-24 23:51:12 +00:00
John Baldwin
c1bba4445c Parse MIPS relocations to unbreak kldxref on MIPS.
Parse the R_MIPS_32 and R_MIPS_64 relocations.  Both Elf_Rel and
Elf_Rela relocations are handled since O32 MIPS uses Elf_Rel while N64
uses Elf_Rela.  Note that R_MIPS_32 is only handled for 32-bit mips
and R_MIPS_64 for 64-bit.  N32 is untested.

Reviewed by:	imp
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D19870
2019-04-24 23:35:10 +00:00
John Baldwin
6b0451d603 Add support for AES-CCM to ccr(4).
This is fairly similar to the AES-GCM support in ccr(4) in that it will
fall back to software for certain cases (requests with only AAD and
requests that are too large).

Tested by:	cryptocheck, cryptotest.py
MFC after:	1 month
Sponsored by:	Chelsio Communications
2019-04-24 23:31:46 +00:00
John Baldwin
8ccf3d974f Don't panic for empty CCM requests.
A request to encrypt an empty payload without any AAD is unusual, but
it is defined behavior.  Removing this assertion removes a panic and
instead returns the correct tag for an empty buffer.

Reviewed by:	cem, sef
MFC after:	2 weeks
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D20043
2019-04-24 23:27:39 +00:00