History log of /freebsd-11-stable/usr.sbin/bhyve/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
370399 24-Aug-2021 markj

bhyve: Fix vq_getchain() error handling bugs in various device models

Reviewed by: grehan, khng
Approved by: so
Security: CVE-2021-29631
Security: FreeBSD-SA-21:13.bhyve

(cherry picked from commit 71fbc6faed62e8eb5864f7c40839740f5e9f5558)

Git Hash: eb01dfe6c01c700418a872ae520187a1292ea7da
Git Author: markj@FreeBSD.org

363059 09-Jul-2020 kaktus

MFC r362612

bhyve: allow for automatic destruction on power-off

361041 14-May-2020 jhb

MFC 360399:
Update the cached MSI state when any MSI capability register is written.

bhyve uses cached copies of the MSI capability registers to generate
MSI interrupts for device models. Previously, these cached fields
were only set when the MSI capability control register was updated.
The Linux kernel recently adopted a change to deal with races in MSI
interrupt delivery that writes to the MSI capability address and data
registers to alter the destination of MSI interrupts without writing
to the MSI capability control register. bhyve was not updating its
cached registers for these writes and continued to send interrupts
with the old data value to the old address. Fix this by recomputing
the cached values for every write to any MSI capability register.

360965 12-May-2020 jhb

MFC 358394: Use stream_read() to read all 12 bytes of the RFB client version.

read() can return a short read, whereas stream_read() waits until the
full version string is read.

351059 14-Aug-2019 jhb

MFC 348694: Don't simulate PBA access if the PBA is in a separate BAR.

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.

350619 05-Aug-2019 jhb

MFC 350618:
Validate guest-supplied length of headers for TSO transmit requests.

When transmitting a large TCP packet, the final transmit descriptor
includes the length of the protocol headers to be duplicated on each
segment. The device model was trusting the guest-supplied value
without validating it. A value of zero would result in the guest
being able to indirect a garbage pointer on the stack to overwrite
arbitrary memory in the bhyve process. A value that was non-zero but
too small for the requested parameters resulted in the device model
reading and writing values beyond the end of the on-stack buffer used
to hold the template header.

To fix, validate the supplied length and drop requests to transmit
packets that would overflow the header buffer. While here, initialize
the header pointer to NULL as a preventive measure so that any access
to an unallocated template header crashes they hypervisor
deterministically.

While here, only read the TCP sequence number if the packet being
split is a TCP packet. The e1000 logic supports a segmentation of UDP
frames, and while UDP segmentation requires this part of the header to
be valid (so there is no buffer overflow), only reading the field when
needed is cleaner.

admbugs: 918
Reported by: Reno Robert <renorobert@gmail.com>
Approved by: so
Security: CVE-2019-5609

350252 23-Jul-2019 emaste

bhyve: Fix resource leak when using strdup

MFC r340044 (araujo):

Fix resource leak when using strdup(3).

MFC r344160 (rgrimes):

In r340044 an attempt to quiet coverity warning cid 1357336
was incorrectly implemented leading to a possible double free.

It is possible for both the conditional free,
and the unconditional free added in r340044 to be done,
fix that by initializing uopt to NULL,
removing the conditional free,
and only using the unconditional free at the end.

CID: 1357336
Reported by: Coverity

350250 23-Jul-2019 emaste

MFC r349915 (seanc): usr.sbin/bhyve: initialize return value ...

... in xhci device interrupt handler

Coverity CID: 1357340

350247 23-Jul-2019 emaste

MFC r350244: bhyve: correct out-of-bounds read in XHCI device emulation

Add appropriate bounds checks on the epid and streamid fields in the
device doorbell registers.

admbugs: 919
Submitted by: jhb
Reported by: Reno Robert <renorobert@gmail.com>
Reviewed by: markj
Approved by: so
Security: out-of-bounds read

349959 13-Jul-2019 jhb

Add Capsicumification of the virtio_console device model.

This is a direct commit to stable/11. This change was missed when
merging virtio_console to 11 because the capsicum change and
virtio_console changes were merged in the opposite order of the
changes in head.

349958 12-Jul-2019 jhb

MFC 339911,339936,343075,343166,348592: Various AMD CPU-specific fixes.

339911:
Emulate machine check related MSR_EXTFEATURES to allow guest OSes to
boot on AMD FX Series.

339936:
Merge cases with upper block.
This is a cosmetic change only to simplify code.

343075:
vmm(4): Take steps towards multicore bhyve AMD support

vmm's CPUID emulation presented Intel topology information to the guest, but
disabled AMD topology information and in some cases passed through garbage.
I.e., CPUID leaves 0x8000_001[de] were passed through to the guest, but
guest CPUs can migrate between host threads, so the information presented
was not consistent. This could easily be observed with 'cpucontrol -i 0xfoo
/dev/cpuctl0'.

Slightly improve this situation by enabling the AMD topology feature flag
and presenting at least the CPUID fields used by FreeBSD itself to probe
topology on more modern AMD64 hardware (Family 15h+). Older stuff is
probably less interesting. I have not been able to empirically confirm it
is sufficient, but it should not regress anything either.

343166:
vmm(4): Mask Spectre feature bits on AMD hosts

For parity with Intel hosts, which already mask out the CPUID feature
bits that indicate the presence of the SPEC_CTRL MSR, do the same on
AMD.

Eventually we may want to have a better support story for guests, but
for now, limit the damage of incorrectly indicating an MSR we do not yet
support.

Eventually, we may want a generic CPUID override system for
administrators, or for minimum supported feature set in heterogenous
environments with failover. That is a much larger scope effort than
this bug fix.

348592:
Emulate the AMD MSR_LS_CFG MSR used for various Ryzen errata.

Writes are ignored and reads always return zero.

PR: 224476, 235010

349740 04-Jul-2019 vmaffione

bhyve: vtnet: fix locking on receive

The vsc_rx_ready and the RX virtqueue is protected by the rx_mtx lock.
However, pci_vtnet_ping_rxq() (currently called only once after each
device reset) accesses those without acquiring the lock.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D20609

349739 04-Jul-2019 vmaffione

MFC r349019

bhyve: move common code to net_utils.c

Both virtio_net and e82545 network frontends have code to validate and
generate MAC addresses. These functionalities are replicated in the two
files, so we move them in a separate compilation unit.

Reviewed by: rgrimes, bryanv, imp, kevans
Differential Revision: https://reviews.freebsd.org/D20626

349704 03-Jul-2019 vmaffione

MFC r348929

bhyve: virtio: introduce vq_kick_enable() and vq_kick_disable()

The VirtIO standard supports two schemes for notification suppression:
a notification enable bit and a more sophisticated one (event_idx) that
also supports delayed notifications. Currently bhyve fully supports
only the first scheme. This patch hides the notification suppression
internals by means of two inline routines, vq_kick_enable() and
vq_kick_disable(), and makes the code more readable.
Moreover, further improve readability by replacing the call to mb()
with a call to atomic_thread_fence_seq_cst(), which is already used
in virtio.c

Reviewed by: pmooney_pfmooney.com, bryanv
Differential Revision: https://reviews.freebsd.org/D20581

349698 03-Jul-2019 vmaffione

MFC r348834

bhyve: vtnet: simplify thread synchronization

On vtnet device reset it is necessary to wait for threads to stop TX and
RX processing. However, the rx_in_progress variable (used for to wait for
RX processing to stop) is actually useless, and can be removed. Acquiring
and releasing the RX lock is enough to synchronize correctly. Moreover,
it is possible to reset the device while holding both TX and RX locks, so
that the "resetting" variable becomes unnecessary for the RX thread, and
can be protected by the TX lock (instead of being volatile).

Reviewed by: jhb, markj
Differential Revision: https://reviews.freebsd.org/D20543

349604 02-Jul-2019 wblock

MFC r349600.

Correct name of vmm(4) pptdevs variable.

349435 26-Jun-2019 markj

MFC r349196:
Make zlib encoding messages idempotent.

PR: 238333

348375 29-May-2019 jhb

MFC 347033:
Increase the VirtIO segment count to support modern Windows guests.

The Windows virtio driver ignores the advertized seg_max field and
assumes the host can accept up to 67 segments in indirect descriptors,
triggering an assert in the bhyve process.

This brings back r282922 but with a couple of changes:
- It raises the block interface segment limit to 128 instead of 67.
- Linux's virtio driver assumes that the segment limit is no
larger than the ring size. To avoid breaking Linux guests,
raise the VirtIO ring size to 128, and cap the VirtIO segment
limit at ring size - 2 (effectively 126).

Approved by: re (gjb)

348371 29-May-2019 jhb

MFC 345158: Fix uart emulation bug

THRE is always asserted in LSR reads, so REG_IER writes that raise
IER_ETXRDY must also set thre_int_pending.

Approved by: re (gjb)

348269 25-May-2019 rgrimes

MFC: r346717: 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.

Approved by: re (kib)

348201 23-May-2019 rgrimes

MFC: r332298,333712,334199,334216,334219 bhyve cpu topology

Approved by: re (gjb), bde/phk (mentor, implicit)

348188 23-May-2019 rgrimes

MFC: r347960: bhyve virtio needs barriers

Under certain tight race conditions, we found that the lack of a memory
barrier in bhyve's virtio handling causes it to miss a NO_NOTIFY state
transition on block devices, resulting in guest stall. The investigation
is recorded in OS-7613. As part of the examination into bhyve's use of
barriers, one other section was found to be problematic, but only on
non-x86 ISAs with less strict memory ordering. That was addressed in
this patch as well, although it was not at all a problem on x86.

PR: 231117
Submitted by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: jhb, kib, rgrimes
Approved by: re (gjb), jhb
Differential Revision: https://reviews.freebsd.org/D19501

347437 10-May-2019 jhb

MFC 342944: Fix spelling of identifier

347436 10-May-2019 jhb

MFC 340707:
Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES
to avoid buffer accessed out of bounds, also switch to snprintf(3).

PR: 200859

347412 09-May-2019 jhb

MFC 334272: bhyve: guarantee NUL termination

Use strlcpy to guarantee NUL termination of the path to a
virtio console socket.

347411 09-May-2019 jhb

MFC 334271: bhyve: fix small memory leak in virtio console

347406 09-May-2019 jhb

MFC 333235:
Allow arbitrary numbers of columns for VNC server screen resolution.

The prior code only allowed multiples of 32 for the
numbers of columns. Remove this restriction to allow
a forthcoming UEFI firmware update to allow arbitrary
x,y resolutions.

(the code for handling rows already supported non mult-32 values)

347124 04-May-2019 rgrimes

MFC: r346715: 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, implicit), jhb (maintainer)
Differential Revision: https://reviews.freebsd.org/D18815

347036 03-May-2019 jhb

MFC 325727:
bhyve: avoid applying capsicum capabilities to file that was not opened

When using -l option targeting file that can't be opened (ie. nmdm module
is not loaded and /dev/nmdm* is specified) bhyve tries to apply capsicum
capabilities to a file that was not opened.

Enclose that code in an if statement and only run it on correctly opened
descriptor also providing meaningful message in case of an error.

347035 03-May-2019 jhb

MFC 313732: bhyve: whitespace fix for r313727

346716 25-Apr-2019 mav

Fix build with r346707.

346707 25-Apr-2019 mav

