-----BEGIN PGP SIGNED MESSAGE-----
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
<URL:https://security.FreeBSD.org/>.

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
devices.

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
system.

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:

<URL:https://cgit.freebsd.org/src/commit/?id=NNNNNN>

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:

<URL:https://svnweb.freebsd.org/base?view=revision&revision=NNNNNN>

VII. References

The latest revision of this advisory is available at
<URL:https://security.FreeBSD.org/advisories/FreeBSD-EN-22:03.hyperv.asc>
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE/A6HiuWv54gCjWNV05eS9J6n5cIFAmHd1f0ACgkQ05eS9J6n
5cJOLw//UcDfEZpVJqRvHm3e5B5c/rXCFLUWSS8NOQ7c4ioAOFZdOIs2D4u17Mbf
EJwiYLTdknv1mT2BkE8hr1fgPb/m1+FLyyEuhfaIRpJuqzn2l4YW4v9lwpBNl0I7
neuKqK4/j3SIjgdq7HZeiBEAyhIq5BGzzjnkPSbtW+RvGI8TCaAM7MgJYzCk1GKs
kaIHyc0tyFIkoW0RDTjWt3g6UD+VVn7VU6/8xfiBBF9WUBKOay8MtgjAQMpNXcLK
SZY2gLM9SMcdHZaKN0M5C0uly1bsXYn8eGOTy+dwGVOiJU2J0rFkcPdFjAIiWARb
c9fotcunUzv53dy2ZiP0VWv4chdqv8Yel9wm6D0jkqZ1QKTq3jFnHzaPCmcWPII5
92+YyGF5Yg+pm/s42AqVaMblN0vH/y8GlwOsp9zQBn4jjIhgUENYRdJMfY0KBopH
7SqWtC9C9yUli0PQHN79z6/u7ZIzEPugsGk19WAZUktcWIj+kTkRq7PGBSm3CL/E
tSpfRkhx1nMWa6c2ujZkFVCW7+HBaGtv9rlCb450g6Uzv6/7aYPGvxh7RCT8mQYK
9ao05vSkdCrbdGSTlCDG7iSjGTGPVLj7LH2eGp6mfXiZo9UmfItwu24J88QfRhmO
nUW3NY9Ff5dYKRLUw7G1nNIynzWsEz8NKyV/HwY2bkd53090CrI=
=wXdl
-----END PGP SIGNATURE-----