r348697 mizhka June 5, 2019, 7:55 p.m.
* This commit is going to fix build of AR724x on 13-CURRENT with additional
tools like athani. See r344841
r348695 jhb June 5, 2019, 7:30 p.m.
pci_alloc_msix() requires both the table and PBA BARs to be allocated
by the driver.  ppt was only allocating the table BAR so would fail
for devices with the PBA in a separate BAR.  Fix this by allocating
the PBA BAR before pci_alloc_msix() if it is stored in a separate BAR.

While here, release BARs after calling pci_release_msi() instead of
before.  Also, don't call bus_teardown_intr() in error handling code
if bus_setup_intr() has just failed.

Reported by:	gallatin
Tested by:	gallatin
Reviewed by:	rgrimes, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20525
r348694 jhb June 5, 2019, 7:29 p.m.
bhyve has to virtualize the MSI-X table to trap reads and writes to
that table and map those to virtual interrupts that it maps real host
interrupts on to.  For the pending-bit-array (PBA), bhyve passes
accesses from the guest directly to the hardware.

bhyve's virtualization of the MSI-X table is done by intercepting all
reads and writes to the BAR holding the MSI-X table.  However, if the
PBA is stored in the same BAR as the MSI-X table, accesses to the PBA
portion of this BAR have to be forwarded to the real BAR.

However, in the case that the PBA was stored in a separate BAR and
it's offset in that separate BAR overlapped with the portion of the
MSI-X table BAR that the table used, the handlers for the table BAR
would incorrectly think that some accesses were PBA reads and writes.
This caused a crash in bhyve when it indirected a NULL pointer.  Fix
this case by never trying to handle PBA access if the PBA lives in a
separate BAR.

Reported by:	gallatin
Tested by:	gallatin
Reviewed by:	markj, Patrick Mooney
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D20523
r348693 pkubaj June 5, 2019, 4:01 p.m.
r348692 emaste June 5, 2019, 3:23 p.m.
The kernel has a limit of 131072 glyphs in a font; add the same check to
vtfontcvt so that we won't create a font file that the kernel will not

PR:		205707
Submitted by:	Dmitry Wagin
MFC after:	2 weeks
r348689 emaste June 5, 2019, 2:08 p.m.
r348504 moved llvm-symbolizer from the CLANG_EXTRAS knob to CLANG, but
the man page was still in the CLANG_EXTRAS section in

Reported by:	jhb
MFC after:	3 days
MFC with:	r348504
r348688 avg June 5, 2019, 1:18 p.m.
Unlike BUS_READ_IVAR / BUS_WRITE_IVAR, bus accessors do not have a
return code.  It is assumed that there is a tight coupling between a bus
driver and a driver for a device on the bus with respect to instance
variables that the bus defines for its children.  So, the driver is
supposed to have only valid accesses to the variables and, thus, the
accessors must always succeed.

Of course, programming errors sometimes happen.  At present, such errors
go completely unnoticed.  The idea of this change is to start catching
them.  As a first step, there will be a warning about a failed accessor
call.  This is to give developers a heads-up.  I plan to replace the
printf with a KASSERT a week later, so that the warning is harder to

Reviewed by:	cem, imp, ian
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D20458
r348687 tychon June 5, 2019, 1:08 p.m.
Submitted by:	rlibby
Sponsored by:	Dell EMC Isilon
r348682 ae June 5, 2019, 9:25 a.m.
It looks like initialization of static variable doesn't work for
VIMAGE and this leads to panic.

Reported by:	olivier
MFC after:	1 week
r348681 cperciva June 5, 2019, 4:58 a.m.
Prior to this commit, if PCIEM_SLOT_STA_ABP and PCIEM_SLOT_STA_PDC are
asserted simultaneously, FreeBSD sets a 5 second "hardware going away" timer
and then processes the "presence detect" change. In the (physically
challenging) case that someone presses the "attention button" and inserts
a new PCIe device at exactly the same moment, this results in FreeBSD
recognizing that the device is present, attaching it, and then detaching it
5 seconds later.

On EC2 "bare metal" hardware this is the precise sequence of events which
takes place when a new EBS volume is attached; virtual machines have no
difficulty effecting physically implausible simultaneity.

This patch changes the handling of PCIEM_SLOT_STA_ABP to only detach a
device if the presence of a device was detected *before* the interrupt
which reports the Attention Button push.

Reported by:	Matt Wilson
Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	https://www.patreon.com/cperciva
Differential Revision:	https://reviews.freebsd.org/D20499
r348680 scottph June 5, 2019, 4:01 a.m.
Approved by:	jhb (mentor)
r348679 meta June 5, 2019, 3:40 a.m.
r348678 imp June 5, 2019, 2:34 a.m.
only need it for the gptfind() function, where it's used.
r348677 emaste June 5, 2019, 12:55 a.m.
After r348610 `make delete-old` was still removing llvm-ar and llvm-nm
(and associated man pages).

Reported by:	jhb
Sponsored by:	The FreeBSD Foundation
r348675 imp June 5, 2019, 12:08 a.m.
code is safe enough. Turn off the warning for now until I can find the
right construct to silence it in the code.