MFC r339826 (by yuripv):
Provide basic descriptions for VMX exit reason (from "Intel 64 and IA-32
Architectures Software Developer’s Manual Volume 3"). Add the document
to SEE ALSO in bhyve.8 (and pet manlint here a bit).

346437 20-Apr-2019 markj

MFC r346010:
Fix indentation.

346436 20-Apr-2019 markj

MFC r346011:
Stop compiling bhyve(8) with -O0.

341758 09-Dec-2018 araujo

MFC r340046, r340050

r340046:
Add support ps/2 scancodes for NumLock, ScrollLock and numerical keypad
keys.

PR: 213835
Submitted by: Vasily Postnicov <ivan.zhmudo@gmail.com>
Relnotes: Yes
Sponsored by: iXsystems Inc.

r340050:
Remove printf for debug purpose forgotten on r340046.

Reported by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

341486 04-Dec-2018 gordon

MFC r341484

Always treat firmware request and response sizes as unsigned.

This fixes an incomplete bounds check on the guest-supplied request
size where a very large request size could be interpreted as a negative
value and not be caught by the bounds check.

Submitted by: jhb
Reported by: Reno Robert
Approved by: so
Security: FreeBSD-SA-18:14.bhyve
Security: CVE-2018-17160

339947 31-Oct-2018 bz

MFC r339586:

In bhyve's fbuf emulation improve the overall "usage" message and
for the vga option, rather than printing the entire option string,
only print vga (as we do for everything else).

MFC r339681:

Allow the bhyve VNC server to listen on IPv6 for incoming connections.

Alternatively to IPv4 address:port this will allow to listen on IPv6
link-local (incl. scope), a specific address, or ::. Addresses have
to be given in RFC2732 format so that [::]:port parsing will work.

This patch also starts to introduce WITH_INET/INET6_SUPPORT to bhyve.

PR: 232018
Submitted by: Dave Rush (northwoodlogic.free gmail.com) (original)
Reviewed by: Dave Rush (updated verison)

337575 10-Aug-2018 oshogbo

MFC r337189:
bhyve: set title before entering capability mode

PR: 230082
Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com>

336704 25-Jul-2018 araujo

MFC r336188:

Improve bhyve exit(3) error code.

The bhyve(8) exit status indicates how the VM was terminated:

0 rebooted
1 powered off
2 halted
3 triple fault

The problem is when we have wrappers around bhyve that parses the exit
error code and gets an exit(1) for an error but interprets it as "powered off".
So to mitigate this issue and makes it less error prone for third part
applications, I have added a new exit code 4 that is "exited due to an error".

For now the bhyve(8) exit status are:
0 rebooted
1 powered off
2 halted
3 triple fault
4 exited due to an error

Reviewed by: @jhb
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D16161

336191 11-Jul-2018 araujo

MFC r335027, r335050

r335027:
When this code was introduced at r300829 the author forgot to add
the BSD license header that is the same as in its C header file.

Sponsored by: iXsystems Inc.

r335050:
While I was investigating CID 1194192 related with a resource leak on mrp memory
allocation, I could identify that actually we use this pointer on pci_emul.c as
well as on vga.c source file.

I have reworked the logic here to make it more readable and also add a warn to
explicit show the function where the memory allocation error could happen,
also sort headers.

Also CID 1194192 was marked as "Intentional".

Obtained from: TrueOS
Sponsored by: iXsystems Inc.

336189 11-Jul-2018 araujo

MFC r335025:

Add SPDX tags to bhyve(8).

Discussed with: rgrimes, pfg and mav.
Obtained from: TrueOS
Sponsored by: iXsystems Inc.

336161 10-Jul-2018 araujo

MFC r334307, r335103-r335104

r334307:
Simplify macros EFPRINTF and EFFLUSH. [0]
Also stdarg(3) says that each invocation of va_start() must be paired
with a corresponding invocation of va_end() in the same function. [1]

Reported by: Coverity
CID: 1194318[0] and 1194332[1]
Discussed with: jhb
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15548

r335103:
Fix style(9) space vs tab.

Reviewed by: jhb
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15774

r335104:
Fix style(9) space vs tab.

Reviewed by: jhb
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15768

335688 27-Jun-2018 araujo

MFC r333622, r334019, r334084

r333622:
vq_getchain() can return -1 if some descriptor(s) are invalid and prints
a diagnostic message. So we do a sanity checking on the return value
of vq_getchain().

Spotted by: gcc49
Reviewed by: avg
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15388

r334019:
Include atkbdc header where there are declared the prototype functions
atkbdc_event and atkbdc_init.

Sponsored by: iXsystems Inc.

r334084:
pthread_rwlock_unlock(3) returns 0 if successful, otherwise an error number
will be returned to indicate the error, so I'm applying an assert(3) to do
a sanity check of the return value.

Reported by: Coverity CID: 1391235, 1193654 and 1193651
Reviewed by: grehan
Sponsored by: iXsystems Inc.
Differential Revision: https://reviews.freebsd.org/D15533

330449 05-Mar-2018 eadler

MFC r326276:

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


/freebsd-11-stable/bin/pkill/pkill.c
/freebsd-11-stable/etc/pam.d/convert.pl
/freebsd-11-stable/kerberos5/lib/libgssapi_krb5/gss_krb5.c
/freebsd-11-stable/kerberos5/lib/libgssapi_krb5/pname_to_uid.c
/freebsd-11-stable/kerberos5/lib/libgssapi_krb5/prefix.c
/freebsd-11-stable/kerberos5/lib/libgssapi_ntlm/prefix.c
/freebsd-11-stable/kerberos5/lib/libgssapi_spnego/freebsd_compat.c
/freebsd-11-stable/sbin/adjkerntz/adjkerntz.c
/freebsd-11-stable/sbin/adjkerntz/pathnames.h
/freebsd-11-stable/sbin/camcontrol/camcontrol.h
/freebsd-11-stable/sbin/camcontrol/fwdownload.c
/freebsd-11-stable/sbin/camcontrol/modeedit.c
/freebsd-11-stable/sbin/camcontrol/progress.c
/freebsd-11-stable/sbin/camcontrol/progress.h
/freebsd-11-stable/sbin/camcontrol/util.c
/freebsd-11-stable/sbin/ccdconfig/ccdconfig.c
/freebsd-11-stable/sbin/ccdconfig/pathnames.h
/freebsd-11-stable/sbin/comcontrol/comcontrol.c
/freebsd-11-stable/sbin/conscontrol/conscontrol.c
/freebsd-11-stable/sbin/ddb/ddb.c
/freebsd-11-stable/sbin/ddb/ddb.h
/freebsd-11-stable/sbin/ddb/ddb_capture.c
/freebsd-11-stable/sbin/ddb/ddb_script.c
/freebsd-11-stable/sbin/devd/devd.h
/freebsd-11-stable/sbin/devd/devd.hh
/freebsd-11-stable/sbin/devd/parse.y
/freebsd-11-stable/sbin/devd/token.l
/freebsd-11-stable/sbin/devfs/devfs.c
/freebsd-11-stable/sbin/devfs/extern.h
/freebsd-11-stable/sbin/devfs/rule.c
/freebsd-11-stable/sbin/etherswitchcfg/etherswitchcfg.c
/freebsd-11-stable/sbin/fsck/fsutil.h
/freebsd-11-stable/sbin/fsck_ffs/ea.c
/freebsd-11-stable/sbin/fsck_ffs/suj.c
/freebsd-11-stable/sbin/fsck_msdosfs/boot.c
/freebsd-11-stable/sbin/fsck_msdosfs/check.c
/freebsd-11-stable/sbin/fsck_msdosfs/dir.c
/freebsd-11-stable/sbin/fsck_msdosfs/dosfs.h
/freebsd-11-stable/sbin/fsck_msdosfs/ext.h
/freebsd-11-stable/sbin/fsck_msdosfs/fat.c
/freebsd-11-stable/sbin/fsck_msdosfs/main.c
/freebsd-11-stable/sbin/fsdb/fsdb.c
/freebsd-11-stable/sbin/fsdb/fsdb.h
/freebsd-11-stable/sbin/fsdb/fsdbutil.c
/freebsd-11-stable/sbin/fsirand/fsirand.c
/freebsd-11-stable/sbin/gbde/gbde.c
/freebsd-11-stable/sbin/geom/class/cache/geom_cache.c
/freebsd-11-stable/sbin/geom/class/concat/geom_concat.c
/freebsd-11-stable/sbin/geom/class/eli/geom_eli.c
/freebsd-11-stable/sbin/geom/class/journal/geom_journal.c
/freebsd-11-stable/sbin/geom/class/journal/geom_journal.h
/freebsd-11-stable/sbin/geom/class/journal/geom_journal_ufs.c
/freebsd-11-stable/sbin/geom/class/label/geom_label.c
/freebsd-11-stable/sbin/geom/class/mirror/geom_mirror.c
/freebsd-11-stable/sbin/geom/class/mountver/geom_mountver.c
/freebsd-11-stable/sbin/geom/class/multipath/geom_multipath.c
/freebsd-11-stable/sbin/geom/class/nop/geom_nop.c
/freebsd-11-stable/sbin/geom/class/part/geom_part.c
/freebsd-11-stable/sbin/geom/class/raid/geom_raid.c
/freebsd-11-stable/sbin/geom/class/raid3/geom_raid3.c
/freebsd-11-stable/sbin/geom/class/sched/geom_sched.c
/freebsd-11-stable/sbin/geom/class/shsec/geom_shsec.c
/freebsd-11-stable/sbin/geom/class/stripe/geom_stripe.c
/freebsd-11-stable/sbin/geom/class/virstor/geom_virstor.c
/freebsd-11-stable/sbin/geom/core/geom.c
/freebsd-11-stable/sbin/geom/core/geom.h
/freebsd-11-stable/sbin/geom/misc/subr.c
/freebsd-11-stable/sbin/geom/misc/subr.h
/freebsd-11-stable/sbin/ggate/ggatec/ggatec.c
/freebsd-11-stable/sbin/ggate/ggated/ggated.c
/freebsd-11-stable/sbin/ggate/ggatel/ggatel.c
/freebsd-11-stable/sbin/ggate/shared/ggate.c
/freebsd-11-stable/sbin/ggate/shared/ggate.h
/freebsd-11-stable/sbin/gvinum/gvinum.c
/freebsd-11-stable/sbin/hastctl/hastctl.c
/freebsd-11-stable/sbin/hastd/activemap.c
/freebsd-11-stable/sbin/hastd/activemap.h
/freebsd-11-stable/sbin/hastd/control.c
/freebsd-11-stable/sbin/hastd/control.h
/freebsd-11-stable/sbin/hastd/ebuf.c
/freebsd-11-stable/sbin/hastd/ebuf.h
/freebsd-11-stable/sbin/hastd/event.c
/freebsd-11-stable/sbin/hastd/event.h
/freebsd-11-stable/sbin/hastd/hast.h
/freebsd-11-stable/sbin/hastd/hast_checksum.c
/freebsd-11-stable/sbin/hastd/hast_checksum.h
/freebsd-11-stable/sbin/hastd/hast_compression.c
/freebsd-11-stable/sbin/hastd/hast_compression.h
/freebsd-11-stable/sbin/hastd/hast_proto.c
/freebsd-11-stable/sbin/hastd/hast_proto.h
/freebsd-11-stable/sbin/hastd/hastd.c
/freebsd-11-stable/sbin/hastd/hastd.h
/freebsd-11-stable/sbin/hastd/hooks.c
/freebsd-11-stable/sbin/hastd/hooks.h
/freebsd-11-stable/sbin/hastd/lzf.c
/freebsd-11-stable/sbin/hastd/lzf.h
/freebsd-11-stable/sbin/hastd/metadata.c
/freebsd-11-stable/sbin/hastd/metadata.h
/freebsd-11-stable/sbin/hastd/nv.c
/freebsd-11-stable/sbin/hastd/nv.h
/freebsd-11-stable/sbin/hastd/parse.y
/freebsd-11-stable/sbin/hastd/pjdlog.c
/freebsd-11-stable/sbin/hastd/pjdlog.h
/freebsd-11-stable/sbin/hastd/primary.c
/freebsd-11-stable/sbin/hastd/proto.c
/freebsd-11-stable/sbin/hastd/proto.h
/freebsd-11-stable/sbin/hastd/proto_common.c
/freebsd-11-stable/sbin/hastd/proto_impl.h
/freebsd-11-stable/sbin/hastd/proto_socketpair.c
/freebsd-11-stable/sbin/hastd/proto_tcp.c
/freebsd-11-stable/sbin/hastd/proto_uds.c
/freebsd-11-stable/sbin/hastd/rangelock.c
/freebsd-11-stable/sbin/hastd/rangelock.h
/freebsd-11-stable/sbin/hastd/refcnt.h
/freebsd-11-stable/sbin/hastd/secondary.c
/freebsd-11-stable/sbin/hastd/subr.c
/freebsd-11-stable/sbin/hastd/subr.h
/freebsd-11-stable/sbin/hastd/synch.h
/freebsd-11-stable/sbin/hastd/token.l
/freebsd-11-stable/sbin/ifconfig/af_nd6.c
/freebsd-11-stable/sbin/ifconfig/carp.c
/freebsd-11-stable/sbin/ifconfig/ifbridge.c
/freebsd-11-stable/sbin/ifconfig/ifconfig.h
/freebsd-11-stable/sbin/ifconfig/iffib.c
/freebsd-11-stable/sbin/ifconfig/ifgif.c
/freebsd-11-stable/sbin/ifconfig/ifgre.c
/freebsd-11-stable/sbin/ifconfig/ifgroup.c
/freebsd-11-stable/sbin/ifconfig/ifieee80211.c
/freebsd-11-stable/sbin/ifconfig/ifmac.c
/freebsd-11-stable/sbin/ifconfig/ifpfsync.c
/freebsd-11-stable/sbin/iscontrol/auth_subr.c
/freebsd-11-stable/sbin/iscontrol/config.c
/freebsd-11-stable/sbin/iscontrol/fsm.c
/freebsd-11-stable/sbin/iscontrol/iscontrol.c
/freebsd-11-stable/sbin/iscontrol/iscontrol.h
/freebsd-11-stable/sbin/iscontrol/login.c
/freebsd-11-stable/sbin/iscontrol/misc.c
/freebsd-11-stable/sbin/iscontrol/pdu.c
/freebsd-11-stable/sbin/kldconfig/kldconfig.c
/freebsd-11-stable/sbin/kldload/kldload.c
/freebsd-11-stable/sbin/kldstat/kldstat.c
/freebsd-11-stable/sbin/kldunload/kldunload.c
/freebsd-11-stable/sbin/ldconfig/elfhints.c
/freebsd-11-stable/sbin/ldconfig/ldconfig.c
/freebsd-11-stable/sbin/ldconfig/ldconfig.h
/freebsd-11-stable/sbin/mdconfig/mdconfig.c
/freebsd-11-stable/sbin/mdmfs/mdmfs.c
/freebsd-11-stable/sbin/mksnap_ffs/mksnap_ffs.c
/freebsd-11-stable/sbin/mount/extern.h
/freebsd-11-stable/sbin/mount_fusefs/mount_fusefs.c
/freebsd-11-stable/sbin/mount_msdosfs/mount_msdosfs.c
/freebsd-11-stable/sbin/nandfs/lssnap.c
/freebsd-11-stable/sbin/nandfs/mksnap.c
/freebsd-11-stable/sbin/nandfs/nandfs.c
/freebsd-11-stable/sbin/nandfs/nandfs.h
/freebsd-11-stable/sbin/nandfs/rmsnap.c
/freebsd-11-stable/sbin/newfs_msdos/newfs_msdos.c
/freebsd-11-stable/sbin/newfs_nandfs/newfs_nandfs.c
/freebsd-11-stable/sbin/nos-tun/nos-tun.c
/freebsd-11-stable/sbin/nvmecontrol/devlist.c
/freebsd-11-stable/sbin/nvmecontrol/firmware.c
/freebsd-11-stable/sbin/nvmecontrol/identify.c
/freebsd-11-stable/sbin/nvmecontrol/logpage.c
/freebsd-11-stable/sbin/nvmecontrol/nvmecontrol.c
/freebsd-11-stable/sbin/nvmecontrol/nvmecontrol.h
/freebsd-11-stable/sbin/nvmecontrol/perftest.c
/freebsd-11-stable/sbin/nvmecontrol/reset.c
/freebsd-11-stable/sbin/pfctl/parse.y
/freebsd-11-stable/sbin/pfctl/pf_print_state.c
/freebsd-11-stable/sbin/pfctl/pfctl.c
/freebsd-11-stable/sbin/pfctl/pfctl.h
/freebsd-11-stable/sbin/pfctl/pfctl_parser.c
/freebsd-11-stable/sbin/pfctl/pfctl_parser.h
/freebsd-11-stable/sbin/pfctl/pfctl_radix.c
/freebsd-11-stable/sbin/pfctl/pfctl_table.c
/freebsd-11-stable/sbin/rcorder/rcorder.c
/freebsd-11-stable/sbin/reboot/nextboot.sh
/freebsd-11-stable/sbin/spppcontrol/spppcontrol.c
/freebsd-11-stable/usr.bin/ar/acplex.l
/freebsd-11-stable/usr.bin/ar/acpyacc.y
/freebsd-11-stable/usr.bin/ar/ar.h
/freebsd-11-stable/usr.bin/ar/read.c
/freebsd-11-stable/usr.bin/ar/util.c
/freebsd-11-stable/usr.bin/ar/write.c
/freebsd-11-stable/usr.bin/asa/asa.c
/freebsd-11-stable/usr.bin/at/at.c
/freebsd-11-stable/usr.bin/at/at.h
/freebsd-11-stable/usr.bin/at/panic.c
/freebsd-11-stable/usr.bin/at/panic.h
/freebsd-11-stable/usr.bin/at/parsetime.c
/freebsd-11-stable/usr.bin/at/parsetime.h
/freebsd-11-stable/usr.bin/at/perm.c
/freebsd-11-stable/usr.bin/at/perm.h
/freebsd-11-stable/usr.bin/at/privs.h
/freebsd-11-stable/usr.bin/bluetooth/bthost/bthost.c
/freebsd-11-stable/usr.bin/bluetooth/btsockstat/btsockstat.c
/freebsd-11-stable/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sdp.c
/freebsd-11-stable/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c
/freebsd-11-stable/usr.bin/brandelf/brandelf.c
/freebsd-11-stable/usr.bin/bsdiff/bsdiff/bsdiff.c
/freebsd-11-stable/usr.bin/bsdiff/bspatch/bspatch.c
/freebsd-11-stable/usr.bin/c89/c89.c
/freebsd-11-stable/usr.bin/c99/c99.c
/freebsd-11-stable/usr.bin/calendar/dates.c
/freebsd-11-stable/usr.bin/calendar/events.c
/freebsd-11-stable/usr.bin/calendar/ostern.c
/freebsd-11-stable/usr.bin/calendar/parsedata.c
/freebsd-11-stable/usr.bin/calendar/paskha.c
/freebsd-11-stable/usr.bin/calendar/sunpos.c
/freebsd-11-stable/usr.bin/cmp/link.c
/freebsd-11-stable/usr.bin/colldef/parse.y
/freebsd-11-stable/usr.bin/colldef/scan.l
/freebsd-11-stable/usr.bin/compress/zopen.h
/freebsd-11-stable/usr.bin/cpuset/cpuset.c
/freebsd-11-stable/usr.bin/csplit/csplit.c
/freebsd-11-stable/usr.bin/ctlstat/ctlstat.c
/freebsd-11-stable/usr.bin/dtc/checking.cc
/freebsd-11-stable/usr.bin/dtc/checking.hh
/freebsd-11-stable/usr.bin/dtc/dtb.cc
/freebsd-11-stable/usr.bin/dtc/dtb.hh
/freebsd-11-stable/usr.bin/dtc/dtc.cc
/freebsd-11-stable/usr.bin/dtc/fdt.cc
/freebsd-11-stable/usr.bin/dtc/fdt.hh
/freebsd-11-stable/usr.bin/dtc/input_buffer.cc
/freebsd-11-stable/usr.bin/dtc/input_buffer.hh
/freebsd-11-stable/usr.bin/dtc/string.cc
/freebsd-11-stable/usr.bin/dtc/util.hh
/freebsd-11-stable/usr.bin/elf2aout/elf2aout.c
/freebsd-11-stable/usr.bin/elfdump/elfdump.c
/freebsd-11-stable/usr.bin/env/envopts.c
/freebsd-11-stable/usr.bin/env/envopts.h
/freebsd-11-stable/usr.bin/fetch/fetch.c
/freebsd-11-stable/usr.bin/finger/pathnames.h
/freebsd-11-stable/usr.bin/fstat/functions.h
/freebsd-11-stable/usr.bin/fstat/fuser.c
/freebsd-11-stable/usr.bin/fstat/main.c
/freebsd-11-stable/usr.bin/fsync/fsync.c
/freebsd-11-stable/usr.bin/gcore/elfcore.c
/freebsd-11-stable/usr.bin/gencat/gencat.c
/freebsd-11-stable/usr.bin/getent/getent.c
/freebsd-11-stable/usr.bin/grep/file.c
/freebsd-11-stable/usr.bin/grep/grep.c
/freebsd-11-stable/usr.bin/grep/grep.h
/freebsd-11-stable/usr.bin/grep/queue.c
/freebsd-11-stable/usr.bin/grep/regex/fastmatch.c
/freebsd-11-stable/usr.bin/grep/regex/hashtable.c
/freebsd-11-stable/usr.bin/grep/regex/tre-fastmatch.c
/freebsd-11-stable/usr.bin/grep/util.c
/freebsd-11-stable/usr.bin/gzip/gzip.c
/freebsd-11-stable/usr.bin/gzip/unbzip2.c
/freebsd-11-stable/usr.bin/gzip/unpack.c
/freebsd-11-stable/usr.bin/gzip/unxz.c
/freebsd-11-stable/usr.bin/iconv/iconv.c
/freebsd-11-stable/usr.bin/indent/indent.h
/freebsd-11-stable/usr.bin/ipcrm/ipcrm.c
/freebsd-11-stable/usr.bin/ipcs/ipc.c
/freebsd-11-stable/usr.bin/ipcs/ipc.h
/freebsd-11-stable/usr.bin/ipcs/ipcs.c
/freebsd-11-stable/usr.bin/iscsictl/iscsictl.c
/freebsd-11-stable/usr.bin/iscsictl/iscsictl.h
/freebsd-11-stable/usr.bin/iscsictl/parse.y
/freebsd-11-stable/usr.bin/iscsictl/periphs.c
/freebsd-11-stable/usr.bin/iscsictl/token.l
/freebsd-11-stable/usr.bin/killall/killall.c
/freebsd-11-stable/usr.bin/ktrdump/ktrdump.c
/freebsd-11-stable/usr.bin/lastcomm/readrec.c
/freebsd-11-stable/usr.bin/ldd/extern.h
/freebsd-11-stable/usr.bin/ldd/ldd.c
/freebsd-11-stable/usr.bin/ldd/sods.c
/freebsd-11-stable/usr.bin/locale/locale.c
/freebsd-11-stable/usr.bin/locate/locate/concatdb.sh
/freebsd-11-stable/usr.bin/locate/locate/mklocatedb.sh
/freebsd-11-stable/usr.bin/locate/locate/updatedb.sh
/freebsd-11-stable/usr.bin/lockf/lockf.c
/freebsd-11-stable/usr.bin/login/login.h
/freebsd-11-stable/usr.bin/logins/logins.c
/freebsd-11-stable/usr.bin/m4/gnum4.c
/freebsd-11-stable/usr.bin/m4/trace.c
/freebsd-11-stable/usr.bin/man/man.sh
/freebsd-11-stable/usr.bin/mkcsmapper/ldef.h
/freebsd-11-stable/usr.bin/mkcsmapper/lex.l
/freebsd-11-stable/usr.bin/mkcsmapper/yacc.y
/freebsd-11-stable/usr.bin/mkesdb/ldef.h
/freebsd-11-stable/usr.bin/mkesdb/lex.l
/freebsd-11-stable/usr.bin/mkesdb/yacc.y
/freebsd-11-stable/usr.bin/mktemp/mktemp.c
/freebsd-11-stable/usr.bin/mkuzip/mkuzip.c
/freebsd-11-stable/usr.bin/ncal/ncal.c
/freebsd-11-stable/usr.bin/netstat/bpf.c
/freebsd-11-stable/usr.bin/netstat/netisr.c
/freebsd-11-stable/usr.bin/newgrp/newgrp.c
/freebsd-11-stable/usr.bin/nl/nl.c
/freebsd-11-stable/usr.bin/passwd/passwd.c
/freebsd-11-stable/usr.bin/pathchk/pathchk.c
/freebsd-11-stable/usr.bin/perror/perror.c
/freebsd-11-stable/usr.bin/procstat/procstat.c
/freebsd-11-stable/usr.bin/procstat/procstat.h
/freebsd-11-stable/usr.bin/procstat/procstat_args.c
/freebsd-11-stable/usr.bin/procstat/procstat_auxv.c
/freebsd-11-stable/usr.bin/procstat/procstat_basic.c
/freebsd-11-stable/usr.bin/procstat/procstat_bin.c
/freebsd-11-stable/usr.bin/procstat/procstat_cred.c
/freebsd-11-stable/usr.bin/procstat/procstat_files.c
/freebsd-11-stable/usr.bin/procstat/procstat_kstack.c
/freebsd-11-stable/usr.bin/procstat/procstat_rlimit.c
/freebsd-11-stable/usr.bin/procstat/procstat_sigs.c
/freebsd-11-stable/usr.bin/procstat/procstat_threads.c
/freebsd-11-stable/usr.bin/procstat/procstat_vm.c
/freebsd-11-stable/usr.bin/protect/protect.c
/freebsd-11-stable/usr.bin/rctl/rctl.c
/freebsd-11-stable/usr.bin/revoke/revoke.c
/freebsd-11-stable/usr.bin/seq/seq.c
/freebsd-11-stable/usr.bin/setchannel/setchannel.c
/freebsd-11-stable/usr.bin/sockstat/sockstat.c
/freebsd-11-stable/usr.bin/sort/bwstring.c
/freebsd-11-stable/usr.bin/sort/bwstring.h
/freebsd-11-stable/usr.bin/sort/coll.c
/freebsd-11-stable/usr.bin/sort/coll.h
/freebsd-11-stable/usr.bin/sort/file.c
/freebsd-11-stable/usr.bin/sort/file.h
/freebsd-11-stable/usr.bin/sort/mem.c
/freebsd-11-stable/usr.bin/sort/mem.h
/freebsd-11-stable/usr.bin/sort/radixsort.c
/freebsd-11-stable/usr.bin/sort/radixsort.h
/freebsd-11-stable/usr.bin/sort/sort.c
/freebsd-11-stable/usr.bin/sort/sort.h
/freebsd-11-stable/usr.bin/sort/vsort.c
/freebsd-11-stable/usr.bin/sort/vsort.h
/freebsd-11-stable/usr.bin/ssh-copy-id/ssh-copy-id.sh
/freebsd-11-stable/usr.bin/stat/stat.c
/freebsd-11-stable/usr.bin/stdbuf/stdbuf.c
/freebsd-11-stable/usr.bin/systat/convtbl.c
/freebsd-11-stable/usr.bin/systat/convtbl.h
/freebsd-11-stable/usr.bin/systat/devs.h
/freebsd-11-stable/usr.bin/systat/ifcmds.c
/freebsd-11-stable/usr.bin/systat/ifstat.c
/freebsd-11-stable/usr.bin/tabs/tabs.c
/freebsd-11-stable/usr.bin/tr/cmap.c
/freebsd-11-stable/usr.bin/tr/cmap.h
/freebsd-11-stable/usr.bin/tr/cset.c
/freebsd-11-stable/usr.bin/tr/cset.h
/freebsd-11-stable/usr.bin/truncate/truncate.c
/freebsd-11-stable/usr.bin/truss/truss.h
/freebsd-11-stable/usr.bin/unifdef/unifdef.c
/freebsd-11-stable/usr.bin/unifdef/unifdef.h
/freebsd-11-stable/usr.bin/unifdef/unifdefall.sh
/freebsd-11-stable/usr.bin/units/units.c
/freebsd-11-stable/usr.bin/unzip/unzip.c
/freebsd-11-stable/usr.bin/usbhidaction/usbhidaction.c
/freebsd-11-stable/usr.bin/usbhidctl/usbhid.c
/freebsd-11-stable/usr.bin/whereis/pathnames.h
/freebsd-11-stable/usr.bin/whereis/whereis.c
/freebsd-11-stable/usr.bin/which/which.c
/freebsd-11-stable/usr.bin/who/who.c
/freebsd-11-stable/usr.bin/ypcat/ypcat.c
/freebsd-11-stable/usr.bin/ypmatch/ypmatch.c
/freebsd-11-stable/usr.bin/ypwhich/ypwhich.c
/freebsd-11-stable/usr.sbin/ac/ac.c
/freebsd-11-stable/usr.sbin/acpi/acpiconf/acpiconf.c
/freebsd-11-stable/usr.sbin/acpi/acpidb/acpidb.c
/freebsd-11-stable/usr.sbin/acpi/acpidump/acpi.c
/freebsd-11-stable/usr.sbin/acpi/acpidump/acpi_user.c
/freebsd-11-stable/usr.sbin/acpi/acpidump/acpidump.c
/freebsd-11-stable/usr.sbin/acpi/acpidump/acpidump.h
/freebsd-11-stable/usr.sbin/adduser/adduser.sh
/freebsd-11-stable/usr.sbin/adduser/rmuser.sh
/freebsd-11-stable/usr.sbin/apmd/apmd.c
/freebsd-11-stable/usr.sbin/apmd/apmd.h
/freebsd-11-stable/usr.sbin/apmd/apmdlex.l
/freebsd-11-stable/usr.sbin/apmd/apmdparse.y
/freebsd-11-stable/usr.sbin/asf/asf.c
/freebsd-11-stable/usr.sbin/asf/asf.h
/freebsd-11-stable/usr.sbin/asf/asf_kld.c
/freebsd-11-stable/usr.sbin/asf/asf_kvm.c
/freebsd-11-stable/usr.sbin/asf/asf_prog.c
acpi.c
acpi.h
ahci.h
bhyverun.c
bhyverun.h
block_if.c
block_if.h
consport.c
dbgport.c
dbgport.h
inout.c
inout.h
ioapic.c
ioapic.h
mem.c
mem.h
mevent.c
mevent.h
mevent_test.c
mptbl.c
mptbl.h
pci_ahci.c
pci_emul.c
pci_emul.h
pci_hostbridge.c
pci_lpc.c
pci_lpc.h
pci_passthru.c
pci_uart.c
pci_virtio_block.c
pci_virtio_net.c
pm.c
post.c
rtc.c
rtc.h
smbiostbl.c
smbiostbl.h
spinup_ap.c
spinup_ap.h
uart_emul.c
uart_emul.h
virtio.c
virtio.h
xmsr.c
xmsr.h
/freebsd-11-stable/usr.sbin/bhyvectl/bhyvectl.c
/freebsd-11-stable/usr.sbin/bhyveload/bhyveload.c
/freebsd-11-stable/usr.sbin/bluetooth/bcmfw/bcmfw.c
/freebsd-11-stable/usr.sbin/bluetooth/bt3cfw/bt3cfw.c
/freebsd-11-stable/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.c
/freebsd-11-stable/usr.sbin/bluetooth/bthidcontrol/bthidcontrol.h
/freebsd-11-stable/usr.sbin/bluetooth/bthidcontrol/hid.c
/freebsd-11-stable/usr.sbin/bluetooth/bthidcontrol/sdp.c
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/bthid_config.h
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/bthidd.c
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/bthidd.h
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/client.c
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/hid.c
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/kbd.c
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/kbd.h
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/lexer.l
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/parser.y
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/server.c
/freebsd-11-stable/usr.sbin/bluetooth/bthidd/session.c
/freebsd-11-stable/usr.sbin/bluetooth/btpand/bnep.c
/freebsd-11-stable/usr.sbin/bluetooth/btpand/bnep.h
/freebsd-11-stable/usr.sbin/bluetooth/btpand/btpand.c
/freebsd-11-stable/usr.sbin/bluetooth/btpand/btpand.h
/freebsd-11-stable/usr.sbin/bluetooth/btpand/channel.c
/freebsd-11-stable/usr.sbin/bluetooth/btpand/client.c
/freebsd-11-stable/usr.sbin/bluetooth/btpand/event.c
/freebsd-11-stable/usr.sbin/bluetooth/btpand/event.h
/freebsd-11-stable/usr.sbin/bluetooth/btpand/packet.c
/freebsd-11-stable/usr.sbin/bluetooth/btpand/sdp.c
/freebsd-11-stable/usr.sbin/bluetooth/btpand/sdp.h
/freebsd-11-stable/usr.sbin/bluetooth/btpand/server.c
/freebsd-11-stable/usr.sbin/bluetooth/btpand/tap.c
/freebsd-11-stable/usr.sbin/bluetooth/hccontrol/hccontrol.c
/freebsd-11-stable/usr.sbin/bluetooth/hccontrol/hccontrol.h
/freebsd-11-stable/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c
/freebsd-11-stable/usr.sbin/bluetooth/hccontrol/info.c
/freebsd-11-stable/usr.sbin/bluetooth/hccontrol/link_control.c
/freebsd-11-stable/usr.sbin/bluetooth/hccontrol/link_policy.c
/freebsd-11-stable/usr.sbin/bluetooth/hccontrol/node.c
/freebsd-11-stable/usr.sbin/bluetooth/hccontrol/send_recv.c
/freebsd-11-stable/usr.sbin/bluetooth/hccontrol/status.c
/freebsd-11-stable/usr.sbin/bluetooth/hccontrol/util.c
/freebsd-11-stable/usr.sbin/bluetooth/hcsecd/hcsecd.c
/freebsd-11-stable/usr.sbin/bluetooth/hcsecd/hcsecd.h
/freebsd-11-stable/usr.sbin/bluetooth/hcsecd/lexer.l
/freebsd-11-stable/usr.sbin/bluetooth/hcsecd/parser.y
/freebsd-11-stable/usr.sbin/bluetooth/hcseriald/hcseriald.c
/freebsd-11-stable/usr.sbin/bluetooth/l2control/l2cap.c
/freebsd-11-stable/usr.sbin/bluetooth/l2control/l2control.c
/freebsd-11-stable/usr.sbin/bluetooth/l2control/l2control.h
/freebsd-11-stable/usr.sbin/bluetooth/l2ping/l2ping.c
/freebsd-11-stable/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpcontrol/sdpcontrol.h
/freebsd-11-stable/usr.sbin/bluetooth/sdpcontrol/search.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/bgd.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/dun.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/ftrn.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/gn.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/irmc.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/irmc_command.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/lan.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/log.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/log.h
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/main.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/nap.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/opush.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/panu.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/profile.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/profile.h
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/provider.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/provider.h
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/sar.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/scr.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/sd.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/server.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/server.h
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/sp.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/srr.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/ssar.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/ssr.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/sur.c
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/uuid-private.h
/freebsd-11-stable/usr.sbin/bluetooth/sdpd/uuid.c
/freebsd-11-stable/usr.sbin/boot0cfg/boot0cfg.c
/freebsd-11-stable/usr.sbin/bsdinstall/distextract/distextract.c
/freebsd-11-stable/usr.sbin/bsdinstall/distfetch/distfetch.c
/freebsd-11-stable/usr.sbin/bsdinstall/partedit/diskeditor.c
/freebsd-11-stable/usr.sbin/bsdinstall/partedit/diskeditor.h
/freebsd-11-stable/usr.sbin/bsdinstall/partedit/gpart_ops.c
/freebsd-11-stable/usr.sbin/bsdinstall/partedit/part_wizard.c
/freebsd-11-stable/usr.sbin/bsdinstall/partedit/partedit.c
/freebsd-11-stable/usr.sbin/bsdinstall/partedit/partedit.h
/freebsd-11-stable/usr.sbin/bsdinstall/partedit/partedit_generic.c
/freebsd-11-stable/usr.sbin/bsdinstall/partedit/partedit_powerpc.c
/freebsd-11-stable/usr.sbin/bsdinstall/partedit/partedit_sparc64.c
/freebsd-11-stable/usr.sbin/bsdinstall/partedit/partedit_x86.c
/freebsd-11-stable/usr.sbin/bsdinstall/partedit/scripted.c
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_pf.c
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_snmp.c
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_snmp.h
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h
/freebsd-11-stable/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c
/freebsd-11-stable/usr.sbin/btxld/btx.h
/freebsd-11-stable/usr.sbin/btxld/btxld.c
/freebsd-11-stable/usr.sbin/btxld/elfh.c
/freebsd-11-stable/usr.sbin/btxld/elfh.h
/freebsd-11-stable/usr.sbin/chkgrp/chkgrp.c
/freebsd-11-stable/usr.sbin/ckdist/ckdist.c
/freebsd-11-stable/usr.sbin/clear_locks/clear_locks.c
/freebsd-11-stable/usr.sbin/cpucontrol/amd.c
/freebsd-11-stable/usr.sbin/cpucontrol/amd.h
/freebsd-11-stable/usr.sbin/cpucontrol/cpucontrol.c
/freebsd-11-stable/usr.sbin/cpucontrol/cpucontrol.h
/freebsd-11-stable/usr.sbin/cpucontrol/intel.c
/freebsd-11-stable/usr.sbin/cpucontrol/intel.h
/freebsd-11-stable/usr.sbin/cpucontrol/via.c
/freebsd-11-stable/usr.sbin/cpucontrol/via.h
/freebsd-11-stable/usr.sbin/crunch/crunchide/exec_elf32.c
/freebsd-11-stable/usr.sbin/crunch/crunchide/exec_elf64.c
/freebsd-11-stable/usr.sbin/crunch/crunchide/extern.h
/freebsd-11-stable/usr.sbin/ctladm/ctladm.h
/freebsd-11-stable/usr.sbin/ctladm/util.c
/freebsd-11-stable/usr.sbin/ctld/ctld.c
/freebsd-11-stable/usr.sbin/ctld/ctld.h
/freebsd-11-stable/usr.sbin/ctld/discovery.c
/freebsd-11-stable/usr.sbin/ctld/kernel.c
/freebsd-11-stable/usr.sbin/ctld/keys.c
/freebsd-11-stable/usr.sbin/ctld/log.c
/freebsd-11-stable/usr.sbin/ctld/login.c
/freebsd-11-stable/usr.sbin/ctld/parse.y
/freebsd-11-stable/usr.sbin/ctld/pdu.c
/freebsd-11-stable/usr.sbin/ctld/token.l
/freebsd-11-stable/usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c
/freebsd-11-stable/usr.sbin/daemon/daemon.c
/freebsd-11-stable/usr.sbin/devinfo/devinfo.c
/freebsd-11-stable/usr.sbin/digictl/digictl.c
/freebsd-11-stable/usr.sbin/diskinfo/diskinfo.c
/freebsd-11-stable/usr.sbin/dumpcis/cardinfo.h
/freebsd-11-stable/usr.sbin/dumpcis/cis.h
/freebsd-11-stable/usr.sbin/dumpcis/main.c
/freebsd-11-stable/usr.sbin/dumpcis/printcis.c
/freebsd-11-stable/usr.sbin/dumpcis/readcis.c
/freebsd-11-stable/usr.sbin/dumpcis/readcis.h
/freebsd-11-stable/usr.sbin/eeprom/eeprom.c
/freebsd-11-stable/usr.sbin/eeprom/ofw_options.c
/freebsd-11-stable/usr.sbin/eeprom/ofw_options.h
/freebsd-11-stable/usr.sbin/etcupdate/etcupdate.sh
/freebsd-11-stable/usr.sbin/extattr/rmextattr.c
/freebsd-11-stable/usr.sbin/extattrctl/extattrctl.c
/freebsd-11-stable/usr.sbin/fdcontrol/fdcontrol.c
/freebsd-11-stable/usr.sbin/fdformat/fdformat.c
/freebsd-11-stable/usr.sbin/fdread/fdread.c
/freebsd-11-stable/usr.sbin/fdread/fdutil.c
/freebsd-11-stable/usr.sbin/fdread/fdutil.h
/freebsd-11-stable/usr.sbin/fifolog/fifolog_create/fifolog_create.c
/freebsd-11-stable/usr.sbin/fifolog/fifolog_reader/fifolog_reader.c
/freebsd-11-stable/usr.sbin/fifolog/fifolog_writer/fifolog_writer.c
/freebsd-11-stable/usr.sbin/fifolog/lib/fifolog.h
/freebsd-11-stable/usr.sbin/fifolog/lib/fifolog_create.c
/freebsd-11-stable/usr.sbin/fifolog/lib/fifolog_int.c
/freebsd-11-stable/usr.sbin/fifolog/lib/fifolog_reader.c
/freebsd-11-stable/usr.sbin/fifolog/lib/fifolog_write.h
/freebsd-11-stable/usr.sbin/fifolog/lib/fifolog_write_poll.c
/freebsd-11-stable/usr.sbin/fifolog/lib/libfifolog.h
/freebsd-11-stable/usr.sbin/fifolog/lib/libfifolog_int.h
/freebsd-11-stable/usr.sbin/fifolog/lib/miniobj.h
/freebsd-11-stable/usr.sbin/flowctl/flowctl.c
/freebsd-11-stable/usr.sbin/freebsd-update/freebsd-update.sh
/freebsd-11-stable/usr.sbin/getfmac/getfmac.c
/freebsd-11-stable/usr.sbin/getpmac/getpmac.c
/freebsd-11-stable/usr.sbin/gpioctl/gpioctl.c
/freebsd-11-stable/usr.sbin/gssd/gssd.c
/freebsd-11-stable/usr.sbin/gstat/gstat.c
/freebsd-11-stable/usr.sbin/i2c/i2c.c
/freebsd-11-stable/usr.sbin/inetd/builtins.c
/freebsd-11-stable/usr.sbin/iscsid/discovery.c
/freebsd-11-stable/usr.sbin/iscsid/iscsid.c
/freebsd-11-stable/usr.sbin/iscsid/iscsid.h
/freebsd-11-stable/usr.sbin/iscsid/keys.c
/freebsd-11-stable/usr.sbin/iscsid/log.c
/freebsd-11-stable/usr.sbin/iscsid/login.c
/freebsd-11-stable/usr.sbin/iscsid/pdu.c
/freebsd-11-stable/usr.sbin/jail/command.c
/freebsd-11-stable/usr.sbin/jail/config.c
/freebsd-11-stable/usr.sbin/jail/jail.c
/freebsd-11-stable/usr.sbin/jail/jaillex.l
/freebsd-11-stable/usr.sbin/jail/jailp.h
/freebsd-11-stable/usr.sbin/jail/jailparse.y
/freebsd-11-stable/usr.sbin/jail/state.c
/freebsd-11-stable/usr.sbin/jexec/jexec.c
/freebsd-11-stable/usr.sbin/jls/jls.c
/freebsd-11-stable/usr.sbin/kbdcontrol/kbdcontrol.c
/freebsd-11-stable/usr.sbin/kbdcontrol/lex.h
/freebsd-11-stable/usr.sbin/kbdcontrol/lex.l
/freebsd-11-stable/usr.sbin/kbdmap/kbdmap.c
/freebsd-11-stable/usr.sbin/kbdmap/kbdmap.h
/freebsd-11-stable/usr.sbin/kgzip/aouthdr.c
/freebsd-11-stable/usr.sbin/kgzip/aouthdr.h
/freebsd-11-stable/usr.sbin/kgzip/elfhdr.c
/freebsd-11-stable/usr.sbin/kgzip/elfhdr.h
/freebsd-11-stable/usr.sbin/kgzip/kgz.h
/freebsd-11-stable/usr.sbin/kgzip/kgzcmp.c
/freebsd-11-stable/usr.sbin/kgzip/kgzip.c
/freebsd-11-stable/usr.sbin/kgzip/kgzip.h
/freebsd-11-stable/usr.sbin/kgzip/kgzld.c
/freebsd-11-stable/usr.sbin/kgzip/xio.c
/freebsd-11-stable/usr.sbin/kldxref/ef_amd64.c
/freebsd-11-stable/usr.sbin/kldxref/ef_i386.c
/freebsd-11-stable/usr.sbin/kldxref/ef_nop.c
/freebsd-11-stable/usr.sbin/kldxref/ef_powerpc.c
/freebsd-11-stable/usr.sbin/kldxref/ef_sparc64.c
/freebsd-11-stable/usr.sbin/lastlogin/lastlogin.c
/freebsd-11-stable/usr.sbin/lpr/chkprintcap/skimprintcap.c
/freebsd-11-stable/usr.sbin/lpr/chkprintcap/skimprintcap.h
/freebsd-11-stable/usr.sbin/lpr/common_source/ctlinfo.c
/freebsd-11-stable/usr.sbin/lpr/common_source/ctlinfo.h
/freebsd-11-stable/usr.sbin/lpr/common_source/lp.cdefs.h
/freebsd-11-stable/usr.sbin/lpr/common_source/matchjobs.c
/freebsd-11-stable/usr.sbin/lpr/common_source/matchjobs.h
/freebsd-11-stable/usr.sbin/lpr/filters.ru/koi2855/koi2855.c
/freebsd-11-stable/usr.sbin/lpr/filters.ru/koi2alt/koi2alt.c
/freebsd-11-stable/usr.sbin/lpr/lp/lp.sh
/freebsd-11-stable/usr.sbin/lpr/lpc/movejobs.c
/freebsd-11-stable/usr.sbin/lptcontrol/lptcontrol.c
/freebsd-11-stable/usr.sbin/mailwrapper/mailwrapper.c
/freebsd-11-stable/usr.sbin/mailwrapper/pathnames.h
/freebsd-11-stable/usr.sbin/makefs/cd9660.c
/freebsd-11-stable/usr.sbin/makefs/cd9660.h
/freebsd-11-stable/usr.sbin/makefs/cd9660/cd9660_archimedes.c
/freebsd-11-stable/usr.sbin/makefs/cd9660/cd9660_archimedes.h
/freebsd-11-stable/usr.sbin/makefs/cd9660/cd9660_conversion.c
/freebsd-11-stable/usr.sbin/makefs/cd9660/cd9660_debug.c
/freebsd-11-stable/usr.sbin/makefs/cd9660/cd9660_eltorito.c
/freebsd-11-stable/usr.sbin/makefs/cd9660/cd9660_eltorito.h
/freebsd-11-stable/usr.sbin/makefs/cd9660/cd9660_strings.c
/freebsd-11-stable/usr.sbin/makefs/cd9660/cd9660_write.c
/freebsd-11-stable/usr.sbin/makefs/cd9660/iso9660_rrip.c
/freebsd-11-stable/usr.sbin/makefs/cd9660/iso9660_rrip.h
/freebsd-11-stable/usr.sbin/makefs/ffs.h
/freebsd-11-stable/usr.sbin/makefs/ffs/buf.c
/freebsd-11-stable/usr.sbin/makefs/ffs/buf.h
/freebsd-11-stable/usr.sbin/makefs/ffs/ffs_bswap.c
/freebsd-11-stable/usr.sbin/makefs/ffs/newfs_extern.h
/freebsd-11-stable/usr.sbin/makefs/ffs/ufs_bswap.h
/freebsd-11-stable/usr.sbin/makefs/makefs.c
/freebsd-11-stable/usr.sbin/makefs/makefs.h
/freebsd-11-stable/usr.sbin/makefs/mtree.c
/freebsd-11-stable/usr.sbin/makefs/walk.c
/freebsd-11-stable/usr.sbin/memcontrol/memcontrol.c
/freebsd-11-stable/usr.sbin/mfiutil/mfi_bbu.c
/freebsd-11-stable/usr.sbin/mfiutil/mfi_cmd.c
/freebsd-11-stable/usr.sbin/mfiutil/mfi_config.c
/freebsd-11-stable/usr.sbin/mfiutil/mfi_drive.c
/freebsd-11-stable/usr.sbin/mfiutil/mfi_evt.c
/freebsd-11-stable/usr.sbin/mfiutil/mfi_flash.c
/freebsd-11-stable/usr.sbin/mfiutil/mfi_foreign.c
/freebsd-11-stable/usr.sbin/mfiutil/mfi_patrol.c
/freebsd-11-stable/usr.sbin/mfiutil/mfi_properties.c
/freebsd-11-stable/usr.sbin/mfiutil/mfi_show.c
/freebsd-11-stable/usr.sbin/mfiutil/mfi_volume.c
/freebsd-11-stable/usr.sbin/mfiutil/mfiutil.c
/freebsd-11-stable/usr.sbin/mfiutil/mfiutil.h
/freebsd-11-stable/usr.sbin/mlxcontrol/command.c
/freebsd-11-stable/usr.sbin/mlxcontrol/config.c
/freebsd-11-stable/usr.sbin/mlxcontrol/interface.c
/freebsd-11-stable/usr.sbin/mlxcontrol/mlxcontrol.h
/freebsd-11-stable/usr.sbin/mlxcontrol/util.c
/freebsd-11-stable/usr.sbin/moused/moused.c
/freebsd-11-stable/usr.sbin/mptable/mptable.c
/freebsd-11-stable/usr.sbin/mtest/mtest.c
/freebsd-11-stable/usr.sbin/nandsim/nandsim.c
/freebsd-11-stable/usr.sbin/nandsim/nandsim_cfgparse.c
/freebsd-11-stable/usr.sbin/nandsim/nandsim_cfgparse.h
/freebsd-11-stable/usr.sbin/nandtool/nand_erase.c
/freebsd-11-stable/usr.sbin/nandtool/nand_info.c
/freebsd-11-stable/usr.sbin/nandtool/nand_read.c
/freebsd-11-stable/usr.sbin/nandtool/nand_readoob.c
/freebsd-11-stable/usr.sbin/nandtool/nand_write.c
/freebsd-11-stable/usr.sbin/nandtool/nand_writeoob.c
/freebsd-11-stable/usr.sbin/nandtool/nandtool.c
/freebsd-11-stable/usr.sbin/nandtool/nandtool.h
/freebsd-11-stable/usr.sbin/nandtool/usage.h
/freebsd-11-stable/usr.sbin/newsyslog/extern.h
/freebsd-11-stable/usr.sbin/pciconf/err.c
/freebsd-11-stable/usr.sbin/pkg/config.c
/freebsd-11-stable/usr.sbin/pkg/config.h
/freebsd-11-stable/usr.sbin/pkg/dns_utils.c
/freebsd-11-stable/usr.sbin/pkg/dns_utils.h
/freebsd-11-stable/usr.sbin/pkg/pkg.c
/freebsd-11-stable/usr.sbin/pmcannotate/pmcannotate.c
/freebsd-11-stable/usr.sbin/pmccontrol/pmccontrol.c
/freebsd-11-stable/usr.sbin/pmcstat/pmcpl_annotate.c
/freebsd-11-stable/usr.sbin/pmcstat/pmcpl_annotate.h
/freebsd-11-stable/usr.sbin/pmcstat/pmcpl_annotate_cg.c
/freebsd-11-stable/usr.sbin/pmcstat/pmcpl_annotate_cg.h
/freebsd-11-stable/usr.sbin/pmcstat/pmcpl_callgraph.c
/freebsd-11-stable/usr.sbin/pmcstat/pmcpl_callgraph.h
/freebsd-11-stable/usr.sbin/pmcstat/pmcpl_calltree.c
/freebsd-11-stable/usr.sbin/pmcstat/pmcpl_calltree.h
/freebsd-11-stable/usr.sbin/pmcstat/pmcpl_gprof.c
/freebsd-11-stable/usr.sbin/pmcstat/pmcpl_gprof.h
/freebsd-11-stable/usr.sbin/pmcstat/pmcstat.c
/freebsd-11-stable/usr.sbin/pmcstat/pmcstat.h
/freebsd-11-stable/usr.sbin/pmcstat/pmcstat_log.c
/freebsd-11-stable/usr.sbin/pmcstat/pmcstat_log.h
/freebsd-11-stable/usr.sbin/pmcstat/pmcstat_top.h
/freebsd-11-stable/usr.sbin/portsnap/make_index/make_index.c
/freebsd-11-stable/usr.sbin/portsnap/phttpget/phttpget.c
/freebsd-11-stable/usr.sbin/portsnap/portsnap/portsnap.sh
/freebsd-11-stable/usr.sbin/powerd/powerd.c
/freebsd-11-stable/usr.sbin/ppp/acf.c
/freebsd-11-stable/usr.sbin/ppp/acf.h
/freebsd-11-stable/usr.sbin/ppp/arp.c
/freebsd-11-stable/usr.sbin/ppp/arp.h
/freebsd-11-stable/usr.sbin/ppp/async.c
/freebsd-11-stable/usr.sbin/ppp/async.h
/freebsd-11-stable/usr.sbin/ppp/auth.c
/freebsd-11-stable/usr.sbin/ppp/auth.h
/freebsd-11-stable/usr.sbin/ppp/bundle.c
/freebsd-11-stable/usr.sbin/ppp/bundle.h
/freebsd-11-stable/usr.sbin/ppp/cbcp.c
/freebsd-11-stable/usr.sbin/ppp/cbcp.h
/freebsd-11-stable/usr.sbin/ppp/ccp.c
/freebsd-11-stable/usr.sbin/ppp/ccp.h
/freebsd-11-stable/usr.sbin/ppp/chap.c
/freebsd-11-stable/usr.sbin/ppp/chap.h
/freebsd-11-stable/usr.sbin/ppp/chap_ms.c
/freebsd-11-stable/usr.sbin/ppp/chap_ms.h
/freebsd-11-stable/usr.sbin/ppp/chat.c
/freebsd-11-stable/usr.sbin/ppp/chat.h
/freebsd-11-stable/usr.sbin/ppp/command.c
/freebsd-11-stable/usr.sbin/ppp/command.h
/freebsd-11-stable/usr.sbin/ppp/datalink.c
/freebsd-11-stable/usr.sbin/ppp/datalink.h
/freebsd-11-stable/usr.sbin/ppp/deflate.c
/freebsd-11-stable/usr.sbin/ppp/deflate.h
/freebsd-11-stable/usr.sbin/ppp/defs.c
/freebsd-11-stable/usr.sbin/ppp/defs.h
/freebsd-11-stable/usr.sbin/ppp/descriptor.h
/freebsd-11-stable/usr.sbin/ppp/ether.c
/freebsd-11-stable/usr.sbin/ppp/ether.h
/freebsd-11-stable/usr.sbin/ppp/exec.c
/freebsd-11-stable/usr.sbin/ppp/exec.h
/freebsd-11-stable/usr.sbin/ppp/filter.c
/freebsd-11-stable/usr.sbin/ppp/filter.h
/freebsd-11-stable/usr.sbin/ppp/fsm.c
/freebsd-11-stable/usr.sbin/ppp/fsm.h
/freebsd-11-stable/usr.sbin/ppp/hdlc.c
/freebsd-11-stable/usr.sbin/ppp/hdlc.h
/freebsd-11-stable/usr.sbin/ppp/i4b.h
/freebsd-11-stable/usr.sbin/ppp/id.c
/freebsd-11-stable/usr.sbin/ppp/id.h
/freebsd-11-stable/usr.sbin/ppp/iface.c
/freebsd-11-stable/usr.sbin/ppp/iface.h
/freebsd-11-stable/usr.sbin/ppp/ip.c
/freebsd-11-stable/usr.sbin/ppp/ip.h
/freebsd-11-stable/usr.sbin/ppp/ipcp.c
/freebsd-11-stable/usr.sbin/ppp/ipcp.h
/freebsd-11-stable/usr.sbin/ppp/iplist.c
/freebsd-11-stable/usr.sbin/ppp/iplist.h
/freebsd-11-stable/usr.sbin/ppp/ipv6cp.c
/freebsd-11-stable/usr.sbin/ppp/ipv6cp.h
/freebsd-11-stable/usr.sbin/ppp/layer.h
/freebsd-11-stable/usr.sbin/ppp/lcp.c
/freebsd-11-stable/usr.sbin/ppp/lcp.h
/freebsd-11-stable/usr.sbin/ppp/link.c
/freebsd-11-stable/usr.sbin/ppp/link.h
/freebsd-11-stable/usr.sbin/ppp/log.c
/freebsd-11-stable/usr.sbin/ppp/log.h
/freebsd-11-stable/usr.sbin/ppp/lqr.c
/freebsd-11-stable/usr.sbin/ppp/lqr.h
/freebsd-11-stable/usr.sbin/ppp/main.c
/freebsd-11-stable/usr.sbin/ppp/main.h
/freebsd-11-stable/usr.sbin/ppp/mbuf.c
/freebsd-11-stable/usr.sbin/ppp/mbuf.h
/freebsd-11-stable/usr.sbin/ppp/mp.c
/freebsd-11-stable/usr.sbin/ppp/mp.h
/freebsd-11-stable/usr.sbin/ppp/mppe.c
/freebsd-11-stable/usr.sbin/ppp/mppe.h
/freebsd-11-stable/usr.sbin/ppp/nat_cmd.c
/freebsd-11-stable/usr.sbin/ppp/nat_cmd.h
/freebsd-11-stable/usr.sbin/ppp/ncp.c
/freebsd-11-stable/usr.sbin/ppp/ncp.h
/freebsd-11-stable/usr.sbin/ppp/ncpaddr.c
/freebsd-11-stable/usr.sbin/ppp/ncpaddr.h
/freebsd-11-stable/usr.sbin/ppp/netgraph.c
/freebsd-11-stable/usr.sbin/ppp/netgraph.h
/freebsd-11-stable/usr.sbin/ppp/pap.c
/freebsd-11-stable/usr.sbin/ppp/pap.h
/freebsd-11-stable/usr.sbin/ppp/pred.c
/freebsd-11-stable/usr.sbin/ppp/pred.h
/freebsd-11-stable/usr.sbin/ppp/probe.c
/freebsd-11-stable/usr.sbin/ppp/probe.h
/freebsd-11-stable/usr.sbin/ppp/prompt.c
/freebsd-11-stable/usr.sbin/ppp/prompt.h
/freebsd-11-stable/usr.sbin/ppp/proto.c
/freebsd-11-stable/usr.sbin/ppp/proto.h
/freebsd-11-stable/usr.sbin/ppp/radius.c
/freebsd-11-stable/usr.sbin/ppp/radius.h
/freebsd-11-stable/usr.sbin/ppp/route.c
/freebsd-11-stable/usr.sbin/ppp/route.h
/freebsd-11-stable/usr.sbin/ppp/server.c
/freebsd-11-stable/usr.sbin/ppp/server.h
/freebsd-11-stable/usr.sbin/ppp/sig.c
/freebsd-11-stable/usr.sbin/ppp/sig.h
/freebsd-11-stable/usr.sbin/ppp/sync.c
/freebsd-11-stable/usr.sbin/ppp/sync.h
/freebsd-11-stable/usr.sbin/ppp/systems.c
/freebsd-11-stable/usr.sbin/ppp/systems.h
/freebsd-11-stable/usr.sbin/ppp/tcp.c
/freebsd-11-stable/usr.sbin/ppp/tcp.h
/freebsd-11-stable/usr.sbin/ppp/tcpmss.c
/freebsd-11-stable/usr.sbin/ppp/tcpmss.h
/freebsd-11-stable/usr.sbin/ppp/throughput.c
/freebsd-11-stable/usr.sbin/ppp/throughput.h
/freebsd-11-stable/usr.sbin/ppp/timer.c
/freebsd-11-stable/usr.sbin/ppp/timer.h
/freebsd-11-stable/usr.sbin/ppp/tty.c
/freebsd-11-stable/usr.sbin/ppp/tty.h
/freebsd-11-stable/usr.sbin/ppp/tun.c
/freebsd-11-stable/usr.sbin/ppp/tun.h
/freebsd-11-stable/usr.sbin/ppp/ua.h
/freebsd-11-stable/usr.sbin/ppp/udp.c
/freebsd-11-stable/usr.sbin/ppp/udp.h
/freebsd-11-stable/usr.sbin/ppp/vjcomp.c
/freebsd-11-stable/usr.sbin/ppp/vjcomp.h
/freebsd-11-stable/usr.sbin/pppctl/pppctl.c
/freebsd-11-stable/usr.sbin/pw/bitmap.c
/freebsd-11-stable/usr.sbin/pw/bitmap.h
/freebsd-11-stable/usr.sbin/pw/cpdir.c
/freebsd-11-stable/usr.sbin/pw/grupd.c
/freebsd-11-stable/usr.sbin/pw/psdate.c
/freebsd-11-stable/usr.sbin/pw/psdate.h
/freebsd-11-stable/usr.sbin/pw/pw.c
/freebsd-11-stable/usr.sbin/pw/pw.h
/freebsd-11-stable/usr.sbin/pw/pw_conf.c
/freebsd-11-stable/usr.sbin/pw/pw_group.c
/freebsd-11-stable/usr.sbin/pw/pw_log.c
/freebsd-11-stable/usr.sbin/pw/pw_nis.c
/freebsd-11-stable/usr.sbin/pw/pw_user.c
/freebsd-11-stable/usr.sbin/pw/pw_vpw.c
/freebsd-11-stable/usr.sbin/pw/pwupd.c
/freebsd-11-stable/usr.sbin/pw/pwupd.h
/freebsd-11-stable/usr.sbin/pw/rm_r.c
/freebsd-11-stable/usr.sbin/quot/quot.c
/freebsd-11-stable/usr.sbin/rarpd/rarpd.c
/freebsd-11-stable/usr.sbin/rpc.lockd/kern.c
/freebsd-11-stable/usr.sbin/rpc.umntall/mounttab.c
/freebsd-11-stable/usr.sbin/rpc.umntall/mounttab.h
/freebsd-11-stable/usr.sbin/rpc.umntall/rpc.umntall.c
/freebsd-11-stable/usr.sbin/rpcbind/util.c
/freebsd-11-stable/usr.sbin/rtadvctl/rtadvctl.c
/freebsd-11-stable/usr.sbin/rtadvd/advcap.h
/freebsd-11-stable/usr.sbin/rtadvd/control.c
/freebsd-11-stable/usr.sbin/rtadvd/control.h
/freebsd-11-stable/usr.sbin/rtadvd/control_client.c
/freebsd-11-stable/usr.sbin/rtadvd/control_client.h
/freebsd-11-stable/usr.sbin/rtadvd/control_server.c
/freebsd-11-stable/usr.sbin/rtadvd/control_server.h
/freebsd-11-stable/usr.sbin/rtprio/rtprio.c
/freebsd-11-stable/usr.sbin/sa/db.c
/freebsd-11-stable/usr.sbin/sa/extern.h
/freebsd-11-stable/usr.sbin/sa/main.c
/freebsd-11-stable/usr.sbin/sa/pathnames.h
/freebsd-11-stable/usr.sbin/sa/pdb.c
/freebsd-11-stable/usr.sbin/sa/usrdb.c
/freebsd-11-stable/usr.sbin/service/service.sh
/freebsd-11-stable/usr.sbin/services_mkdb/extern.h
/freebsd-11-stable/usr.sbin/services_mkdb/services_mkdb.c
/freebsd-11-stable/usr.sbin/services_mkdb/uniq.c
/freebsd-11-stable/usr.sbin/setfmac/setfmac.c
/freebsd-11-stable/usr.sbin/setpmac/setpmac.c
/freebsd-11-stable/usr.sbin/smbmsg/pathnames.h
/freebsd-11-stable/usr.sbin/smbmsg/smbmsg.c
/freebsd-11-stable/usr.sbin/snapinfo/snapinfo.c
/freebsd-11-stable/usr.sbin/spkrtest/spkrtest.sh
/freebsd-11-stable/usr.sbin/spray/spray.c
/freebsd-11-stable/usr.sbin/traceroute/findsaddr-udp.c
/freebsd-11-stable/usr.sbin/uathload/uathload.c
/freebsd-11-stable/usr.sbin/ugidfw/ugidfw.c
/freebsd-11-stable/usr.sbin/uhsoctl/uhsoctl.c
/freebsd-11-stable/usr.sbin/unbound/local-setup/local-unbound-setup.sh
/freebsd-11-stable/usr.sbin/usbconfig/dump.c
/freebsd-11-stable/usr.sbin/usbconfig/dump.h
/freebsd-11-stable/usr.sbin/usbconfig/usbconfig.c
/freebsd-11-stable/usr.sbin/usbdump/usbdump.c
/freebsd-11-stable/usr.sbin/utx/utx.c
/freebsd-11-stable/usr.sbin/vidcontrol/decode.c
/freebsd-11-stable/usr.sbin/vidcontrol/vidcontrol.c
/freebsd-11-stable/usr.sbin/wake/wake.c
/freebsd-11-stable/usr.sbin/watch/watch.c
/freebsd-11-stable/usr.sbin/watchdogd/watchdogd.c
/freebsd-11-stable/usr.sbin/wlandebug/wlandebug.c
/freebsd-11-stable/usr.sbin/ypbind/ypbind.c
/freebsd-11-stable/usr.sbin/yppoll/yppoll.c
/freebsd-11-stable/usr.sbin/ypset/ypset.c
323427 11-Sep-2017 rlibby

bhyve: actually call bhyve_caph_cache_catpages

Gcc noticed that bhyve_caph_cache_catpages was defined but unused.
It is a stable/11 copy of caph_cache_catpages in head.

Direct commit to stable/11. This bug does not apply to head.

Reviewed by: grehan
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12212

323426 11-Sep-2017 rlibby

MFC r321669:

bhyve/vga.c: fix atc_color_select_67 bit shift

323425 11-Sep-2017 rlibby

MFC r321668:

bhyve/pci_e82545.c: squelch gcc warning for noreturn procedure

321413 24-Jul-2017 mav

MFC r305898, r309120, r309121 (by jceel):
Add virtio-console support to bhyve.

Adds virtio-console device support to bhyve, allowing to create
bidirectional character streams between host and guest.

Syntax:
-s <slotnum>,virtio-console,port1=/path/to/port1.sock,anotherport=...

Maximum of 16 ports per device can be created. Every port is named
and corresponds to an Unix domain socket created by bhyve. bhyve
accepts at most one connection per port at a time.

Limitations:
- due to lack of destructors of in bhyve, sockets on the filesystem
must be cleaned up manually after bhyve exits
- there's no way to use "console port" feature, nor the console port
resize as of now
- emergency write is advertised, but no-op as of now

321411 24-Jul-2017 mav

MFC r302850: Make PCI interupts allocation static when using bootrom (UEFI).

This makes factual interrupt routing match one shipped with UEFI firmware.
With old firmware this make legacy interrupts work reliable for functions 0
of PCI slots 3-6. Updated UEFI image fixes problem completely.

320891 11-Jul-2017 grehan

MFC r317542, r317543, r317543

317542 comment fix
317543 set rfb default port
317543 listen on localhost by default for rfb

320866 10-Jul-2017 grehan

MFC 313727, 317483
In addition, replace the missing caph routines with
small helper functions (bhyverun.c) or an open-coded
replacement (uart_emul.c)

313727 Capsicumize bhyve
317483 Allow CAP_MMAP_RW on memfd for PCI passthru

320855 10-Jul-2017 grehan

MFC r311699

ps2 mouse fixes, found by plan9/9front.

Reminded by: sevan

320567 02-Jul-2017 araujo

MFC r319487-r319488, r319682, r319968, r319995

r319487:
Add VNC Authentication support based on RFC6143 section 7.2.2.

Submitted by: Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
Reworked by: myself
Reviewed by: grehan, rgrimes and jilles
Relnotes: Yes.
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D10818

r319488:
Bump manpage date.

r319682:
Make the VNC authentication build with LibreSSL on HardenedBSD and TrueOS.

PR: 219790
Submitted by: Shirkdog <mshirk@daemon-security.com>
Reviewed by: grehan and rgrimes
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D11071

r319968:
Initialize variables and use byteorder(9) instead of aliasing char array
buf via uint32_t pointer.

CID: 1375949
Reported by: Coverity, cem
Reviewed by: cem
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D11153

r319995:
Check if pthread_create(3) successfully created the thread prior to call
pthread_join(3). The variable tid is not yet initialized in case
the authentication fails at early stage, that would lead pthread_join be
called with an uninitialized variable.

CID: 1375950
Reported by: Coverity, cem
Reviewed by: cem
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D11150

319919 13-Jun-2017 rgrimes

MFC r307517, r314342, r316357, r317545, r317777:

r307517:
Typo fixed: arbitraty -> arbitrary.
PR: 213559

r314342:
bhyve: document virtio-console in the manpage

r316357:
Minor style improvements in bhyve.8
Replace "as of now" with "at present". As the change is a really minor one,
don't bump .Dd.

r317545:
Document raw framebuffer device and XHCI device configurations.

r317777:
Improve documentation of fbuf device.

Approved by: grehan (mentor)
Approved by: re (gjb)

319139 29-May-2017 pfg

MFC r318788:
bhyvegc_resize: make use of reallocarray(3) for bounds-checking.

Also add __FBSDID.

Reviewed by: grehan

318108 09-May-2017 bdrewery

DIRDEPS_BUILD: Update dependencies.

This is a direct commit since MFCing these changes is impractical.

Sponsored by: Dell EMC Isilon

317000 16-Apr-2017 mav

MFC r316427, r316428: Add Log directory and SATA NCQ Send and Receive Log.

Those are used at least by Linux guests to detect queued TRIM support.

315929 25-Mar-2017 grehan

MFC r315715 Fix a type in bhyve's USB mouse emulation.

313811 16-Feb-2017 grehan

MFC r311702
Use correct PCI device id for virtio-rng.
This prevented the device from attaching with a
Windows guest (most other guests use the device type
for matching)

PR: 212711

309402 02-Dec-2016 julian

MFH: r309295

bhyve: stability and performance improvement for dbgport

The TCP server implementation in dbgport does not track clients, so it
may try to write to a disconected socket resulting in SIGPIPE.
Avoid that by setting SO_NOSIGPIPE socket option.

Because dbgport emulates an I/O port to guest, the communication is done
byte by byte. Reduce latency of the TCP/IP transfers by using
TCP_NODELAY option. In my tests that change improves performance of
kgdb commands with lots of output (e.g. info threads) by two orders of
magnitude.

A general note. Since we have a uart emulation in bhyve, that can be
used for the console and gdb access to guests. So, bvmconsole and bvmdebug
could be de-orbited now. But there are many existing deployments that
still dependend on those.

Discussed with: julian, jhb
Sponsored by: Panzura

307939 25-Oct-2016 glebius

Merge r307937:
Fix unchecked array reference in the VGA device emulation code.

Submitted by: Ilja Van Sprundel <ivansprundel ioactive.com>
Patch by: tychon
Security: SA-16:32

307919 25-Oct-2016 bapt

accept4 actually expect SOCK_NONBLOCK and not O_NONBLOCK

Reported by: jhb
Pointyhat to: bapt

307791 22-Oct-2016 bapt

MFC r306554:

Use accept4 with O_NONBLOCK rather than accept + fcntl

305718 12-Sep-2016 grehan

MFC r305061
Invert calloc(3) argument order

305717 12-Sep-2016 grehan

MFC r303352
- Change the fbuf "vga" parameter to "vga=on|io|off".
"io" is the default, and allows VGA i/o registers to be
accessed. This is required by Win7/2k8 graphics guests that
use a combination of BIOS int10 and UEFI.
"off" disables all VGA i/o and mem accesses.
"on" is not yet hooked up, but will enable full VGA rendering.

OpenBSD/UEFI >= 5.9 graphics guests can be booted using "vga=off"

- Allow "rfb" to be used instead of "tcp" for the fbuf VNC
description. "tcp" will be removed at a future point and is
kept as an alias.

305716 12-Sep-2016 grehan

MFC r302972,r303349

r302972
Disallow interrupt requests on disabled endpoints.

r303349
Catch another case where an XHCI interrupt was being
injected without state being set up.

305714 12-Sep-2016 grehan

MFC r302546
Implement right shift/ctl, and convert the VNC/xorg scancode
of 0xff03 into right-alt.

304424 18-Aug-2016 mav

MFC r302504, r302666, r302668, r302932, r302933:
Add emulation for Intel e1000 (e82545) network adapter.

The code was successfully tested with FreeBSD, Linux, Solaris and Windows
guests. This interface is predictably slower (about 2x) then virtio-net,
but it is very helpful for guests not supporting virtio-net by default.

Thanks to Jeremiah Lott and Peter Grehan for doing original heavy lifting.

304423 18-Aug-2016 mav

MFC r302460: Add emulation for multiple (up to 16) MSI vectors for AHCI.

It was useless before, but may improve performance now if multiple devices
are configured and guest supports this feature.

Sponsored by: iXsystems, Inc.

304422 18-Aug-2016 mav

MFC r302459: Allow AHCI controller to support up to 32 arbitrary devices.

While old syntax is still supported, new syntax looks like this:

-s 3,ahci,hd:/dev/zvol/XXX,hd:/dev/zvol/YYY,cd:/storage/ZZZ.iso

Sponsored by: iXsystems, Inc.

303138 21-Jul-2016 mav

MFC r302957: Fix NCQ TRIM emulation.

When this code was written, there was no guests using it to test.

Approved by: re (kib)

302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
atkbdc.h
bhyvegc.c
bhyvegc.h
console.c
console.h
pci_fbuf.c
pci_xhci.c
pci_xhci.h
ps2kbd.c
ps2kbd.h
ps2mouse.c
ps2mouse.h
rfb.c
rfb.h
sockstream.c
sockstream.h
usb_emul.c
usb_emul.h
usb_mouse.c
vga.c
vga.h
302373 06-Jul-2016 ngie

Fix CTASSERT issue in a more clean way

- Replace all CTASSERT macro instances with static_assert's.
- Remove the WRAPPED_CTASSERT macro; it's now an unnecessary obfuscation.
- Localize all static_assert's to the structures being tested.
- Sort some headers per-style(9).

Approved by: re (hrs)
Differential Revision: https://reviews.freebsd.org/D7130
MFC after: 1 week
X-MFC with: r302364
Reviewed by: ed, grehan (maintainer)
Submitted by: ed
Sponsored by: EMC / Isilon Storage Division


302369 06-Jul-2016 ngie

Fix gcc warning

Remove -Wunused-but-set-variable (`mopt`).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division


302368 06-Jul-2016 ngie

Fix gcc build errors with SSE 4.2 detection and gcc warnings

- Remove -Wunused-but-set-variable's (`len`, etc).
- Replace clang-specific tests in sse42_supported(..) with generic,
FreeBSD-supported CPU feature tests, using macros and functions
from machine/cpufunc.h and machine/specialreg.h . The previous method
for determining SSE4.2 availability was only compatible with clang.
- Sort #includes per style(9).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division


302367 06-Jul-2016 ngie

Fix gcc warnings

Remove unused function (`fifo_available`)

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division


302366 06-Jul-2016 ngie

Fix gcc warnings

- Put parentheses around bitwise OR'ed values in the `FIELD_COPY(..)` and
`FIELD_REPLACE(..)` macros to mute warning from gcc 4.2.1.
- Remove -Wunused-but-set-variable's (`setup_addr`, `status_addr`).

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
X-MFC with: r302332
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division


302365 06-Jul-2016 ngie

Fix gcc warnings

Remove -Wunused-but-set-variable (`error`). Cast calls with
`(void)` to note that the return value is explicitly ignored.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division


302364 06-Jul-2016 ngie

Fix gcc warnings

Add `WRAPPED_CTASSERT` macro by annotating CTASSERTs with __unused
to deal with -Wunused-local-typedefs warnings from gcc 4.8+.
All other compilers (clang, etc) use CTASSERT as-is. A more generic
solution for this issue will be proposed after ^/stable/11 is forked.

Consolidate all CTASSERTs under one block instead of inlining them in
functions.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division


302363 06-Jul-2016 ngie

Fix gcc warnings

Put cfl/prdt under AHCI_DEBUG #defines as they are only used in
those cases.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division


302362 06-Jul-2016 ngie

Fix gcc warnings

- Remove -Wunused-but-set-variable (newcpu)
- Always return VMEXIT_CONTINUE as the code always set retval to that value.

Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D7119
MFC after: 1 week
Reported by: Jenkins
Reviewed by: grehan (maintainer)
Sponsored by: EMC / Isilon Storage Division


302332 04-Jul-2016 grehan

Import bhyve_graphics into CURRENT. Thanks to all who tested
this on the branch.

Original commit message:
Initial bhyve native graphics support.

This adds emulations for a raw framebuffer device, PS2 keyboard/mouse,
XHCI USB controller and a USB tablet.

A simple VNC server is provided for keyboard/mouse input, and graphics
output.

A VGA emulation is included, but is currently disconnected until an
additional bhyve change to block out VGA memory is committed.

Credits:
- raw framebuffer, VNC server, XHCI controller, USB bus/device emulation
and UEFI f/w support by Leon Dang
- VGA, console/g, initial VNC server by tychon@
- PS2 keyboard/mouse jointly done by tychon@ and Leon Dang
- hypervisor framebuffer mem support by neel@

Tested by: Michael Dexter, in a number of revisions of this code.

With the appropriate UEFI image, FreeBSD, Windows and Linux guests can
installed and run in graphics mode using the UEFI/GOP framebuffer.

Approved by: re (gjb)


302211 26-Jun-2016 novel

bhyve: improve memory size documentation

A couple of minor memory size option related nits:

- use common name 'memsize' (instead of 'max-size' or just 'size')
- bhyve: update usage with memsize unit suffix, drop legacy "MB"
unit
- bhyveload: update usage with memsize unit suffix
- bhyve(8): document default size
- bhyveload(8): use memsize formatting like it's done
in bhyve(8)

Reviewed by: wblock, grehan
Approved by: re (kib), wblock, grehan
Differential Revision: https://reviews.freebsd.org/D6952


300843 27-May-2016 bapt

Improve error message when failing to open a backing file

When bhyve cannot open a backing file, it now says explicitly which file
could not be opened

Note that the change has only be maed in block_if.c and not in
pci_virtio_block.c as the error will always be catched by the first

PR: 202321 (different patch)
Reviewed by: grehan
MFC after: 3 day
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D6576


299676 13-May-2016 pfg

bhyve: consider the bogus case of a negative bar idx.

This is a followup to r297472 to squelch Coverity.

CID: 1194319


299675 13-May-2016 pfg

bhyve: replace uninitialized variable "offset".

Use io->io_req.br_offset instead.

Suggested by: grehan
CID: 1288937


298454 22-Apr-2016 araujo

Use MIN()/MAX() macros from sys/param.h.

Reviewed by: grehan
Differential Revision: https://reviews.freebsd.org/D6054


298355 20-Apr-2016 grehan

Don't use SYSDIR to avoid conflicts with existing usage.
Also, use SRCTOP to locate the top of the source tree
instead of a relative path.

PR: 208856


298341 20-Apr-2016 novel

Update the bhyve(8) man page:

- Document powering off by sending SIGTERM signal
- Document exit codes

Reviewed by: wblock, neel
Approved by: wblock
Differential Revision: D5982


298295 19-Apr-2016 jhb

Always emit an error message on passthru configuration errors.

Previously, many errors (such as the PCI device not being attached
to the ppt(4) driver) resulted in bhyve silently exiting without
starting the virtual machine. Now any errors encountered when
configuring a virtual slot for a PCI passthru device should be noted
on stderr.

Reviewed by: neel
Differential Revision: https://reviews.freebsd.org/D5990


298107 16-Apr-2016 gjb

Merge the projects/release-pkg branch to head.

This allows packaging the base system with pkg(8), including
but not limited to providing the ability to provide upstream
binary update possibilities for non-tier-1 architectures.

This merge is a requirement of the 11.0-RELEASE, and as such,
thank you to everyone that has tested the project branch.

Documentation in build(7) etc. is still somewhat sparse, but
updates to those parts will follow.

Sponsored by: The FreeBSD Foundation


298098 16-Apr-2016 gjb

Final pass through bogus svn:mergeinfo removal.

Note, paths part of 'contrib' were left alone for now.

Sponsored by: The FreeBSD Foundation


297932 13-Apr-2016 jhb

Handle PBA that shares a page with MSI-X table for passthrough devices.

If the PBA shares a page with the MSI-X table, map the shared page via
/dev/mem and emulate accesses to the portion of the PBA in the shared
page by accessing the mapped page.

Reviewed by: grehan
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5919


297778 10-Apr-2016 grehan

Allow the location of the kernel source tree to be overridden.
This makes it easier for the bhyve executable to be built
out of the tree.


297589 05-Apr-2016 pfg

bhyve: Remove unneeded variable ncq.

ncq was not being inititialized properly but it was not actually
necessary either, so make the code smaller by removing it.

CID: 1248842
Reviewed by: grehan


297472 31-Mar-2016 pfg

pci_emul_dior(): fix uninitialized scalar variable.

Prevent from returning an unitialized value in case the
ior size is unknown.

CID: 1194319
Reviewed by: grehan


296829 14-Mar-2016 gnn

Fix typo: nmd->cur_tx_ring should be used in pci_vtnet_netmap_writev()
The buffer length should be checked to avoid overflow, but there
is no API to get the slot length, so the hardcoded value is used.
Return the currently-first request chain back to the available
queue if there are no more packets.
Report the link as up if we managed to open vale port.
Use consistent coding style.

Submitted by: btw
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5595


296417 05-Mar-2016 dim

Upgrade our copies of clang, llvm, lldb and compiler-rt to 3.8.0
release.

Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.

Release notes for llvm and clang will soon be available here:
<http://llvm.org/releases/3.8.0/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.8.0/tools/clang/docs/ReleaseNotes.html>

Thanks to Ed Maste, Roman Divacky, Davide Italiano and Antoine Brodin
for their help.

Relnotes: yes


294774 26-Jan-2016 araujo

Cleanup unused-but-set-variable spotted by gcc-4.9.

Reviewed by: neel
Approved by: rodrigc (mentor)
Differential Revision: https://reviews.freebsd.org/D5042


293643 10-Jan-2016 glebius

Fix bhyve(1) operation on vmnet devices, broken in r293459.


293459 09-Jan-2016 gnn

Add netmap support for bhyve

Submitted by: btw
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D4826


292982 31-Dec-2015 bz

Remove unused variable after r292981 to unbreak the build.


292981 31-Dec-2015 araujo

Clean up unused-but-set-variable spotted by gcc-4.9.

Reviewed by: grehan
Approved by: rodrigc (mentor)
Differential Revision: https://reviews.freebsd.org/D4734


292970 31-Dec-2015 araujo

Clean up unused-but-set-variable spotted by gcc-4.9.

Reviewed by: grehan
Approved by: bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D4735


290494 07-Nov-2015 bapt

Improve collation string and locales support

Merge collation support from Illumos and DragonflyBSD.

Locales are now generated with the new localedef(1) tool from CLDR POSIX files.
The generated files are now identified as "BSD 1.0" format.

The libc now only read "BSD 1.0" locales definitions, all other version will be
set to "C"
The localedef(1) tool has been imported from Illumos and modified to use tree(3)
instead of the CDDL avl(3)
A set of tool created by edwin@ and extended by marino@ for dragonfly has been
added to be able to generate locales and the Makefiles from the vanilla CLDR
unicode databases + a universal UTF-8 charmap (by marino@)
Update the locales to unicode v27
Given our regex(3) does not support multibyte (yet) it has been forced to always
use locale C
Remove now unused colldef(1) and mklocale(1)
Finish implementing the numeric BSD extension for ctypes
The number of supported locales has grown from 175 to 250 locales. Among the new
locales: 6 Arabic locales (AE EG JO MA QA SA), Different variations of spanish
locales.
Added new 3 components locales for mn_Cyrl_MN, sr_Cyrl_RS sr_Latn_RS,
zh_Hans_CN, zh_Hant_HK and zh_Hant_TW. Some aliases has been for 2 components
version when possible.

Thanks: Garrett D'Amore (Illumos) who made sure all his work was done under
BSD license!, Edwin Groothuis (edwin@) for the work he made on tools to be able
to generate locales definition usable in freebsd sources out of vanilla CLDR
definitions, John Marino (DragonflyBSD) who first merge the Illumos work into
Dragonfly and spent hours tracking down bugs.


290102 28-Oct-2015 bapt

Merge mpsutil(8) branch

mpsutil(8)/mprutil(8) are new utilities for managing LSI Fusion-MPT
2/3 controllers (mps(4) and mpr(4))

For now only informational commands have been implemented.

This utility has been written by scottl@ [1] and polished by myself[2]

Submitted by: scottl
Discussed with: scottl
Relnotes: yes
Sponsored by: Netflix [1]
Sponsored by: Gandi.net [2]


289746 22-Oct-2015 ngie

Exit with a user-friendly message instead of tripping an assert
if vm_activate_cpu(..) fails when called from fbsdrun_addcpu(..)

MFC after: 1 week
PR: 203884
Reviewed by: grehan
Submitted by: William Orr <will@worrbase.com>


289677 21-Oct-2015 eadler

Fix a ton of speelling errors

arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337


288943 06-Oct-2015 dim

Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.7.0
release.

Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11
support to build; see UPDATING for more information.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.7.0/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.7.0/tools/clang/docs/ReleaseNotes.html>

Thanks to Ed Maste, Andrew Turner and Antoine Brodin for their help.

Exp-run: antoine
Relnotes: yes


288826 05-Oct-2015 grehan

Clean up some harmless unimplemented-command warning messages.

- Don't advertize trusted-computing capability in the Identify page.
This prevents Windows from issuing a TRUSTED_RECEIVE_DMA command.
- Windows will send down SMART and SECURITY_FREEZE_LOCK
even though smart and security capabilities were not advertized.
Send back a silent abort.

Reviewed by: mav


288524 02-Oct-2015 grehan

Fix post-test typo that snuck in.


288522 02-Oct-2015 grehan

Simple sysctl-like firmware query interface. Similar in operation
to the qemu one, and uses the same i/o ports but with different
messaging. Requires the 'bootrom' option to be enabled.

This is used by UEFI (and potentially other BIOSs/firmware) to
request information from bhyve. Currently, only the number of
vCPUs is made available, with more to follow.

A very large thankyou to Ben Perrault who helped out testing
an earlier version of this, and bhyve/Windows in general.

Reviewed by: tychon
Discussed with: neel
Sponsored by: Nahanni Systems


288470 02-Oct-2015 grehan

- Increase the max number of indirect descriptors to match
the largest that the Windows virtio driver can send down

- Always advertize indirect descriptors. The Illumos virtio
driver won't attach unless this capability is seen.

Reviewed by: neel


287927 17-Sep-2015 delphij

Use strlcpy() instead of strncpy() because subsequent mkstemps expects
the string be nul-terminated.

Reviewed by: neel
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3685


286838 17-Aug-2015 grehan

Add simple (no-op) emulations for the CHECK_POWER_MODE,
READ_VERIFY and READ_VERIFY_EXT commands.

Reviewed by: mav


286622 11-Aug-2015 mav

Another small typo.

MFC after: 3 days


286621 11-Aug-2015 mav

Fix minor typo.

MFC after: 3 days


286409 07-Aug-2015 brueffer

Manpage cleanup.

- new sentence -> new line
- fix manpage references
- fix macro usage
- fix a typo

MFC after: 1 week


285217 06-Jul-2015 neel

Always assert DCD and DSR in bhyve's uart emulation.

The /etc/ttys entry for a serial console in FreeBSD/x86 is as follows:
ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure

The initial terminal type passed to getty(8) is "3wire" which sets the
CLOCAL flag. However reset(1) clears this flag and any programs that try
to open the terminal will hang waiting for DCD to be asserted.

Fix this by always asserting DCD and DSR in the emulated uart.

The following discussion on virtualization@ has more details:
https://lists.freebsd.org/pipermail/freebsd-virtualization/2015-June/003666.html

Reported by: jmg
Discussed with: grehan


285081 03-Jul-2015 sjg

Updated depends


284630 20-Jun-2015 jmg

add SO_REUSEADDR when starting debug port, lets you still bind when
a TIME_WAIT socket is still around...

Reviewed by: grehan
Review: https://reviews.freebsd.org/D2875


284539 18-Jun-2015 neel

Restructure memory allocation in bhyve to support "devmem".

devmem is used to represent MMIO devices like the boot ROM or a VESA framebuffer
where doing a trap-and-emulate for every access is impractical. devmem is a
hybrid of system memory (sysmem) and emulated device models.

devmem is mapped in the guest address space via nested page tables similar
to sysmem. However the address range where devmem is mapped may be changed
by the guest at runtime (e.g. by reprogramming a PCI BAR). Also devmem is
usually mapped RO or RW as compared to RWX mappings for sysmem.

Each devmem segment is named (e.g. "bootrom") and this name is used to
create a device node for the devmem segment (e.g. /dev/vmm/testvm.bootrom).
The device node supports mmap(2) and this decouples the host mapping of
devmem from its mapping in the guest address space (which can change).

Reviewed by: tychon
Discussed with: grehan
Differential Revision: https://reviews.freebsd.org/D2762
MFC after: 4 weeks


283657 28-May-2015 neel

Fix non-deterministic delays when accessing a vcpu that was in "running" or
"sleeping" state. This is done by forcing the vcpu to transition to "idle"
by returning to userspace with an exit code of VM_EXITCODE_REQIDLE.

MFC after: 2 weeks


283264 21-May-2015 tychon

The 'hostbridge' device exists to allow guests to infer msi/msix
capablity by advertising pcie capability.

Since the 'hostbridge' device isn't a true pci-to-pci bridge, and
doesn't actaully use the bridge configuration space layout, change
the header-type from type 1 to type 0 to avoid confusion.

Reviewed by: neel


283168 21-May-2015 grehan

Temporarily revert r282922 which bumped the max descriptors.

While there is no issued with the number of descriptors in
a virtio indirect descriptor, it's a guest's choice as to
whether indirect descriptors are used. For the case where
they aren't, the virtio block ring size is still 64 which
is less than the now reported max_segs of 67. This results
in an assertion in recent Linux guests even though it was
benign since they were using indirect descs.

The intertwined relationship between virtio ring size,
max seg size and blockif queue size will be addressed
in an upcoming commit, at which point the max descriptors
will again be bumped up to 67.


282922 14-May-2015 grehan

Bump the size of the blockif scatter-gather list to 67.

The Windows virtio driver ignores the advertized seg_max
field and assumes the host can accept up to 67 segments
in indirect descriptors, triggering an assert in the bhyve
process.

No objection from: mav
Reviewed by: neel
Reported and tested by: Leon Dang (ldang@nahannisys.com)
MFC after: 2 weeks


282865 13-May-2015 grehan

Set the subvendor field in config space to the vendor ID.
This is required by the Windows virtio drivers to correctly
match a device.

Submitted by: Leon Dang (ldang@nahannisys.com)
MFC after: 2 weeks


282788 12-May-2015 neel

Allow configuration of the sector size advertised to the guest.

The default behavior is to infer the logical and physical sector sizes from
the block device backend. However older versions of Windows only work with
specific logical/physical combinations:
- Vista and Windows 7: 512/512
- Windows 7 SP1: 512/512 or 512/4096

For this reason allow the sector size to be specified using the following
block device option: sectorsize=logical[/physical]

Reported by: Leon Dang (ldang@nahannisys.com)
Reviewed by: grehan
MFC after: 2 weeks


282784 11-May-2015 grehan

Handling indirect descriptors is a capability of the host and
not one that needs to be negotiated. Use the host capabilities
field and not the negotiated field when verifying that indirect
descriptors are supported.

Found with the Redhat Windows viostor driver, which clears
the indirect capability in the negotiated caps and then starts
using them.

Reported and tested by: Leon Dang (ldang@nahannisys.com)
MFC after: 2 weeks


282595 07-May-2015 neel

Allow byte reads of AHCI registers.

This is needed to support Windows guests that use byte reads to access certain
AHCI registers (e.g. PxTFD.Status and PxTFD.Error).

Reviewed by: grehan, mav
Reported by: Leon Dang (ldang@nahannisys.com)
Differential Revision: https://reviews.freebsd.org/D2469
MFC after: 2 weeks


282563 06-May-2015 mav

Add memory barrier to r281764.

While race at this point may cause only a single packet delay and so was
not really reproduced, it is better to not have it at all.

MFC after: 1 week


282558 06-May-2015 neel

Deprecate the 3-way return values from vm_gla2gpa() and vm_copy_setup().

Prior to this change both functions returned 0 for success, -1 for failure
and +1 to indicate that an exception was injected into the guest.

The numerical value of ERESTART also happens to be -1 so when these functions
returned -1 it had to be translated to a positive errno value to prevent the
VM_RUN ioctl from being inadvertently restarted. This made it easy to introduce
bugs when writing emulation code.

Fix this by adding an 'int *guest_fault' parameter and setting it to '1' if
an exception was delivered to the guest. The return value is 0 or EFAULT so
no additional translation is needed.

Reviewed by: tychon
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D2428


282524 06-May-2015 mav

Reimplement queue freeze on error, added in r282429:

It is not required to use CLO to recover from task file error, it should
be enough to do only stop/start, that does not clear the PxTFD.STS.ERR.

MFC after: 13 days


282429 04-May-2015 mav

Implement in-order execution of non-NCQ commands.

Using status updates in r282364, block queue on BSY, DRQ or ERR bits set.
This can be a performance penalization for non-NCQ commands, but it is
required for proper error recovery and standard compliance.

MFC after: 2 weeks


282364 03-May-2015 mav

Implement basic PxTFD.STS.BSY reporting.

MFC after: 2 weeks


282345 02-May-2015 mav

Initialize PxCMD on reset and make its read-only bits such.

MFC after: 2 weeks


282344 02-May-2015 mav

Handle ATA_SEND_FPDMA_QUEUED as NCQ in ahci_port_stop().

MFC after: 1 week


282335 02-May-2015 neel

Advertise an additional memory BAR in the "dummy" device emulation.

This is useful for testing the MOVS emulation when both the source and
destination addresses are in the MMIO space.

MFC after: 1 week


282206 28-Apr-2015 neel

Implement the century byte in the RTC. Some guests require this field to be
properly set.

Reported by: Leon Dang (ldang@nahannisys.com)
MFC after: 2 weeks


281946 24-Apr-2015 neel

Don't allow guest to modify readonly bits in the PCI config 'status' register.

Reported by: Leon Dang (ldang@nahannisys.com)
MFC after: 2 weeks


281887 23-Apr-2015 jhb

Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.

Approved by: Hudson River Trading LLC (who owns ACT LLC)
MFC after: 1 week


281782 20-Apr-2015 mav

Don't set bits that should be zero for SATA devices.

Old value made Linux think that it is PATA device with SATA bridge.

MFC after: 2 weeks


281767 20-Apr-2015 mav

Report link as up if tap device is not specified (black hole).

MFC after: 2 weeks


281766 20-Apr-2015 mav

Report link as up only if we managed to open tap device.

It would be cool to report tap device status, but it has no such API.

MFC after: 2 weeks


281764 20-Apr-2015 mav

Disable RX/TX queues notifications when not needed.

This reduces CPU load and doubles iperf throughput, reaching 2-3Gbit/s.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.


281700 18-Apr-2015 mav

Workaround bhyve virtual disks operation on top of GEOM providers.

GEOM does not support scatter/gather lists in its I/Os. Such requests
are cut in pieces by physio(), that may be problematic, if those pieces
are not multiple of provider's sector size. If such case is detected,
move the data through temporary sequential buffer.

MFC after: 2 weeks


281666 17-Apr-2015 mav

Make virtual AHCI more careful with I/O lengths.

MFC after: 2 weeks


281611 16-Apr-2015 neel

If the number of guest vcpus is less than '1' then flag it as an error.

MFC after: 1 week


281561 15-Apr-2015 tychon

Prior to aborting due to an ioport error, it is always interesting to
see what the guest's %rip is.

Reviewed by: grehan


281338 09-Apr-2015 bapt

Fix overlinking in bhyve:

libvmmapi is actually needed to be linked to libutil, not bhyve nor bhyveload


280968 01-Apr-2015 tychon

Prior to aborting due to an instruction emulation error, it is always
interesting to see what the guest's %rip and instruction bytes are.

Reviewed by: grehan


280725 27-Mar-2015 grehan

Move legacy interrupt allocation for virtio devices to common code.
There are a number of assumptions about legacy interrupts always
being available in virtio so don't allow back-ends to make the
decision to support them.

This fixes the issue seen with virtio-rnd on OpenBSD. MSI-x vectors
were not being used, and the virtio-rnd backend wasn't allocating a
legacy interrupt resulting in a bhyve assert and guest exit.

Reported by: Julian Hsiao, madoka at nyanisore dot net
Reviewed by: neel
MFC after: 1 week


280293 20-Mar-2015 mav

Add missing variable initialization.

Reported by: Coverity
CID: 1288938
MFC after: 3 days


280154 16-Mar-2015 mav

Report that we may have write cache, and that we do support FLUSH.

FreeBSD guest driver does not use that legacy flag, but Linux seems does.

MFC after: 2 weeks


280133 16-Mar-2015 mav

Increase S/G list size of 32 to 33 entries.

32 entries are not enough for the worst case of misaligned 128KB request,
that made FreeBSD to chunk large quests in odd pieces.

MFC after: 2 weeks


280126 15-Mar-2015 mav

Pre-allocate one extra request per processing thread.

Processing threads call callbacks before freeing requests. As result,
new requests may arrive before old ones are freed.

MFC after: 2 weeks


280044 15-Mar-2015 mav

According to Linux and QEMU, s/n equal to buffer is not zero-terminated.

This makes same s/n reported for both virtio and AHCI drivers.

MFC after: 2 weeks


280042 15-Mar-2015 mav

Close potential race on blockif_close().

Reported by: vangyzen
MFC after: 2 weeks


280041 15-Mar-2015 mav

Fix networking problem after r280026.

I've missed that network driver sometimes returns taken request back to
available queue without processing. Add new helper function for that case.

Reported by: flo
MFC after: 2 weeks


280040 15-Mar-2015 mav

Give AHCI disk serial based on backing file path same as for virtio block.

It is still not good that they may intersect on different hosts, but that
is better then intersecting on the same host.

MFC after: 2 weeks


280037 15-Mar-2015 mav

Rewrite virtio block device driver to work asynchronously and use the block
I/O interface.

Asynchronous operation, based on r280026 change, allows to not block virtual
CPU during I/O processing, that on slow/busy storage can take seconds.
Use of recently improved block I/O interface allows to process multiple
requests same time, that improves random I/O performance on wide storages.

Benchmarks of virtual disk, backed by ZVOL on RAID10 pool of 4 HDDs, show
~3.5 times random read performance improvements, while no degradation on
linear I/O. Guest CPU usage during test dropped from 100% to almost zero.

MFC after: 2 weeks


280031 15-Mar-2015 dim

Upgrade our copy of clang, llvm and lldb to 3.6.0 release.

Please note that from 3.5.0 onwards, clang/llvm/lldb require C++11
support to build; see UPDATING for more information.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.6.0/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.6.0/tools/clang/docs/ReleaseNotes.html>

Thanks to Ed Maste for the lldb part of this upgrade.

Exp-run: antoine


280026 15-Mar-2015 mav

Modify virtqueue helpers added in r253440 to allow queuing.

Original virtqueue design allows queued and out-of-order processing, but
helpers added in r253440 suppose only direct blocking in-order one.
It could be fine for network, etc., but it is a huge limitation for storage
devices.


280017 15-Mar-2015 mav

Block delete capability for read-only devices.

Submitted by: neel
MFC after: 2 weeks


280004 14-Mar-2015 mav

Give block I/O interface multiple (8) execution threads.

On parallel random I/O this allows better utilize wide storage pools.
To not confuse prefetcher on linear I/O, consecutive requests are executed
sequentially, following the same logic as was earlier implemented in CTL.

Benchmarks of virtual AHCI disk, backed by ZVOL on RAID10 pool of 4 HDDs,
show ~3.5 times random read performance improvements, while no degradation
on linear I/O.

MFC after: 2 weeks


279987 14-Mar-2015 mav

Add checksums to identify data and NCQ command error log.

MFC after: 2 weeks


279979 14-Mar-2015 mav

Slightly polish virtual AHCI CD reporting.

MFC after: 2 weeks


279977 14-Mar-2015 mav

Fix NOP and IDLE commands for virtual AHCI disks.

MFC after: 2 weeks


279976 14-Mar-2015 mav

Add support for NCQ variant of DSM TRIM for virtual AHCI disks.

The code is not really tested yet due to lack of initiator support.

Requested by: imp
MFC after: 2 weeks


279975 14-Mar-2015 mav

Improve NCQ errors reporting for virtual AHCI disks.

While this implementation is still not perfect, previous was just broken.

MFC after: 2 weeks


279968 13-Mar-2015 mav

Remove incorrect SERR register setting.

At this point we have nothing to report through that register.

MFC after: 2 weeks


279967 13-Mar-2015 mav

Change prdbc value reporting.

MFC after: 2 weeks


279965 13-Mar-2015 mav

Polish AHCI disk identify data and fix speed negotiation.

MFC after: 2 weeks


279960 13-Mar-2015 mav

Add support for PIO variants of READ/WRITE commands for AHCI disks.

AHCI API hides all PIO specifics, so this functionality is almost free.

MFC after: 2 weeks


279959 13-Mar-2015 mav

Use ahci_write_fis_d2h() for commands completion.

MFC after: 2 weeks


279957 13-Mar-2015 mav

Add DSM TRIM command support for virtual AHCI disks.

It works only for virtual disks backed by ZVOLs and raw devices supporting
BIO_DELETE. Virtual disks backed by files won't report this capability.

MFC after: 2 weeks
Relnotes: yes


279675 05-Mar-2015 mav

Add variable initialization missed by me and clang.

Reported by: grehan
MFC after: 2 weeks


279673 05-Mar-2015 mav

Fix error translation broken in r279658.

Reported by: grehan
MFC after: 2 weeks


279658 05-Mar-2015 mav

Implement cache flush for ahci-hd and for virtio-blk over device.

MFC after: 2 weeks


279657 05-Mar-2015 mav

Add check for absent stripe size to r279652.

MFC after: 2 weeks


279654 05-Mar-2015 mav

Report logical/physical sector sizes for virtual SATA disk.

MFC after: 2 weeks


279652 05-Mar-2015 mav

Add support for TOPOLOGY feature of virtio block device.

Passing through physical block size/offset from underlying storage allows
guest to manage proper data and I/O alignment to improve performance.

MFC after: 2 weeks


279227 24-Feb-2015 neel

Emulate MSR 0xC0011024 when running on AMD processors.

OpenBSD guests test bit 0 of this MSR to detect whether the workaround for
erratum 721 has been applied.

Reported by: Jason Tubnor (jason@tubnor.net)
MFC after: 1 week


279225 24-Feb-2015 neel

Add "-u" option to bhyve(8) to indicate that the RTC should maintain UTC time.

The default remains localtime for compatibility with the original device model
in bhyve(8). This is required for OpenBSD guests which assume that the RTC
keeps UTC time.

Reviewed by: grehan
Pointed out by: Jason Tubnor (jason@tubnor.net)
MFC after: 2 weeks


279220 23-Feb-2015 grehan

Don't close a block context if it couldn't be opened,
for example if the backing file doesn't exist,
avoiding a null deref.

Reviewed by: neel
MFC after: 1 week.


277310 18-Jan-2015 neel

Simplify instruction restart logic in bhyve.

Keep track of the next instruction to be executed by the vcpu as 'nextrip'.
As a result the VM_RUN ioctl no longer takes the %rip where a vcpu should
start execution.

Also, instruction restart happens implicitly via 'vm_inject_exception()' or
explicitly via 'vm_restart_instruction()'. The APIs behave identically in
both kernel and userspace contexts. The main beneficiary is the instruction
emulation code that executes in both contexts.

bhyve(8) VM exit handlers now treat 'vmexit->rip' and 'vmexit->inst_length'
as readonly:
- Restarting an instruction is now done by calling 'vm_restart_instruction()'
as opposed to setting 'vmexit->inst_length' to 0 (e.g. emulate_inout())
- Resuming vcpu at an arbitrary %rip is now done by setting VM_REG_GUEST_RIP
as opposed to changing 'vmexit->rip' (e.g. vmexit_task_switch())

Differential Revision: https://reviews.freebsd.org/D1526
Reviewed by: grehan
MFC after: 2 weeks


276479 31-Dec-2014 dim

Upgrade our copy of clang, llvm and lldb to 3.5.0 release.

Please note that this version now requires C++11 support to build; see
UPDATING for more information.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.5.0/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.5.0/tools/clang/docs/ReleaseNotes.html>

Thanks to Ed Maste, Roman Divacky, Andrew Turner, Justin Hibbits and
Antoine Brodin for their invaluable help with this import.

Approved by: portmgr (antoine)
MFC after: 1 month


276428 30-Dec-2014 neel

Replace bhyve's minimal RTC emulation with a fully featured one in vmm.ko.

The new RTC emulation supports all interrupt modes: periodic, update ended
and alarm. It is also capable of maintaining the date/time and NVRAM contents
across virtual machine reset. Also, the date/time fields can now be modified
by the guest.

Since bhyve now emulates both the PIT and the RTC there is no need for
"Legacy Replacement Routing" in the HPET so get rid of it.

The RTC device state can be inspected via bhyvectl as follows:
bhyvectl --vm=vm --get-rtc-time
bhyvectl --vm=vm --set-rtc-time=<unix_time_secs>
bhyvectl --vm=vm --rtc-nvram-offset=<offset> --get-rtc-nvram
bhyvectl --vm=vm --rtc-nvram-offset=<offset> --set-rtc-nvram=<value>

Reviewed by: tychon
Discussed with: grehan
Differential Revision: https://reviews.freebsd.org/D1385
MFC after: 2 weeks


275054 25-Nov-2014 bapt

Convert usr.sbin to LIBADD
Reduce overlinking


274720 19-Nov-2014 trasz

Fix improper .Fx macro usage.

Differential Revision: https://reviews.freebsd.org/D1158
Reviewed by: wblock@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation


274330 09-Nov-2014 tychon

To allow a request to be submitted from within the callback routine of
a completing one increase the total by 1 but don't advertise it.

Reviewed by: grehan


274076 04-Nov-2014 tychon

Improve the ability to cancel an in-flight request by using an
interrupt, via SIGCONT, to force the read or write system call to
return prematurely.

Reviewed by: grehan


274045 03-Nov-2014 tychon

If the start bit, PxCMD.ST, is cleared and nothing is in-flight then
PxCI, PxSACT, PxCMD.CCS and PxCMD.CR should be 0.

Reviewed by: grehan


273710 26-Oct-2014 neel

Add a comment explaining the intent behind the I/O reservation [0x72-0x77].


273683 26-Oct-2014 neel

Move the ACPI PM timer emulation into vmm.ko.

This reduces variability during timer calibration by keeping the emulation
"close" to the guest. Additionally having all timer emulations in the kernel
will ease the transition to a per-VM clock source (as opposed to using the
host's uptime keep track of time).

Discussed with: grehan


273375 21-Oct-2014 neel

Merge projects/bhyve_svm into HEAD.

After this change bhyve supports AMD processors with the SVM/AMD-V hardware
extensions.

More details available here:
https://lists.freebsd.org/pipermail/freebsd-virtualization/2014-October/002905.html

Submitted by: Anish Gupta (akgupt3@gmail.com)
Tested by: Benjamin Perrault (ben.perrault@gmail.com)
Tested by: Willem Jan Withagen (wjw@digiware.nl)


273212 17-Oct-2014 tychon

Support stopping and restarting the AHCI command list via toggling
PxCMD.ST from '1' to '0' and back. This allows the driver a chance to
recover if for instance a timeout occurred due to activity on the
host.

Reviewed by: grehan


272839 09-Oct-2014 neel

Support Intel-specific MSRs that are accessed when booting up a linux in bhyve:
- MSR_PLATFORM_INFO
- MSR_TURBO_RATIO_LIMITx
- MSR_RAPL_POWER_UNIT

Reviewed by: grehan
MFC after: 1 week


272838 09-Oct-2014 neel

iasl(8) expects integer fields in data tables to be specified as hexadecimal
values. Therefore the bit width of the "PM Timer Block" was actually being
interpreted as 50-bits instead of the expected 32-bit.

This eliminates an error message emitted by a Linux 3.17 guest during boot:
"Invalid length for FADT/PmTimerBlock: 50, using default 32"

Reviewed by: grehan
MFC after: 1 week


272710 07-Oct-2014 neel

Implement the FLUSH operation in the virtio-block emulation.

This gets rid of the following error message during FreeBSD guest bootup:
"vtbd0: hard error cmd=flush fsbn 0"

Reported by: rodrigc
Reviewed by: grehan


272481 03-Oct-2014 grehan

Add new fields in the FADT, required by IASL 20140926-64.

The new IASL from the recent acpi-ca import will error out
if it doesn't see these new fields, which were previously
reserved.

Reported by: lme
Reviewed by: neel


272007 23-Sep-2014 grehan

Correct display of bhyve SMBIOS UUIDs with dmidecode by bumping the version.

The mixed little/big-endianness of SMBIOS UUIDs was clarified in v2.6
of the SMBIOS spec. dmidecode uses the reported version of SMBIOS to
determine the layout and what to byte-swap.

bhyve's SMBIOS reported as 2.4 though it implemented the 2.6-style of
memory layout. This resulted in dmidecode reporting a different
UUID than one passed in via the -U option.

Fix by exporting a version of 2.6.

Reviewed by: tychon
Reported by: julian
MFC after: 1 day


271888 20-Sep-2014 neel

Restructure the MSR handling so it is entirely handled by processor-specific
code. There are only a handful of MSRs common between the two so there isn't
too much duplicate functionality.

The VT-x code has the following types of MSRs:

- MSRs that are unconditionally saved/restored on every guest/host context
switch (e.g., MSR_GSBASE).

- MSRs that are restored to guest values on entry to vmx_run() and saved
before returning. This is an optimization for MSRs that are not used in
host kernel context (e.g., MSR_KGSBASE).

- MSRs that are emulated and every access by the guest causes a trap into
the hypervisor (e.g., MSR_IA32_MISC_ENABLE).

Reviewed by: grehan


271711 17-Sep-2014 gjb

Update the bhyve(8) manual to reflect that it is no
longer considered 'experimental.'

Reviewed by: grehan
MFC after: 3 days
Sponsored by: The FreeBSD Foundation


271439 11-Sep-2014 neel

Initialize 'bc_rdonly' to the right value.

Note that independent of this change a readonly disk file would still be
opened O_RDONLY and protected from writes by the guest.

Reviewed by: grehan


271338 09-Sep-2014 grehan

Allow vtnet operation without merged rx buffers.

NetBSD's virtio-net implementation doesn't negotiate
the merged rx-buffers feature. To support this, check
to see if the feature was negotiated, and then adjust
the operation of the receive path accordingly by using
a larger iovec, and a smaller rx header.
In addition, ignore writes to the (read-only) status byte.

Tested with NetBSD/amd64 5.2.2, 6.1.4 and 7-beta.

Reviewed by: neel, tychon
Phabric: D745
MFC after: 3 days


271299 09-Sep-2014 grehan

Add a callback to be notified about negotiated features.

Submitted by: luigi
Obtained from: Vincenzo Maffione, Universita` di Pisa
MFC after: 3 days


270855 30-Aug-2014 neel

Set the 'inst_length' to '0' early on before any error conditions are detected
in the emulation of the task switch. If any exceptions are triggered then the
guest %rip should point to instruction that caused the task switch as opposed
to the one after it.


270326 22-Aug-2014 tychon

Fix a recursive lock acquisition in vi_reset_dev().

Reviewed by: grehan


269896 13-Aug-2014 neel

Minor cleanup:
- Set 'pirq_cold' to '0' on the first PIRQ allocation.
- Make assertions stronger.

Reviewed by: jhb
CR: https://phabric.freebsd.org/D592


269700 08-Aug-2014 neel

Support PCI extended config space in bhyve.

Add the ACPI MCFG table to advertise the extended config memory window.

Introduce a new flag MEM_F_IMMUTABLE for memory ranges that cannot be deleted
or moved in the guest's address space. The PCI extended config space is an
example of an immutable memory range.

Add emulation for the "movzw" instruction. This instruction is used by FreeBSD
to read a 16-bit extended config space register.

CR: https://phabric.freebsd.org/D505
Reviewed by: jhb, grehan
Requested by: tychon


269317 30-Jul-2014 tychon

Commands which encounter a fatal error shouldn't be marked as completed.
Furthermore, provide an indication of the current command so it can be
determined which one actually failed.

Reviewed by: grehan


269094 25-Jul-2014 neel

Simplify the meaning of return values from the inout handlers. After this
change 0 means success and non-zero means failure.

This also helps to eliminate VMEXIT_POWEROFF and VMEXIT_RESET as return values
from VM-exit handlers.

CR: D480
Reviewed by: grehan, jhb


269043 24-Jul-2014 neel

Reduce the proliferation of VMEXIT_RESTART in task_switch.c.

This is in preparation for further simplification of the return values from
VM exit handlers in bhyve(8).


269042 24-Jul-2014 neel

Fix fault injection in bhyve.

The faulting instruction needs to be restarted when the exception handler
is done handling the fault. bhyve now does this correctly by setting
'vmexit[vcpu].inst_length' to zero so the %rip is not advanced.

A minor complication is that the fault injection APIs are used by instruction
emulation code that is shared by vmm.ko and bhyve. Thus the argument that
refers to 'struct vm *' in kernel or 'struct vmctx *' in userspace needs to
be loosely typed as a 'void *'.


269008 23-Jul-2014 neel

Emulate instructions emitted by OpenBSD/i386 version 5.5:
- CMP REG, r/m
- MOV AX/EAX/RAX, moffset
- MOV moffset, AX/EAX/RAX
- PUSH r/m


268889 19-Jul-2014 neel

Handle nested exceptions in bhyve.

A nested exception condition arises when a second exception is triggered while
delivering the first exception. Most nested exceptions can be handled serially
but some are converted into a double fault. If an exception is generated during
delivery of a double fault then the virtual machine shuts down as a result of
a triple fault.

vm_exit_intinfo() is used to record that a VM-exit happened while an event was
being delivered through the IDT. If an exception is triggered while handling
the VM-exit it will be treated like a nested exception.

vm_entry_intinfo() is used by processor-specific code to get the event to be
injected into the guest on the next VM-entry. This function is responsible for
deciding the disposition of nested exceptions.


268777 16-Jul-2014 neel

Add emulation for legacy x86 task switching mechanism.

FreeBSD/i386 uses task switching to handle double fault exceptions and this
change enables that to work.

Reported by: glebius


268639 15-Jul-2014 grehan

Use the blockif CHS routine to create fake CHS values,
and then populate them in the identity page.

This fixes a divide-by-zero error at probe time with NetBSD.

MFC after: 1 week.


268638 15-Jul-2014 grehan

Add a call to synthesize a C/H/S value for block emulations
that require it (ahci). The algorithm used is from the VHD
specification.


268276 05-Jul-2014 grehan

Extend capabilities to 64-bits in preparation for some API changes.
The v1.0 virtio spec supports an extended size for guest/host
caps, but in practice 64-bits should last for a long time.


268202 03-Jul-2014 grehan

Use correct flag for event index.

Submitted by: luigi
Obtained from: Vincenzo Maffione, Universita` di Pisa
MFC after: 1 week


267966 27-Jun-2014 neel

Add post-mortem debugging for "EPT Misconfiguration" VM-exit. This error
is hard to reproduce so try to collect all the breadcrumbs when it happens.

Reviewed by: grehan


267959 27-Jun-2014 jhb

Sort command flags in usage output and the manpages.


267949 27-Jun-2014 grehan

Set the version and date to fixed fields rather than using
preprocessor macros that don't allow reproducible builds.
As a side-effect, the date string is now spec-compliant.

root@bhyve:~ # dmidecode
# dmidecode 2.12
SMBIOS 2.4 present.
12 structures occupying 514 bytes.
Table at 0x000F101F.

Handle 0x0001, DMI type 0, 24 bytes
BIOS Information
Vendor: BHYVE
Version: 1.0
Release Date: 03/14/2014

Submitted by: des (original version)
Reviewed by: tychon
MFC after: 1 week


267934 26-Jun-2014 jhb

- Document -b to enable the bvmcons console (but mark it as deprecated
similar to -g.)
- Document -U to set the SMBIOS UUID.
- Add missing options to the usage output and to the manpage Synopsis.
- Don't claim that bvmdebug is amd64-only (it is also a device, not an
option).


267811 24-Jun-2014 neel

Provide APIs to directly get 'lowmem' and 'highmem' size directly.

Previously the sizes were inferred indirectly based on the size of the mappings
at 0 and 4GB respectively. This works fine as long as size of the allocation is
identical to the size of the mapping in the guest's address space. However, if
the mapping is disjoint then this assumption falls apart (e.g., due to the
legacy BIOS hole between 640KB and 1MB).


267668 20-Jun-2014 bapt

use .Mt to mark up email addresses consistently (part2)

PR: 191174
Submitted by: Franco Fichtner <franco@lastsummer.de>


267611 18-Jun-2014 neel

Fix typo and rename macro KDB_SYS_FLAG to KBD_SYS_FLAG.

Reviewed by: tychon


267294 09-Jun-2014 tychon

r267169 should apply to 64-bit BARs as well.

Reviewed by: neel


267292 09-Jun-2014 joel

Remove blank lines.


267169 06-Jun-2014 tychon

Some devices (e.g. Intel AHCI and NICs) support quad-word access to
register pairs where two 32-bit registers make up a larger logical
size. Support those access by splitting the quad-word into two
double-words.

Reviewed by: grehan


266935 01-Jun-2014 neel

Use MIN(a,b) from <sys/param.h> instead of rolling our own version.

Pointed out by: grehan


266934 01-Jun-2014 neel

Limit the maximum number of back-to-back iterations of a "rep; ins/outs"
to 16. This is arbitrary and is used to ensure that a vcpu goes back into
the vm_run() loop to process interrupts or rendezvous events in a timely
fashion.

Found with: Coverity Scan
CID: 1216436


266933 31-May-2014 neel

Activate vcpus from bhyve(8) using the ioctl VM_ACTIVATE_CPU instead of doing
it implicitly in vmm.ko.

Add ioctl VM_GET_CPUS to get the current set of 'active' and 'suspended' cpus
and display them via /usr/sbin/bhyvectl using the "--get-active-cpus" and
"--get-suspended-cpus" options.

This is in preparation for being able to reset virtual machine state without
having to destroy and recreate it.


266724 27-May-2014 neel

Add segment protection and limits violation checks in vie_calculate_gla()
for 32-bit x86 guests.

Tested using ins/outs executed in a FreeBSD/i386 guest.


266708 26-May-2014 neel

Fix issue with restarting an "insb/insw/insl" instruction because of a page
fault on the destination buffer.

Prior to this change a page fault would be detected in vm_copyout(). This
was done after the I/O port access was done. If the I/O port access had
side-effects (e.g. reading the uart FIFO) then restarting the instruction
would result in incorrect behavior.

Fix this by validating the guest linear address before doing the I/O port
emulation. If the validation results in a page fault exception being injected
into the guest then the instruction can now be restarted without any
side-effects.


266641 25-May-2014 neel

Do the linear address calculation for the ins/outs emulation using a new
API function 'vie_calculate_gla()'.

While the current implementation is simplistic it forms the basis of doing
segmentation checks if the guest is in 32-bit protected mode.


266633 24-May-2014 neel

Add libvmmapi functions vm_copyin() and vm_copyout() to copy into and out
of the guest linear address space. These APIs in turn use a new ioctl
'VM_GLA2GPA' to convert the guest linear address to guest physical.

Use the new copyin/copyout APIs when emulating ins/outs instruction in
bhyve(8).


266627 24-May-2014 neel

Consolidate all the information needed by the guest page table walker into
'struct vm_guest_paging'.

Check for canonical addressing in vmm_gla2gpa() and inject a protection
fault into the guest if a violation is detected.

If the page table walk is restarted in vmm_gla2gpa() then reset 'ptpphys' to
point to the root of the page tables.


266595 23-May-2014 neel

Check for alignment check violation when processing in/out string instructions.


266573 23-May-2014 neel

Add emulation of the "outsb" instruction. NetBSD guests use this to write to
the UART FIFO.

The emulation is constrained in a number of ways: 64-bit only, doesn't check
for all exception conditions, limited to i/o ports emulated in userspace.

Some of these constraints will be relaxed in followup commits.

Requested by: grehan
Reviewed by: tychon (partially and a much earlier version)


266125 15-May-2014 jhb

Implement a PCI interrupt router to route PCI legacy INTx interrupts to
the legacy 8259A PICs.
- Implement an ICH-comptabile PCI interrupt router on the lpc device with
8 steerable pins configured via config space access to byte-wide
registers at 0x60-63 and 0x68-6b.
- For each configured PCI INTx interrupt, route it to both an I/O APIC
pin and a PCI interrupt router pin. When a PCI INTx interrupt is
asserted, ensure that both pins are asserted.
- Provide an initial routing of PCI interrupt router (PIRQ) pins to
8259A pins (ISA IRQs) and initialize the interrupt line config register
for the corresponding PCI function with the ISA IRQ as this matches
existing hardware.
- Add a global _PIC method for OSPM to select the desired interrupt routing
configuration.
- Update the _PRT methods for PCI bridges to provide both APIC and legacy
PRT tables and return the appropriate table based on the configured
routing configuration. Note that if the lpc device is not configured, no
routing information is provided.
- When the lpc device is enabled, provide ACPI PCI link devices corresponding
to each PIRQ pin.
- Add a VMM ioctl to adjust the trigger mode (edge vs level) for 8259A
pins via the ELCR.
- Mark the power management SCI as level triggered.
- Don't hardcode the number of elements in Packages in the source for
the DSDT. iasl(8) will fill in the actual number of elements, and
this makes it simpler to generate a Package with a variable number of
elements.

Reviewed by: tycho


265951 13-May-2014 neel

Don't include the guest memory segments in the bhyve(8) process core dump.
This has not added a lot of value when debugging bhyve issues while greatly
increasing the time and space required to store the core file.

Passing the "-C" option to bhyve(8) will change the default and dump guest
memory in the core dump.

Requested by: grehan
Reviewed by: grehan


265941 12-May-2014 neel

abort(3) the process in response to a VMEXIT_ABORT. This usually happens in
response to an unhandled VM exit or an unexpected error so a core is useful.

Remove unused macro VMEXIT_SWITCH.

Reviewed by: grehan


265407 06-May-2014 neel

Disable the 'uart_drain()' callback when the emulated receive FIFO is full.

Failing to do this will cause the kevent(2) notification to trigger
continuously and the bhyve(8) mevent thread will hog the cpu until the
characters on the backend tty device are drained.

Also, make the uart backend file descriptor non-blocking to avoid a
select(2) before every byte read from that backend.

Reviewed by: grehan


265376 05-May-2014 neel

Modify the "-p" option to be more flexible when associating a 'vcpu' with
a 'hostcpu'. The new format of the argument string is "vcpu:hostcpu".

This allows pinning a subset of the vcpus if desired.

It also allows pinning a vcpu to more than a single 'hostcpu'.

Submitted by: novel (initial version)


265366 05-May-2014 neel

Remove misleading "addcpu" in an error message emitted by fbsdrun_deletecpu().

Pointed out by: novel


265365 05-May-2014 neel

Re-adding an event to a kqueue modifies the parameters of the original event.
However, if the original knote had been disabled then it is not automatically
re-enabled.

Fix this by using EV_ADD to create an mevent and EV_ENABLE to enable it.

Adding a kevent for the first time implicitly enables it so existing callers
of mevent_add() don't need to change.

Reviewed by: grehan


265211 02-May-2014 neel

Don't allow MPtable generation if there are multiple PCI hierarchies. This is
because there isn't a standard way to relay this information to the guest OS.

Add a command line option "-Y" to bhyve(8) to inhibit MPtable generation.

If the virtual machine is using PCI devices on buses other than 0 then it can
still use ACPI tables to convey this information to the guest.

Discussed with: grehan@


265203 02-May-2014 neel

Add logic in the HLT exit handler to detect if the guest has put all vcpus
to sleep permanently by executing a HLT with interrupts disabled.

When this condition is detected the guest with be suspended with a reason of
VM_SUSPEND_HALT and the bhyve(8) process will exit.

Tested by executing "halt" inside a RHEL7-beta guest.

Discussed with: grehan@
Reviewed by: jhb@, tychon@


265114 30-Apr-2014 neel

Ignore writes to microcode update MSR. This MSR is accessed by RHEL7 guest.
Add KTR tracepoints to annotate wrmsr and rdmsr VM exits.


265101 29-Apr-2014 neel

Some Linux guests will implement a 'halt' by disabling the APIC and executing
the 'HLT' instruction. This condition was detected by 'vm_handle_hlt()' and
converted into the SPINDOWN_CPU exitcode . The bhyve(8) process would exit
the vcpu thread in response to a SPINDOWN_CPU and when the last vcpu was
spun down it would reset the virtual machine via vm_suspend(VM_SUSPEND_RESET).

This functionality was broken in r263780 in a way that made it impossible
to kill the bhyve(8) process because it would loop forever in
vm_handle_suspend().

Unbreak this by removing the code to spindown vcpus. Thus a 'halt' from
a Linux guest will appear to be hung but this is consistent with the
behavior on bare metal. The guest can be rebooted by using the bhyvectl
options '--force-reset' or '--force-poweroff'.

Reviewed by: grehan@


265062 28-Apr-2014 neel

Allow a virtual machine to be forcibly reset or powered off. This is done
by adding an argument to the VM_SUSPEND ioctl that specifies how the virtual
machine should be suspended, viz. VM_SUSPEND_RESET or VM_SUSPEND_POWEROFF.

The disposition of VM_SUSPEND is also made available to the exit handler
via the 'u.suspended' member of 'struct vm_exit'.

This capability is exposed via the '--force-reset' and '--force-poweroff'
arguments to /usr/sbin/bhyvectl.

Discussed with: grehan@


265058 28-Apr-2014 grehan

Implement legacy interrupts for the AHCI device emulation
according to the method outlined in the AHCI spec.

Tested with FreeBSD 9/10/11 with MSI disabled,
and also NetBSD/amd64 (lightly).

Reviewed by: neel, tychon
MFC after: 3 weeks


264921 25-Apr-2014 grehan

Respect and track the enable bit in the PCI configuration address word.
Ignore writes, and return 0xff's, on config accesses when not set.
Behaviour now matches that seen on h/w.

Found with a NetBSD/amd64 guest.

Reviewed by: tychon
MFC after: 3 weeks


264916 25-Apr-2014 tychon

Provide a very basic stub for the 8042 PS/2 keyboard controller.

Reviewed by: jhb
Approved by: neel (co-mentor)


264770 22-Apr-2014 delphij

Use calloc() in favor of malloc + memset.

Reviewed by: neel


264768 22-Apr-2014 tychon

Factor out common ioport handler code for better hygiene -- pointed
out by neel@.

Approved by: neel (co-mentor)


264650 18-Apr-2014 tychon

Fix ACPI DSDT indentation cosmetic breakage introduced in r264631 --
pointed out by jhb@.

Approved by: grehan (co-mentor)


264648 18-Apr-2014 tychon

Respect the destination operand size of the 'Input from Port' instruction.

Approved by: grehan (co-mentor)


264631 18-Apr-2014 tychon

Add support for reading the PIT Counter 2 output signal via the NMI
Status and Control register at port 0x61.

Be more conservative about "catching up" callouts that were supposed
to fire in the past by skipping an interrupt if it was
scheduled too far in the past.

Restore the PIT ACPI DSDT entries and add an entry for NMISC too.

Approved by: neel (co-mentor)


264468 14-Apr-2014 tychon

Add support for emulating the slave PIC.

Reviewed by: grehan, jhb
Approved by: grehan (co-mentor)


264302 09-Apr-2014 tychon

Constrain the amount of data returned to what is actually available
not the size of the buffer.

Approved by: grehan (co-mentor)


264277 08-Apr-2014 jhb

Handle single-byte reads from the bvmcons port (0x220) by returning
0xff. Some guests may attempt to read from this port to identify
psuedo-PNP ISA devices. (The ie(4) driver in FreeBSD/i386 is one
example.)

Reviewed by: grehan


264055 02-Apr-2014 grehan

Add support for the virtio RNG entropy-source device.
Call through to /dev/random synchronously to fill
virtio buffers with RNG data.

Tested with FreeBSD-CURRENT and Ubuntu guests.

Submitted by: Leon Dang
Discussed with: markm
MFC after: 3 weeks
Sponsored by: Nahanni Systems


263780 26-Mar-2014 neel

Add an ioctl to suspend a virtual machine (VM_SUSPEND). The ioctl can be called
from any context i.e., it is not required to be called from a vcpu thread. The
ioctl simply sets a state variable 'vm->suspend' to '1' and returns.

The vcpus inspect 'vm->suspend' in the run loop and if it is set to '1' the
vcpu breaks out of the loop with a reason of 'VM_EXITCODE_SUSPENDED'. The
suspend handler waits until all 'vm->active_cpus' have transitioned to
'vm->suspended_cpus' before returning to userspace.

Discussed with: grehan


263744 25-Mar-2014 tychon

Move the atpit device model from userspace into vmm.ko for better
precision and lower latency.

Approved by: grehan (co-mentor)


263432 20-Mar-2014 neel

Use 'cpuset_t' to represent the vcpus active in a virtual machine.


263322 18-Mar-2014 tychon

Don't reissue in-flight commands.

Approved by: neel (co-mentor)


263238 16-Mar-2014 tychon

Though there currently isn't a way to insert new media into an ATAPI
drive, at least pretend to support Asynchronous Notification (AN) to
avoid a guest needlessly polling for it.

Approved by: grehan (co-mentor)


263236 16-Mar-2014 tychon

Support the bootloader's single 16-bit 'outw' access to the Divisor
Latch MSB and LSB registers.

Approved by: neel (co-mentor)


263035 11-Mar-2014 tychon

Replace the userspace atpic stub with a more functional vmm.ko model.

New ioctls VM_ISA_ASSERT_IRQ, VM_ISA_DEASSERT_IRQ and VM_ISA_PULSE_IRQ
can be used to manipulate the pic, and optionally the ioapic, pin state.

Reviewed by: jhb, neel
Approved by: neel (co-mentor)


262884 07-Mar-2014 grehan

Open the uart emulation's backing tty in non-blocking mode.
This fixes the issue of bhyve appearing to halt when using
nmdm ports for the console, until a connection is made to
the other end.

bhyveload already does this.

Reported by: Many.
MFC after: 3 weeks.


262744 04-Mar-2014 tychon

Add SMBIOS support.

A new option, -U, can be used to set the UUID in the System
Information (Type 1) structure. Manpage fix to follow.

Approved by: grehan (co-mentor)


262613 28-Feb-2014 dim

Merge the projects/clang-sparc64 branch back to head. This brings in
several updates from the llvm and clang trunks to make the sparc64
backend fully functional.

Apart from one patch to sys/sparc64/include/pcpu.h which is still under
discussion, this makes it possible to let clang fully build world and
kernel for sparc64.

Any assistance with testing this on actual sparc64 hardware is greatly
appreciated, as there will unavoidably be bugs left.

Many thanks go to Roman Divacky for his upstream work on getting the
sparc64 backend into shape.

MFC after: 1 month


262532 26-Feb-2014 neel

Document the "-a" and "-x" options to match the changes in r262236.

Reviewed by: grehan


262506 26-Feb-2014 neel

Queue pending exceptions in the 'struct vcpu' instead of directly updating the
processor-specific VMCS or VMCB. The pending exception will be delivered right
before entering the guest.

The order of event injection into the guest is:
- hardware exception
- NMI
- maskable interrupt

In the Intel VT-x case, a pending NMI or interrupt will enable the interrupt
window-exiting and inject it as soon as possible after the hardware exception
is injected. Also since interrupts are inherently asynchronous, injecting
them after the hardware exception should not affect correctness from the
guest perspective.

Rename the unused ioctl VM_INJECT_EVENT to VM_INJECT_EXCEPTION and restrict
it to only deliver x86 hardware exceptions. This new ioctl is now used to
inject a protection fault when the guest accesses an unimplemented MSR.

Discussed with: grehan, jhb
Reviewed by: jhb


262311 21-Feb-2014 grehan

Fix virtio spec URL.

Submitted by: lwhsu
MFC after: 1 week


262274 21-Feb-2014 tychon

Avoid clobbering the counter mode when issuing a latch command.

Approved by: grehan (co-mentor)


262236 20-Feb-2014 neel

Simplify APIC mode switching from MMIO to x2APIC. In part this is done to
simplify the implementation of the x2APIC virtualization assist in VT-x.

Prior to this change the vlapic allowed the guest to change its mode from
xAPIC to x2APIC. We don't allow that any more and the vlapic mode is locked
when the virtual machine is created. This is not very constraining because
operating systems already have to deal with BIOS setting up the APIC in
x2APIC mode at boot.

Fix a bug in the CPUID emulation where the x2APIC capability was leaking
from the host to the guest.

Ignore MMIO reads and writes to the vlapic in x2APIC mode. Similarly, ignore
MSR accesses to the vlapic when it is in xAPIC mode.

The default configuration of the vlapic is xAPIC. The "-x" option to bhyve(8)
can be used to change the mode to x2APIC instead.

Discussed with: grehan@


262184 18-Feb-2014 neel

Add a check to validate that memory BARs of passthru devices are 4KB aligned.

Also, the MSI-x table offset is not required to be 4KB aligned so take this
into account when computing the pages occupied by the MSI-x tables.


262143 18-Feb-2014 jhb

Tweak the handling of PCI capabilities in emulated devices to remove
the non-standard zero capability list terminator. Instead, track
the start and end of the most recently added capability and use that
to adjust the previous capability's next pointer when a capability is
added and to determine the range of config registers belonging to
PCI capability registers.

Reviewed by: neel


261905 14-Feb-2014 neel

Update bhyve(8) man page to describe the usage of the "-s" option to assign
bus numbers to emulated devices. Also add the restriction that the LPC bridge
emulation can only be configured on bus 0.

Reviewed by: grehan@


261904 14-Feb-2014 neel

Allow PCI devices to be configured on all valid bus numbers from 0 to 255.

This is done by representing each bus as root PCI device in ACPI. The device
implements the _BBN method to return the PCI bus number to the guest OS.

Each PCI bus keeps track of the resources that is decodes for devices
configured on the bus: i/o, mmio (32-bit) and mmio (64-bit). These windows
are advertised to the guest via the _CRS object of the root device.

Bus 0 is treated specially since it consumes the I/O ports to access the
PCI config space [0xcf8-0xcff]. It also decodes the legacy I/O ports that
are consumed by devices on the LPC bus. For this reason the LPC bridge can
be configured only on bus 0.

The bus number can be specified using the following command line option
to bhyve(8): "-s <bus>:<slot>:<func>,<emul>[,<config>]"

Discussed with: grehan@
Reviewed by: jhb@


261785 12-Feb-2014 tychon

Provide an indication a "PIO Setup Device to Host FIS" occurred while executing
the IDENTIFY DEVICE and IDENTIFY PACKET DEVICE commands.

Also, provide an indication a "D2H Register FIS" occurred during a SET FEATURES
command.

Approved by: grehan (co-mentor)


261607 07-Feb-2014 jhb

Mark the I/O ports used by the bhyve console and debug devices as system
resources.

MFC after: 1 week


261268 29-Jan-2014 jhb

Enhance the support for PCI legacy INTx interrupts and enable them in
the virtio backends.
- Add a new ioctl to export the count of pins on the I/O APIC from vmm
to the hypervisor.
- Use pins on the I/O APIC >= 16 for PCI interrupts leaving 0-15 for
ISA interrupts.
- Populate the MP Table with I/O interrupt entries for any PCI INTx
interrupts.
- Create a _PRT table under the PCI root bridge in ACPI to route any
PCI INTx interrupts appropriately.
- Track which INTx interrupts are in use per-slot so that functions
that share a slot attempt to distribute their INTx interrupts across
the four available pins.
- Implicitly mask INTx interrupts if either MSI or MSI-X is enabled
and when the INTx DIS bit is set in a function's PCI command register.
Either assert or deassert the associated I/O APIC pin when the
state of one of those conditions changes.
- Add INTx support to the virtio backends.
- Always advertise the MSI capability in the virtio backends.

Submitted by: neel (7)
Reviewed by: neel
MFC after: 2 weeks


261217 27-Jan-2014 jhb

Remove support for legacy PCI devices. These haven't been needed since
support for LPC uart devices was added and it conflicts with upcoming
patches to add PCI INTx support.

Reviewed by: neel


261000 22-Jan-2014 tychon

Fix issue with stale fields from a recycled request pulled off the freelist.

Approved by: grehan (co-mentor)


260999 22-Jan-2014 tychon

Increase the block-layer backend maximum number of requests to match
the AHCI command queue depth. This allows a slew of commands issued
by a Linux guest to be absorbed without error.

Approved by: grehan (co-mentor)


260469 09-Jan-2014 grehan

Fix issue with the virtio descriptor region being truncated
if it was above 4GB. This was seen with CentOS 6.5 guests with
large RAM, since the block drivers are loaded late in the
boot sequence and end up allocating descriptor memory from
high addresses.

Reported by: Michael Dexter
MFC after: 3 days


260446 08-Jan-2014 remko

virtio-block does not exist, the correct name is virtio-blk.

PR: 185573
Submitted by: Allan Jude
Facilitated by: Snow B.V.
MFC after: 3 days


260239 03-Jan-2014 grehan

Cosmetic change - switch over to vertical SRCS to make it
easier to keep files in alpha order.

Reviewed by: neel


260206 02-Jan-2014 jhb

Rework the DSDT generation code a bit to generate more accurate info about
LPC devices. Among other things, the LPC serial ports now appear as
ACPI devices.
- Move the info for the top-level PCI bus into the PCI emulation code and
add ResourceProducer entries for the memory ranges decoded by the bus
for memory BARs.
- Add a framework to allow each PCI emulation driver to optionally write
an entry into the DSDT under the \_SB_.PCI0 namespace. The LPC driver
uses this to write a node for the LPC bus (\_SB_.PCI0.ISA).
- Add a linker set to allow any LPC devices to write entries into the
DSDT below the LPC node.
- Move the existing DSDT block for the RTC to the RTC driver.
- Add DSDT nodes for the AT PIC, the 8254 ISA timer, and the LPC UART
devices.
- Add a "SuperIO" device under the LPC node to claim "system resources"
aling with a linker set to allow various drivers to add IO or memory
ranges that should be claimed as a system resource.
- Add system resource entries for the extended RTC IO range, the registers
used for ACPI power management, the ELCR, PCI interrupt routing register,
and post data register.
- Add various helper routines for generating DSDT entries.

Reviewed by: neel (earlier version)


260167 01-Jan-2014 neel

Restructure the VMX code to enter and exit the guest. In large part this change
hides the setjmp/longjmp semantics of VM enter/exit. vmx_enter_guest() is used
to enter guest context and vmx_exit_guest() is used to transition back into
host context.

Fix a longstanding race where a vcpu interrupt notification might be ignored
if it happens after vmx_inject_interrupts() but before host interrupts are
disabled in vmx_resume/vmx_launch. We now called vmx_inject_interrupts() with
host interrupts disabled to prevent this.

Suggested by: grehan@


259998 28-Dec-2013 jhb

Extend the ACPI power management support to wire a virtual power button up
to SIGTERM when ACPI is enabled. Sending SIGTERM to the hypervisor when an
ACPI-aware OS is running will now trigger a soft-off allowing for a graceful
shutdown of the guest.
- Move constants for ACPI-related registers to acpi.h.
- Implement an SMI_CMD register with commands to enable and disable ACPI.
Currently the only change when ACPI is enabled is to enable the virtual
power button via SIGTERM.
- Implement a fixed-feature power button when ACPI is enabled by asserting
PWRBTN_STS in PM1_EVT when SIGTERM is received.
- Add support for EVFILT_SIGNAL events to mevent.
- Implement support for the ACPI system command interrupt (SCI) and assert
it when needed based on the values in PM1_EVT. Mark the SCI as active-low
and level triggered in the MADT and MP Table.
- Mark PCI interrupts in the MP Table as active-low in addition to level
triggered.

Reviewed by: neel


259997 28-Dec-2013 jhb

Use pthread_once() to replace a static integer initted flag.

Reviewed by: neel


259826 24-Dec-2013 jhb

Support soft power-off via the ACPI S5 state for bhyve guests.
- Implement the PM1_EVT and PM1_CTL registers required by ACPI.
The PM1_EVT register is mostly a dummy as bhyve doesn't support any
of the hardware-initiated events. The only bit of PM1_CNT that is
implemented are the sleep request bits (SPL_EN and SLP_TYP) which
request a graceful power off for S5. In particular, for S5, bhyve
exits with a non-zero value which terminates the loop in vmrun.sh.
- Emulate the Reset Control register at I/O port 0xcf9 and advertise
it as the reset register via ACPI.
- Advertise an _S5 package.
- Extend the in/out interface to allow an in/out handler to request
that the hypervisor trigger a reset or power-off.
- While here, note that all vCPUs in a guest support C1 ("hlt").

Reviewed by: neel (earlier version)


259779 23-Dec-2013 jhb

Extend the support for local interrupts on the local APIC:
- Add a generic routine to trigger an LVT interrupt that supports both
fixed and NMI delivery modes.
- Add an ioctl and bhyvectl command to trigger local interrupts inside a
guest. In particular, a global NMI similar to that raised by SERR# or
PERR# can be simulated by asserting LINT1 on all vCPUs.
- Extend the LVT table in the vCPU local APIC to support CMCI.
- Flesh out the local APIC error reporting a bit to cache errors and
report them via ESR when ESR is written to. Add support for asserting
the error LVT when an error occurs. Raise illegal vector errors when
attempting to signal an invalid vector for an interrupt or when sending
an IPI.
- Ignore writes to reserved bits in LVT entries.
- Export table entries the MADT and MP Table advertising the stock x86
config of LINT0 set to ExtInt and LINT1 wired to NMI.

Reviewed by: neel (earlier version)


259770 23-Dec-2013 joel

mdoc: nuke whitespace.


259737 22-Dec-2013 neel

Add a parameter to 'vcpu_set_state()' to enforce that the vcpu is in the IDLE
state before the requested state transition. This guarantees that there is
exactly one ioctl() operating on a vcpu at any point in time and prevents
unintended state transitions.

More details available here:
http://lists.freebsd.org/pipermail/freebsd-virtualization/2013-December/001825.html

Reviewed by: grehan
Reported by: Markiyan Kushnir (markiyan.kushnir at gmail.com)
MFC after: 3 days


259635 19-Dec-2013 neel

Add an option to ignore accesses by the guest to unimplemented MSRs.

Also, ignore a couple of SandyBridge uncore PMC MSRs that Centos 6.4 writes
to during boot.

Reviewed by: grehan


259537 18-Dec-2013 neel

Rename the ambiguously named 'vm_setup_msi()' and 'vm_setup_msix()' to
'vm_setup_pptdev_msi()' and 'vm_setup_pptdev_msix()' respectively.

It should now be clear that these functions operate on passthru devices.


259482 16-Dec-2013 neel

Add an API to deliver message signalled interrupts to vcpus. This allows
callers treat the MSI 'addr' and 'data' fields as opaque and also lets
bhyve implement multiple destination modes: physical, flat and clustered.

Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
Reviewed by: grehan@


259413 15-Dec-2013 joel

mdoc: sort SEE ALSO.


259302 13-Dec-2013 grehan

bhyve(8) man page.

mdoc formatting and much input and review from Warren Block (wblock@).

Reviewed by: many
MFC after: 3 days


259081 07-Dec-2013 neel

If a vcpu disables its local apic and then executes a 'HLT' then spin down the
vcpu and destroy its thread context. Also modify the 'HLT' processing to ignore
pending interrupts in the IRR if interrupts have been disabled by the guest.
The interrupt cannot be injected into the guest in any case so resuming it
is futile.

With this change "halt" from a Linux guest works correctly.

Reviewed by: grehan@
Tested by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)


