[FreeBSD-Announce] FreeBSD Errata Notice FreeBSD-EN-22:03.hyperv

From: FreeBSD Errata Notices <errata-notices_at_freebsd.org>
Date: Tue, 11 Jan 2022 19:39:02 UTC
Hash: SHA512

FreeBSD-EN-22:03.hyperv                                         Errata Notice
                                                          The FreeBSD Project

Topic:          vPCI compatibility improvements with certain Hyper-V releases

Category:       core
Module:         hyperv
Announced:      2022-01-11
Credits:        Microsoft OSTC
Affects:        All supported versions of FreeBSD.
Corrected:      2021-11-30 07:43:32 UTC (stable/13, 13.0-STABLE)
                2022-01-11 18:14:59 UTC (releng/13.0, 13.0-RELEASE-p6)
                2021-12-14 12:20:17 UTC (stable/12, 12.3-STABLE)
                2022-01-11 18:19:26 UTC (releng/12.3, 12.3-RELEASE-p1)
                2022-01-11 18:33:14 UTC (releng/12.2, 12.2-RELEASE-p12)

For general information regarding FreeBSD Errata Notices and Security
Advisories, including descriptions of the fields above, security
branches, and the following sections, please visit

I.   Background

Hyper-V is a hypervisor provided on Windows server by Microsoft.  It
supports vPCI, which is a virtualized bus driver used to expose hardware
devices to virtual machines.  FreeBSD provides drivers

II.  Problem Description

A Hyper-V vPCI emulation change can cause SR-IOV (Single-Root I/O
Virtualization) and DDA (Discrete Device Assignment) devices to fail to
operate correctly under Hyper-V. 

In recent Hyper-V releases on Windows Server 2022, the vPCI code does
not initialize the last 4 bit of device registers.  This behavior change
could result in failure to initialize guest drivers for SR-IOV or DDA

III. Impact

SR-IOV and DDA devices may not work in FreeBSD running under certain
Hyper-V releases.

IV.  Workaround

No workaround is available, however systems not running within Hyper-V
or Azure are unaffected.

V.   Solution

Upgrade your system to a supported FreeBSD stable or release / security
branch (releng) dated after the correction date.

A reboot is required.

Perform one of the following:

1) To update your system via a binary patch:

Systems running a RELEASE version of FreeBSD on the amd64, i386, or
(on FreeBSD 13 and later) arm64 platforms can be updated via the
freebsd-update(8) utility:

# freebsd-update fetch
# freebsd-update install

A reboot is required.

2) To update your system via a source code patch:

The following patches have been verified to apply to the applicable
FreeBSD release branches.

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

# fetch https://security.FreeBSD.org/patches/EN-22:03/hyperv.patch
# fetch https://security.FreeBSD.org/patches/EN-22:03/hyperv.patch.asc
# gpg --verify hyperv.patch.asc

b) Apply the patch.  Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch

c) Recompile your kernel as described in
<URL:https://www.FreeBSD.org/handbook/kernelconfig.html> and reboot the

VI.  Correction details

This issue is corrected by the corresponding Git commit hash or Subversion
revision number in the following stable and release branches:

Branch/path                             Hash                     Revision
- -------------------------------------------------------------------------
stable/13/                              d11e9de955ea    stable/13-n248279
releng/13.0/                            dfca965af4e1  releng/13.0-n244770
stable/12/                                                        r371235
releng/12.3/                                                      r371484
releng/12.2/                                                      r371489
- -------------------------------------------------------------------------

For FreeBSD 13 and later:

Run the following command to see which files were modified by a
particular commit:

# git show --stat <commit hash>

Or visit the following URL, replacing NNNNNN with the hash:


To determine the commit count in a working tree (for comparison against
nNNNNNN in the table above), run:

# git rev-list --count --first-parent HEAD

For FreeBSD 12 and earlier:

Run the following command to see which files were modified by a particular
revision, replacing NNNNNN with the revision number:

# svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base

Or visit the following URL, replacing NNNNNN with the revision number:


VII. References

The latest revision of this advisory is available at