259013 05-Dec-2013 jhb

Fix the processor table entry structure to use a fixed-width type for
32-bit fields so it is the correct size on amd64. Remove a workaround
for the broken structure from bhyve(8).

MFC after: 1 week


258699 27-Nov-2013 neel

Add support for level triggered interrupt pins on the vioapic. Prior to this
commit level triggered interrupts would work as long as the pin was not shared
among multiple interrupt sources.

The vlapic now keeps track of level triggered interrupts in the trigger mode
register and will forward the EOI for a level triggered interrupt to the
vioapic. The vioapic in turn uses the EOI to sample the level on the pin and
re-inject the vector if the pin is still asserted.

The vhpet is the first consumer of level triggered interrupts and advertises
that it can generate interrupts on pins 20 through 23 of the vioapic.

Discussed with: grehan@


258668 27-Nov-2013 grehan

Allow bhyve and bhyveload to attach to tty devices.

bhyveload: introduce the -c <device> parameter
to select a tty for output (or "stdio")

bhyve: allow the puc and lpc-com backends to
accept a tty in addition to "stdio"

When used in conjunction with the null-modem device,
nmdm(4), this allows attach/detach to the guest console
and multiple concurrent serial ports. kgdb on a serial
port is now functional.

Reviewed by: neel
Requested by: Almost everyone that has used bhyve
MFC after: 10.0


258614 26-Nov-2013 grehan

The Data Byte Count (DBC) field of a Physical Region Descriptor
Table is 22 bits, with the bit 31 being the interrupt-on-completion
bit.

OpenBSD and UEFI set this bit, resulting in large block i/o lengths
being sent to bhyve and coredumping the process. Fix by masking off
the relevant 22 bits when using the DBC field as a length.

Reviewed by: Zhixiang Yu
Discussed with: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)
MFC after: 10.0


258609 25-Nov-2013 neel

Fix discrepancy between the IOAPIC ID advertised by firmware tables and the
actual value read by the guest from the device. The IOAPIC ID is now set to
zero in both MPtable/ACPI tables as well as in the ioapic device emulation.

Pointed out by: grehan@


258579 25-Nov-2013 neel

Add HPET device emulation to bhyve.

bhyve supports a single timer block with 8 timers. The timers are all 32-bit
and capable of being operated in periodic mode. All timers support interrupt
delivery using MSI. Timers 0 and 1 also support legacy interrupt routing.

At the moment the timers are not connected to any ioapic pins but that will
be addressed in a subsequent commit.

This change is based on a patch from Tycho Nightingale (tycho.nightingale@pluribusnetworks.com).


258494 23-Nov-2013 neel

Add an ioctl to assert and deassert an ioapic pin atomically. This will be used
to inject edge triggered legacy interrupts into the guest.

Start using the new API in device models that use edge triggered interrupts:
viz. the 8254 timer and the LPC/uart device emulation.

Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)


258075 12-Nov-2013 neel

Move the ioapic device model from userspace into vmm.ko. This is needed for
upcoming in-kernel device emulations like the HPET.

The ioctls VM_IOAPIC_ASSERT_IRQ and VM_IOAPIC_DEASSERT_IRQ are used to
manipulate the ioapic pin state.

Discussed with: grehan@
Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)


257933 11-Nov-2013 neel

x86 platforms that use an IOAPIC route the legacy timer interrupt (IRQ0) to
pin 2 of the IOAPIC.

Add an 'Interrupt Source Override' entry to the MADT to describe this
and start asserting interrupts on pin 2 in the 8254 device model.

Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)


257767 06-Nov-2013 neel

Fix an off-by-one error when iterating over the emulated PCI BARs.

Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)


257729 06-Nov-2013 grehan

Add the VM name to the process name with setproctitle().
Remove the VM name from some of the thread-naming calls
since it is now in the proc title.
Slightly modify the thread-naming for the net and block
threads.

This improves readability when using top/ps with the -a
and -H options on a system with a large number of bhyve VMs.

Requested by: Michael Dexter
Reviewed by: neel
MFC after: 4 weeks


257423 31-Oct-2013 neel

Make the virtual ioapic available unconditionally in a bhyve virtual machine.

This is in preparation for moving the ioapic device model from userspace to
vmm.ko.

Reviewed by: grehan


257347 29-Oct-2013 neel

Update copyright to include the author of the LPC bridge emulation code.


257293 29-Oct-2013 neel

Add support for PCI-to-ISA LPC bridge emulation. If the LPC bus is attached
to a virtual machine then we implicitly create COM1 and COM2 ISA devices.

Prior to this change the only way of attaching a COM port to the virtual
machine was by presenting it as a PCI device that is mapped at the legacy
I/O address 0x3F8 or 0x2F8.

There were some issues with the original approach:
- It did not work at all with UEFI because UEFI will reprogram the PCI device
BARs and remap the COM1/COM2 ports at non-legacy addresses.
- OpenBSD GENERIC kernel does not create a /dev/console because it expects
the uart device at the legacy 0x3F8/0x2F8 address to be an ISA device.
- It was functional with a FreeBSD guest but caused the console to appear
on /dev/ttyu2 which was not intuitive.

The uart emulation is now independent of the bus on which it resides. Thus it
is possible to have uart devices on the PCI bus in addition to the legacy
COM1/COM2 devices behind the LPC bus.

The command line option to attach ISA COM1/COM2 ports to a virtual machine is
"-s <bus>,lpc -l com1,stdio".

The command line option to create a PCI-attached uart device is:
"-s <bus>,uart[,stdio]"

The command line option to create PCI-attached COM1/COM2 device is:
"-S <bus>,uart[,stdio]". This style of creating COM ports is deprecated.

Discussed with: grehan
Reviewed by: grehan
Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)

M share/examples/bhyve/vmrun.sh
AM usr.sbin/bhyve/legacy_irq.c
AM usr.sbin/bhyve/legacy_irq.h
M usr.sbin/bhyve/Makefile
AM usr.sbin/bhyve/uart_emul.c
M usr.sbin/bhyve/bhyverun.c
AM usr.sbin/bhyve/uart_emul.h
M usr.sbin/bhyve/pci_uart.c
M usr.sbin/bhyve/pci_emul.c
M usr.sbin/bhyve/inout.c
M usr.sbin/bhyve/pci_emul.h
M usr.sbin/bhyve/inout.h
AM usr.sbin/bhyve/pci_lpc.c
AM usr.sbin/bhyve/pci_lpc.h


257092 25-Oct-2013 grehan

Fix bug in the ioapic emulation for level-triggered interrupts,
where a pin assertion while a source was masked would result in
the interrupt being lost, with the symptom being a console hang.
The condition is now recorded, and the interrupt generated when
the source is unmasked.

Discovered by: OpenBSD 5.4 MP
Reviewed by: neel
MFC after: 3 days


257018 23-Oct-2013 neel

Tidy usage messages for bhyve and bhyveload.

Submitted by: jhb


257005 23-Oct-2013 grehan

Export the block size capability to guests.
- Use #defines for capability bits
- Export the VTBLK_F_BLK_SIZE capability
- Fix bug in calculating capacity: it is in
512-byte units, not the underlying sector size

This allows virtio-blk to have backing devices
with non 512-byte sector sizes e.g. /dev/cd0, and
4K-block harddrives.

Reviewed by: neel
MFC after: 3 days


256926 22-Oct-2013 grehan

Fix AHCI ATAPI emulation when backed with /dev/cd0

- remove assumption that the backing file/device had
512-byte sectors
- fix incorrect iovec size variable that would result
in a buffer overrun when an o/s issued an i/o request
with more s/g elements than the blockif api

Reviewed by: Zhixiang Yu (zxyu.core@gmail.com)
MFC after: 3 days


256711 17-Oct-2013 grehan

Changes required for OpenBSD/amd64:

- Allow a hostbridge to be created with AMD as a vendor.
This passes the OpenBSD check to allow the use of MSI
on a PCI bus.
- Enable the i/o interrupt section of the mptable, and
populate it with unity ISA mappings. This allows the
'legacy' IRQ mappings of the PCI serial port to be
set up. Delete unused print routine that was obscuring code.
- Use the '-W' option to enable virtio single-vector MSI
rather than an environment variable. Update the virtio
net/block drivers to query this flag when setting up
interrupts.: bhyverun.c
- Fix the arithmetic used to derive the century byte in
RTC CMOS, as well as encoding it in BCD.

Reviewed by: neel
MFC after: 3 days


256709 17-Oct-2013 grehan

Eliminate unconditional debug printfs.

Linux writes to these nominally read-only registers,
so avoid having bhyve write warning messages to stdout
when the reg writes can be safely ignored. Change the
WPRINTF to DPRINTF which is conditional.

Reviewed by: mav
Discussed with: mav, Zhixiang Yu
MFC after: 3 days


256645 16-Oct-2013 neel

Add a new capability, VM_CAP_ENABLE_INVPCID, that can be enabled to expose
'invpcid' instruction to the guest. Currently bhyve will try to enable this
capability unconditionally if it is available.

Consolidate code in bhyve to set the capabilities so it is no longer
duplicated in BSP and AP bringup.

Add a sysctl 'vm.pmap.invpcid_works' to display whether the 'invpcid'
instruction is available.

Reviewed by: grehan
MFC after: 3 days


256389 12-Oct-2013 grehan

Implement the virtio block 'get-ident' operation. This eliminates the
annoying verbose boot error of the form

g_handleattr: vtbd0 bio_length 24 len 28 -> EFAULT

The ident returned by bhyve is a text string 'BHYVE-XXXX-XXXX', where
the X's are the first bytes of the md5 hash of the backing filename.

Reviewed by: neel
Approved by: re (gjb)


256248 10-Oct-2013 grehan

Allow a 4-byte write to PCI config space to overlap
the 2 read-only bytes at the start of a PCI capability.
This is the sequence that OpenBSD uses when enabling
MSI interrupts, and works fine on real h/w.

In bhyve, convert the 4 byte write to a 2-byte write to
the r/w area past the first 2 r/o bytes of a capability.

Reviewed by: neel
Approved by: re@ (blanket)


256176 09-Oct-2013 neel

Parse the memory size parameter using expand_number() to allow specifying
the memory size more intuitively (e.g. 512M, 4G etc).

Submitted by: rodrigc
Reviewed by: grehan
Approved by: re (blanket)


256164 08-Oct-2013 dim

In usr.sbin/bhyve/pci_ahci.c, fix several gcc warnings of the form
"assignment makes pointer from integer without a cast", by changing the
cmd_lst and rbis members of struct ahci_port from integers to pointers.

Also surround a pow-of-2 test expression with parentheses to clarify it,
and avoid another gcc warning.

Approved by: re (glebius)
Reviewed by: grehan, mav


256158 08-Oct-2013 dim

After r256062, the static function fbsdrun_get_next_cpu() in
usr.sbin/bhyve/bhyverun.c is no longer used, so remove it to silence a
gcc warning.

Approved by: re (glebius)


256156 08-Oct-2013 neel

Change the behavior of bhyve such that the gdb listening port is opt-in
rather than opt-out.

Prior to this change if the "-g" option was not specified then a listening
socket for tunneling gdb packets would be opened at port 6466. If a second
virtual machine is fired up, also without the "-g" option, then that would
fail because there is already a listener on port 6466.

After this change if a gdb tunnel port needs to be created it needs to be
explicitly specified with a "-g <portnum>" command line option.

Reviewed by: grehan@
Approved by: re@ (blanket)


256072 05-Oct-2013 neel

Merge projects/bhyve_npt_pmap into head.

Make the amd64/pmap code aware of nested page table mappings used by bhyve
guests. This allows bhyve to associate each guest with its own vmspace and
deal with nested page faults in the context of that vmspace. This also
enables features like accessed/dirty bit tracking, swapping to disk and
transparent superpage promotions of guest memory.

Guest vmspace:
Each bhyve guest has a unique vmspace to represent the physical memory
allocated to the guest. Each memory segment allocated by the guest is
mapped into the guest's address space via the 'vmspace->vm_map' and is
backed by an object of type OBJT_DEFAULT.

pmap types:
The amd64/pmap now understands two types of pmaps: PT_X86 and PT_EPT.

The PT_X86 pmap type is used by the vmspace associated with the host kernel
as well as user processes executing on the host. The PT_EPT pmap is used by
the vmspace associated with a bhyve guest.

Page Table Entries:
The EPT page table entries as mostly similar in functionality to regular
page table entries although there are some differences in terms of what
bits are used to express that functionality. For e.g. the dirty bit is
represented by bit 9 in the nested PTE as opposed to bit 6 in the regular
x86 PTE. Therefore the bitmask representing the dirty bit is now computed
at runtime based on the type of the pmap. Thus PG_M that was previously a
macro now becomes a local variable that is initialized at runtime using
'pmap_modified_bit(pmap)'.

An additional wrinkle associated with EPT mappings is that older Intel
processors don't have hardware support for tracking accessed/dirty bits in
the PTE. This means that the amd64/pmap code needs to emulate these bits to
provide proper accounting to the VM subsystem. This is achieved by using
the following mapping for EPT entries that need emulation of A/D bits:
Bit Position Interpreted By
PG_V 52 software (accessed bit emulation handler)
PG_RW 53 software (dirty bit emulation handler)
PG_A 0 hardware (aka EPT_PG_RD)
PG_M 1 hardware (aka EPT_PG_WR)

The idea to use the mapping listed above for A/D bit emulation came from
Alan Cox (alc@).

The final difference with respect to x86 PTEs is that some EPT implementations
do not support superpage mappings. This is recorded in the 'pm_flags' field
of the pmap.

TLB invalidation:
The amd64/pmap code has a number of ways to do invalidation of mappings
that may be cached in the TLB: single page, multiple pages in a range or the
entire TLB. All of these funnel into a single EPT invalidation routine called
'pmap_invalidate_ept()'. This routine bumps up the EPT generation number and
sends an IPI to the host cpus that are executing the guest's vcpus. On a
subsequent entry into the guest it will detect that the EPT has changed and
invalidate the mappings from the TLB.

Guest memory access:
Since the guest memory is no longer wired we need to hold the host physical
page that backs the guest physical page before we can access it. The helper
functions 'vm_gpa_hold()/vm_gpa_release()' are available for this purpose.

PCI passthru:
Guest's with PCI passthru devices will wire the entire guest physical address
space. The MMIO BAR associated with the passthru device is backed by a
vm_object of type OBJT_SG. An IOMMU domain is created only for guest's that
have one or more PCI passthru devices attached to them.

Limitations:
There isn't a way to map a guest physical page without execute permissions.
This is because the amd64/pmap code interprets the guest physical mappings as
user mappings since they are numerically below VM_MAXUSER_ADDRESS. Since PG_U
shares the same bit position as EPT_PG_EXECUTE all guest mappings become
automatically executable.

Thanks to Alan Cox and Konstantin Belousov for their rigorous code reviews
as well as their support and encouragement.

Thanks for John Baldwin for reviewing the use of OBJT_SG as the backing
object for pci passthru mmio regions.

Special thanks to Peter Holm for testing the patch on short notice.

Approved by: re
Discussed with: grehan
Reviewed by: alc, kib
Tested by: pho


256062 04-Oct-2013 grehan

Remove obsolete cmd-line options and code associated with
these.
The mux-vcpus option may return at some point, given it's utility
in finding bhyve (and FreeBSD) bugs.

Approved by: re@ (blanket)
Discussed with: neel@


256057 04-Oct-2013 grehan

Hook up the AHCI and blockif code to the build.

Approved by: re@ (blanket)


256056 04-Oct-2013 grehan

Import Zhixiang Yu's GSoC'13 AHCI emulation:
https://wiki.freebsd.org/SummerOfCode2013/bhyveAHCI

This provides ICH8 SATA disk and ATAPI ports, selectable
via the bhyve slot command-line parameter:

SATA
-s <slot>,ahci-hd,<image-file>

ATAPI
-s <slot>,ahci-cd,<image-file>

Slight modifications by: grehan@
Approved by: re@ (blanket)
Obtained from: FreeBSD GSoC'13


256052 04-Oct-2013 grehan

Block-layer backend interface for bhyve block-io device emulations.

Approved by: re@ (blanket)


255890 26-Sep-2013 grehan

Fix incorrect assertion on the minimum side. ZFS would
trigger this.

Reported by: Chris Torek, Allan Jude
Approved by: re@ (blanket)


255691 19-Sep-2013 grehan

Implement support for the interrupt-on-terminal-count and
s/w-strobe timer modes. These are commonly used by non-FreeBSD
o/s's.

Approved by: re@ (blanket)


255690 19-Sep-2013 grehan

Add simplistic periodic timer support to mevent using kqueue's
timer support. This should be enough for the emulation of
h/w periodic timers (and no more) e.g. some of the 8254's
more esoteric modes that happen to be used by non-FreeBSD o/s's.

Approved by: re@ (blanket)


255689 19-Sep-2013 grehan

Allow the alarm hours/mins/seconds registers to be read/written,
though without any action. This avoids a hypervisor exit when
o/s's access these regs (Linux).

Reviewed by: neel
Approved by: re@ (blanket)


255688 19-Sep-2013 grehan

Use correct offset for the high byte of high memory written to
RTC NVRAM.

Submitted by: Bela Lubkin bela dot lubkin at tidalscale dot com
Approved by: re@ (blanket)


255647 17-Sep-2013 grehan

Pass the number of supported vectors to pci_emul_add_msicap() and
not the actual PCI BAR number.

Reviewed by: neel
Approved by: re@ (blanket)


255438 10-Sep-2013 grehan

Go way past 11 and bump bhyve's max vCPUs to 16.

This should be sufficient for 10.0 and will do
until forthcoming work to avoid limitations
in this area is complete.

Thanks to Bela Lubkin at tidalscale for the
headsup on the apic/cpu id/io apic ASL parameters
that are actually hex values and broke when
written as decimal when 11 vCPUs were configured.

Approved by: re@


255293 06-Sep-2013 grehan

Fix spelling.


255292 06-Sep-2013 grehan

Allow level-triggered interrupt sources. While this isn't
precisely emulated, it is good enough for the single consumer
i.e. irq4, the serial port on Linux.


254965 27-Aug-2013 neel

Allow single byte reads of the emulated MSI-X tables. This is not required
by the PCI specification but needed to dump MMIO space from "ddb" in the
guest.


254948 27-Aug-2013 grehan

Fix off-by-1 error in assert.

Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)


254395 16-Aug-2013 grehan

Fix ordering of legacy IRQ reservations.

Submitted by: Jeremiah Lott jlott at averesystems dot com


253452 18-Jul-2013 grehan

Sanity-check the vm exitcode, and exit the process if it's out-of-bounds
or there is no registered handler.

Submitted by: Bela Lubkin bela dot lubkin at tidalscale dot com


253440 17-Jul-2013 grehan

Major rework of the virtio code. Split out common parts, and modify
the net/block devices accordingly.

Submitted by: Chris Torek torek at torek dot net
Reviewed by: grehan


253181 11-Jul-2013 grehan

Implement RTC CMOS nvram. Init some fields that are used
by FreeBSD and UEFI.
Tested with nvram(4).

Reviewed by: neel


252682 04-Jul-2013 grehan

Support an optional "mac=" parameter to virtio-net config, to allow
users to set the MAC address for a device.

Clean up some obsolete code in pci_virtio_net.c

Allow an error return from a PCI device emulation's init routine
to be propagated all the way back to the top-level and result in
the process exiting.

Submitted by: Dinakar Medavaram dinnu sun at gmail (original version)


252494 02-Jul-2013 grehan

Fix up option parsing to allow a colon in the config section.
Clean up some other unnecessary code.

Submitted by: Dinakar Medavaram dinnu sun at gmail
Reviewed by: neel


252336 28-Jun-2013 grehan

Allow 8259 registers to be read. This is a transient condition
during Linux boot.

Submitted by: tycho nightingale at pluribusnetworks com
Reviewed by: neel


252331 28-Jun-2013 grehan

Allow the PCI config address register to be read. The Linux
kernel does this. Also remove an unused header file.

Submitted by: tycho nightingale at pluribusnetworks com
Reviewed by: neel


250197 03-May-2013 neel

Implement the NOTIFY_ON_EMPTY capability in the virtio-net device.

If this capability is negotiated by the guest then the device will
generate an interrupt when it runs out of available tx/rx descriptors.

Reviewed by: grehan
Obtained from: NetApp


250086 30-Apr-2013 neel

Reset some more softc state when the guest resets the virtio network device.

Obtained from: NetApp


250083 30-Apr-2013 neel

Use a separate mutex for the receive path instead of overloading the softc
mutex for this purpose.

Reviewed by: grehan


250009 28-Apr-2013 neel

Get rid of the 'vsc_rxpend' state - it doesn't serve any purpose because we
drop any frames that arrive while the device is starved for receive buffers.

This makes the receive path to only execute in context of the receive thread
and allows for further simplification.

Reviewed by: grehan


249917 26-Apr-2013 grehan

Use a thread for the processing of virtio tx descriptors rather
than blocking the vCPU thread. This improves bulk data performance
by ~30-40% and doesn't harm req/resp time for stock netperf runs.

Future work will use a thread pool rather than a thread per tx queue.

Submitted by: Dinakar Medavaram
Reviewed by: neel, grehan
Obtained from: NetApp


249916 26-Apr-2013 neel

Gripe if some <slot,function> tuple is specified more than once instead of
silently overwriting the previous assignment.

Gripe if the emulation is not recognized instead of silently ignoring the
emulated device.

If an error is detected by pci_parse_slot() then exit from the command line
parsing loop in main().

Submitted by (initial version): Chris Torek (chris.torek@gmail.com)


249813 23-Apr-2013 neel

Teach the virtio block device to deal with direct as well as indirect
descriptors. Prior to this change the device would only work with guests
that chose to use indirect descriptors.

Modify the device reset callback to actually reset the device state.

Submitted by: Tycho Nightingale (tycho.nightingale@pluribusnetworks.com)


249572 17-Apr-2013 neel

Setup accesses to the memory hole below 4GB to return all 1's on read and
consume all writes without any side effects.

Obtained from: NetApp


249343 10-Apr-2013 neel

Need to call init_mem() to really initialize the MMIO range lookups.

This was working by accident because:
- the RB_HEADs were being initialized to zero as part of BSS
- the pthread_rwlock functions were implicitly initializing the lock object

Obtained from: NetApp


249342 10-Apr-2013 neel

Remove obsolete comment about lack of locking for MMIO range lookup.

Pointed out by: Tycho Nightingale (tycho.nightingale@plurisbusnetworks.com)


249324 10-Apr-2013 neel

Unsynchronized TSCs on the host require special handling in bhyve:

- use clock_gettime(2) as the time base for the emulated ACPI timer instead
of directly using rdtsc().

- don't advertise the invariant TSC capability to the guest to discourage it
from using the TSC as its time base.

Discussed with: jhb@ (about making 'smp_tsc' a global)
Reported by: Dan Mack on freebsd-virtualization@
Obtained from: NetApp


249322 10-Apr-2013 neel

Change name of variable from 'rwlock' to more descriptive 'mmio_rwlock'

Requested by: grehan
Obtained from: NetApp


249321 10-Apr-2013 neel

Improve PCI BAR emulation:
- Respect the MEMEN and PORTEN bits in the command register
- Allow the guest to reprogram the address decoded by the BAR

Submitted by: Gopakumar T
Obtained from: NetApp


249175 05-Apr-2013 grehan

Remove dangling ISA uart stubs.

Obtained from: NetApp


249173 05-Apr-2013 grehan

config checksum is over the entire fixed portion, not just the
config header. FreeBSD doesn't check this but other o/s's do.

Obtained from: NetApp


248477 18-Mar-2013 neel

Simplify the assignment of memory to virtual machines by requiring a single
command line option "-m <memsize in MB>" to specify the memory size.

Prior to this change the user needed to explicitly specify the amount of
memory allocated below 4G (-m <lowmem>) and the amount above 4G (-M <highmem>).

The "-M" option is no longer supported by 'bhyveload' and 'bhyve'.

The start of the PCI hole is fixed at 3GB and cannot be directly changed
using command line options. However it is still possible to change this in
special circumstances via the 'vm_set_lowmem_limit()' API provided by
libvmmapi.

Submitted by: Dinakar Medavaram (initial version)
Reviewed by: grehan
Obtained from: NetApp


248368 16-Mar-2013 neel

Change the type of 'ndesc' from 'int' to 'uint16_t' so that descriptor index
wraparound is handled correctly.

The gory details are available here:
http://lists.freebsd.org/pipermail/freebsd-virtualization/2013-March/001119.html

This fixes a regression introduced in r247871.

Pointed out by: Bruce Evans, Chris Torek


248171 11-Mar-2013 neel

Convert the offset into the bar that contains the MSI-X table to an offset
into the MSI-X table before using it to calculate the table index.

In the common case where the MSI-X table is located at the begining of the
BAR these two offsets are identical and thus the code was working by accident.

This change will fix the case where the MSI-X table is located in the middle
or at the end of the BAR that contains it.

Obtained from: NetApp


247871 06-Mar-2013 grehan

Simplify virtio ring num-available calculation.

Submitted by: Chris Torek, torek at torek dot net


247865 06-Mar-2013 grehan

Reorder code to avoid the stat buffer being used uninitialized.

Obtained from: NetApp


247523 01-Mar-2013 neel

Specify the length of the mapping requested from 'paddr_guest2host()'.

This seems prudent to do in its own right but it also opens up the possibility
of not having to mmap the entire guest address space in the 'bhyve' process
context.

Discussed with: grehan
Obtained from: NetApp


247342 26-Feb-2013 neel

Ignore the BARRIER flag in the virtio block header.

This capability is not advertised by the host so ignore it even if the guest
insists on setting the flag.

Reviewed by: grehan
Obtained from: NetApp


247282 25-Feb-2013 neel

Get rid of unused struct member.

Pointed out by: Gopakumar T
Obtained from: NetApp


247144 22-Feb-2013 grehan

Add the ability to have a 'fallback' search for memory ranges.
These set of ranges will be looked at if a standard memory
range isn't found, and won't be installed in the cache.
Use this to implement the memory behaviour of the PCI hole on
x86 systems, where writes are ignored and reads always return -1.
This allows breakpoints to be set when issuing a 'boot -d', which
has the side effect of accessing the PCI hole when changing the
PTE protection on kernel code, since the pmap layer hasn't been
initialized (a bug, but present in existing FreeBSD releases so
has to be handled).

Reviewed by: neel
Obtained from: NetApp


246846 15-Feb-2013 neel

Advertise PCI-E capability in the hostbridge device presented to the guest.

FreeBSD wants to see this capability in at least one device in the PCI
hierarchy before it allows use of MSI or MSI-X.

Obtained from: NetApp


246686 11-Feb-2013 neel

Implement guest vcpu pinning using 'pthread_setaffinity_np(3)'.

Prior to this change pinning was implemented via an ioctl (VM_SET_PINNING)
that called 'sched_bind()' on behalf of the user thread.

The ULE implementation of 'sched_bind()' bumps up 'td_pinned' which in turn
runs afoul of the assertion '(td_pinned == 0)' in userret().

Using the cpuset affinity to implement pinning of the vcpu threads works with
both 4BSD and ULE schedulers and has the happy side-effect of getting rid
of a bunch of code in vmm.ko.

Discussed with: grehan


246367 05-Feb-2013 jhb

Install <dev/agp/agpreg.h> and <dev/pci/pcireg.h> as userland headers
in /usr/include.

MFC after: 2 weeks


246214 01-Feb-2013 neel

Add support for MSI-X interrupts in the virtio block device and make that
the default.

The current behavior of advertising a single MSI vector can be requested by
setting the environment variable "BHYVE_USE_MSI" to "yes". The use of MSI
is not compliant with the virtio specification and will be eventually phased
out.

Submitted by: Gopakumar T
Obtained from: NetApp


246191 01-Feb-2013 neel

Fix a broken assumption in the passthru implementation that the MSI-X table
can only be located at the beginning or the end of the BAR.

If the MSI-table is located in the middle of a BAR then we will split the
BAR into two and create two mappings - one before the table and one after
the table - leaving a hole in place of the table so accesses to it can be
trapped and emulated.

Obtained from: NetApp


246190 01-Feb-2013 neel

Fix a bug in the passthru implementation where it would assume that all
devices are MSI-X capable. This in turn would lead it to treat bar 0 as
the MSI-X table bar even if the underlying device did not support MSI-X.

Fix this by providing an API to query the MSI-X table index of the emulated
device. If the underlying device does not support MSI-X then this API will
return -1.

Obtained from: NetApp


246109 30-Jan-2013 neel

Add support for MSI-X interrupts in the virtio network device and make that
the default.

The current behavior of advertising a single MSI vector can be requested by
setting the environment variable "BHYVE_USE_MSI" to "true". The use of MSI
is not compliant with the virtio specification and will be eventually phased
out.

Submitted by: Gopakumar T
Obtained from: NetApp


245920 25-Jan-2013 grehan

Improve correctness of rtc register implementation.

Submitted by: tycho nightingale at pluribusnetworks com


245899 25-Jan-2013 neel

Use the correct type (uint64_t) to retrieve sysctl machdep.tsc_freq.

Simplify the function a bit by falling through after initialization and
return via the normal code path.

Reviewed by: grehan
Obtained from: NetApp


245749 21-Jan-2013 neel

Allocate the memory for the MSI-X table dynamically instead of allocating 32KB
statically. In most cases the number of table entries will be far less than
the maximum of 2048 allowed by the PCI specification.

Reuse macros from pcireg.h to interpret the MSI-X capability instead of rolling
our own.

Obtained from: NetApp


245740 21-Jan-2013 neel

Get rid of redundant 'table_size' field in struct pi_msix. If needed it can
always be calculated from the number of entries in the MSI-X table.

Obtained from: NetApp


245679 20-Jan-2013 neel

Use <vmname> in a consistent manner in usage messages output by 'bhyve',
'bhyveload' and 'bhyvectl'.

Pointed out by: joel@


245678 20-Jan-2013 neel

Add svn properties to the recently merged bhyve source files.

The pre-commit hook will not allow any commits without the svn:keywords
property in head.


245652 19-Jan-2013 neel

Merge projects/bhyve to head.

'bhyve' was developed by grehan@ and myself at NetApp (thanks!).

Special thanks to Peter Snyder, Joe Caradonna and Michael Dexter for their
support and encouragement.

Obtained from: NetApp


245127 07-Jan-2013 grehan

Don't completely drain the read file descriptor. Instead, only
fill up to the uart's rx fifo size, and leave any remaining input
for when the rx fifo is read. This allows cut'n'paste of long lines
to be done into the bhyve console without truncation.

Also, introduce a mutex since the file input will run in the mevent
thread context and may corrupt state accessed by a vCPU thread.

Reviewed by: neel
Approved by: NetApp


245123 07-Jan-2013 grehan

Use 64-bit arithmetic throughout, and lock accesses to globals.
With this change, dbench with >= 4 processes runs without getting
weird jumps forward in time when the APCI pmtimer is the default
timecounter.

Obtained from: NetApp


245020 04-Jan-2013 neel

The "unrestricted guest" capability is a feature of Intel VT-x that allows
the guest to execute real or unpaged protected mode code - bhyve relies on
this feature to execute the AP bootstrap code.

Get rid of the hack that allowed bhyve to support SMP guests on processors
that do not have the "unrestricted guest" capability. This hack was entirely
FreeBSD-specific and would not work with any other guest OS.

Instead, limit the number of vcpus to 1 when executing on processors without
"unrestricted guest" capability.

Suggested by: grehan
Obtained from: NetApp


244520 20-Dec-2012 grehan

Change thread name for the main kqueue event loop to "<vmname> mevent" so
it can be easily distinguished from other non-vCPU threads in forthcoming
changes.

Obtained from: NetApp


244167 13-Dec-2012 grehan

Rename fbsdrun.* -> bhyverun.*

bhyve is intended to be a generic hypervisor, and not FreeBSD-specific.

(renaming internal routines will come later)

Reviewed by: neel
Obtained from: NetApp


244160 12-Dec-2012 grehan

Properly reset the tx/rx rings when a guest requests a device reset.

Obtained from: NetApp


244159 12-Dec-2012 grehan

Create unique MAC addresses for virtio devices that are
created with non-zero PCI function numbers.

Remove obsolete reference to CFE.

Obtained from: NetApp


244013 08-Dec-2012 grehan

Determine the correct length and sector size for raw devices.

Obtained from: NetApp
Tested by: Michael Dexter with iscsi LUNs


243704 30-Nov-2012 grehan

- Add in an XSDT to stop acpidump from exiting with a
'XSDT corrupted' error
- Fix up OEMID/OEM Table ID string padding in the DSDT.

Output on a verbose boot now looks like

...
ACPI: RSDP 0xf0400 00024 (v02 BHYVE )
ACPI: XSDT 0xf0480 00034 (v01 BHYVE BVXSDT 00000001 INTL 20120320)
ACPI: APIC 0xf0500 0004A (v01 BHYVE BVMADT 00000001 INTL 20120320)
ACPI: FACP 0xf0600 0010C (v05 BHYVE BVFACP 00000001 INTL 20120320)
ACPI: DSDT 0xf0800 000F2 (v02 BHYVE BVDSDT 00000001 INTL 20120320)
ACPI: FACS 0xf0780 00040
...

Obtained from: NetApp


243651 28-Nov-2012 neel

Cleanup the user-space paging exit handler now that the unified instruction
emulation is in place.

Obtained from: NetApp


243640 28-Nov-2012 neel

Revamp the x86 instruction emulation in bhyve.

On a nested page table fault the hypervisor will:
- fetch the instruction using the guest %rip and %cr3
- decode the instruction in 'struct vie'
- emulate the instruction in host kernel context for local apic accesses
- any other type of mmio access is punted up to user-space (e.g. ioapic)

The decoded instruction is passed as collateral to the user-space process
that is handling the PAGING exit.

The emulation code is fleshed out to include more addressing modes (e.g. SIB)
and more types of operands (e.g. imm8). The source code is unified into a
single file (vmm_instruction_emul.c) that is compiled into vmm.ko as well
as /usr/sbin/bhyve.

Reviewed by: grehan
Obtained from: NetApp


243391 22-Nov-2012 neel

MSI-X does not need to be enabled in the message control register for the
guest to access the MSI-x tables.

Obtained from: NetApp


243349 21-Nov-2012 neel

Mask the %eax register properly based on whether the "out" instruction is
operating on 1, 2 or 4 bytes.

There could be garbage in the unused bytes so zero them off.

Obtained from: NetApp


243327 20-Nov-2012 grehan

ACPI support for bhyve.

The -A option will create the minimal set of required ACPI tables in
guest memory. Since ACPI mandates an IOAPIC, the -I option must also
be used.

Template ASL files are created, and then passed to the iasl compiler
to generate AML files. These are then loaded into guest physical mem.

In support of this, the ACPI PM timer is implemented, in 32-bit mode.

Tested on 7.4/8.*/9.*/10-CURRENT.

Reviewed by: neel
Obtained from: NetApp
Discussed with: jhb (a long while back)


242882 11-Nov-2012 neel

IFC @ r242684


242404 31-Oct-2012 grehan

Change the thread name of the vCPU threads to contain the
name of the VM and the vCPU number. This helps hugely
when using top -H to identify what a VM is doing.

Reviewed by: neel
Obtained from: NetApp


242385 31-Oct-2012 grehan

Exit if the requested num vCPUs exceeds the maximum rather
than waiting until AP bringup detects an out-of-range vCPU.

While here, fix all error output to use fprintf(stderr, ...

Reviewed by: neel
Reported by: @allanjude


242195 27-Oct-2012 neel

Present the bvm dbgport to the guest only when explicitly requested via
the "-g" command line option.

Suggested by: grehan
Obtained from: NetApp


242192 27-Oct-2012 neel

Present the bvm console device to the guest only when explicitly requested via
the "-b" command line option.

Reviewed by: grehan
Obtained from: NetApp


242170 27-Oct-2012 neel

Ignore PCI configuration accesses to all bus numbers other than PCI bus 0.

Obtained from: NetApp


242131 26-Oct-2012 grehan

Remove mptable generation code from libvmmapi and move it to bhyve.
Firmware tables require too much knowledge of system configuration,
and it's difficult to pass that information in general terms to a library.
The upcoming ACPI work exposed this - it will also livein bhyve.

Also, remove code specific to NetApp from the mptable name, and remove
the -n option from bhyve.

Reviewed by: neel
Obtained from: NetApp


241744 19-Oct-2012 grehan

Rework how guest MMIO regions are dealt with.

- New memory region interface. An RB tree holds the regions,
with a last-found per-vCPU cache to deal with the common case
of repeated guest accesses to MMIO registers in the same page.

- Support memory-mapped BARs in PCI emulation.

mem.c/h - memory region interface

instruction_emul.c/h - remove old region interface.
Use gpa from EPT exit to avoid a tablewalk to
determine operand address. Determine operand size
and use when calling through to region handler.

fbsdrun.c - call into region interface on paging
exit. Distinguish between instruction emul error
and region not found

pci_emul.c/h - implement new BAR callback api.
Split BAR alloc routine into routines that
require/don't require the BAR phys address.

ioapic.c
pci_passthru.c
pci_virtio_block.c
pci_virtio_net.c
pci_uart.c - update to new BAR callback i/f

Reviewed by: neel
Obtained from: NetApp


241490 12-Oct-2012 neel

Deal with transient EBUSY error return from vm_run() by retrying the operation.


240943 26-Sep-2012 neel

Add an option "-a" to present the local apic in the XAPIC mode instead of the
default X2APIC mode to the guest.


240912 25-Sep-2012 neel

Add an explicit exit code 'SPINUP_AP' to tell the controlling process that an
AP needs to be activated by spinning up an execution context for it.

The local apic emulation is now completely done in the hypervisor and it will
detect writes to the ICR_LO register that try to bring up the AP. In response
to such writes it will return to userspace with an exit code of SPINUP_AP.

Reviewed by: grehan


239086 06-Aug-2012 neel

Fix a bug in how a 64-bit bar in a pci passthru device would be presented to
the guest. Prior to the fix it was possible for such a bar to appear as a
32-bit bar as long as it was allocated from the region below 4GB.

This had the potential to confuse some drivers that were particular about
the size of the bars.

Obtained from: NetApp


239085 06-Aug-2012 neel

Add support for emulating PCI multi-function devices.

These function number is specified by an optional [:<func>] after the slot
number: -s 1:0,virtio-net,tap0

Ditto for the mptable naming: -n 1:0,e0a

Obtained from: NetApp


239045 05-Aug-2012 neel

Device model for ioapic emulation.

With this change the uart emulation is entirely interrupt driven.

Obtained from: NetApp


239044 04-Aug-2012 neel

The displacement field in the decoded instruction should be treated as a 8-bit
or 32-bit signed integer.

Simplify the handling of indirect addressing with displacement by
unconditionally adding the 'instruction->disp' to the target address.
This is alright since 'instruction->disp' is non-zero only for the
addressing modes that specify a displacement.

Obtained from: NetApp


239043 04-Aug-2012 neel

Add the "-I" option to control whether or not an ioapic is visible to the guest.

Obtained from: NetApp


239029 04-Aug-2012 neel

Use the correct variable to index into the 'lirq[]' array to check the legacy
IRQ ownership.


239028 04-Aug-2012 neel

Check that 'opts' is actually not NULL before dereferencing it. It is expected
that 'opts' will be NULL for the second serial port (-S <slot>,uart)


234938 03-May-2012 grehan

Add 16550 uart emulation as a PCI device. This allows it to
be activated as part of the slot config options.
The syntax is:

-s <slotnum>,uart[,stdio]

The stdio parameter instructs the code to perform i/o using
stdin/stdout. It can only be used for one instance.
To allow legacy i/o ports/irqs to be used, a new variant of
the slot command, -S, is introduced. When used to specify a
slot, the device will use legacy resources if it supports
them; otherwise it will be treated the same as the '-s' option.
Specifying the -S option with the uart will first use the 0x3f8/irq 4
config, and the second -S will use 0x2F8/irq 3.

Interrupt delivery is awaiting the arrival of the i/o apic code,
but this works fine in uart(4)'s polled mode.

This code was written by Cynthia Lu @ MIT while an intern at NetApp,
with further work from neel@ and grehan@.

Obtained from: NetApp


234761 28-Apr-2012 grehan

MSI-x interrupt support for PCI pass-thru devices.

Includes instruction emulation for memory r/w access. This
opens the door for io-apic, local apic, hpet timer, and
legacy device emulation.

Submitted by: ryan dot berryhill at sandvine dot com
Reviewed by: grehan
Obtained from: Sandvine


226521 18-Oct-2011 grehan

Ignore legacy INIT de-asserts in x2apic mode before verifying
the contents of the IPI.
Uncovered by jhb's x2apic patch.

Obtained from: NetApp


222830 07-Jun-2011 grehan

Allow access to the device's config area with any size i/o access at any
offset. This is now spec-compliant.


222238 24-May-2011 grehan

Catch up with CURRENTs different timer usage compared to 8.1. A counter
value of 0 in rategen mode is equivalent to a max initial value.
The TSC is now correctly calibrated on a 9.0 guest.

Obtained from: NetApp


222105 19-May-2011 grehan

Changes to allow the GENERIC+bhye kernel built from this branch to
run as a 1/2 CPU guest on an 8.1 bhyve host.

bhyve/inout.c
inout.h
fbsdrun.c
- Rather than exiting on accesses to unhandled i/o ports, emulate
hardware by returning -1 on reads and ignoring writes to unhandled
ports. Support the previous mode by allowing a 'strict' parameter
to be set from the command line.
The 8.1 guest kernel was vastly cut down from GENERIC and had no
ISA devices. Booting GENERIC exposes a massive amount of random
touching of i/o ports (hello syscons/vga/atkbdc).

bhyve/consport.c
dev/bvm/bvm_console.c
- implement a simplistic signature for the bvm console by returning
'bv' for an inw on the port. Also, set the priority of the console
to CN_REMOTE if the signature was returned. This works better in
an environment where multiple consoles are in the kernel (hello syscons)

bhyve/rtc.c
- return 0 for the access to RTC_EQUIPMENT (yes, you syscons)

amd64/vmm/x86.c
x86.h
- hide a bunch more CPUID leaf 1 bits from the guest to prevent
cpufreq drivers from probing.
The next step will be to move CPUID handling completely into
user-space. This will allow the full spectrum of changes from
presenting a lowest-common-denominator CPU type/feature set, to
exposing (almost) everything that the host can support.

Reviewed by: neel
Obtained from: NetApp


221942 15-May-2011 jhb

First cut to port bhyve, vmmctl, and libvmmapi to HEAD.


221828 13-May-2011 grehan

Import of bhyve hypervisor and utilities, part 1.
vmm.ko - kernel module for VT-x, VT-d and hypervisor control
bhyve - user-space sequencer and i/o emulation
vmmctl - dump of hypervisor register state
libvmm - front-end to vmm.ko chardev interface

bhyve was designed and implemented by Neel Natu.

Thanks to the following folk from NetApp who helped to make this available:
Joe CaraDonna
Peter Snyder
Jeff Heller
Sandeep Mann
Steve Miller
Brian Pawlowski