> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/release/13.0.md).

# FreeBSD 13.0-RELEASE 发行说明（2021 年 4 月 13 日）

* 原文链接：[FreeBSD 13.0-RELEASE Release Notes](https://www.freebsd.org/releases/13.0R/relnotes/)

## 摘要

FreeBSD 13.0-RELEASE 的发行说明总结了在 13-STABLE 开发分支中对 FreeBSD 基本系统所做的变更。本文档列出了自上一次发布以来发布的相关安全公告，以及 FreeBSD 内核和用户空间的重要变化。此外，还包含了一些关于升级的简要说明。

## 引言

本文档包含了 FreeBSD 13.0-RELEASE 的发行说明，介绍了 FreeBSD 最近添加、变更或删除的功能，并提供了一些从早期版本 FreeBSD 升级的注意事项。

这些发行说明适用于从 13-STABLE 分支创建以来的最新开发版本。有关此分支上预构建的二进制发行版本的信息，请访问 [https://www.FreeBSD.org/releases/](https://www.freebsd.org/releases/)。

本文档适用于介于 12.2-RELEASE 和未来的 13.1-RELEASE 之间的 13-STABLE 开发分支的一个阶段版本。也可以在 [https://www.FreeBSD.org/releases/](https://www.freebsd.org/releases/) 上找到有关此分支上预构建二进制发行版本的信息。

FreeBSD 13.0-RELEASE 的发行版本可以在 [https://www.FreeBSD.org/releases/](https://www.freebsd.org/releases/) 或其镜像站点上获取。获取该版本（或其他版本）的更多信息，请参阅 [FreeBSD 手册](https://docs.freebsd.org/en/books/handbook/) 的 [获取 FreeBSD 附录](https://docs.freebsd.org/en/books/handbook/mirrors)。

强烈建议所有用户在安装 FreeBSD 之前查阅发布勘误文档。勘误文档包含在发布周期后期或发布后发现的“最新”信息，通常包括已知错误、安全公告以及文档修正内容。可以在 FreeBSD 网站上找到 FreeBSD 13.0-RELEASE 的最新勘误文档。

本文档介绍了自 12.2-RELEASE 以来 FreeBSD 中用户最为关注的新增功能或变更。一般来说，文中描述的变更是 13-STABLE 分支独有的，除非特别标注为已合并（MERGED）的功能。

典型的发行说明内容包括自 12.2-RELEASE 之后发布的最新安全公告、新驱动或硬件支持、新命令或选项、重大错误修复或第三方软件升级。这些说明可能还会列出主要的 Ports/包变更或发布工程实践的更新。显然，发行说明无法列出每个版本之间 FreeBSD 所做的每项变更；本文档主要关注安全公告、用户可见的变更以及重要的架构改进。

## 从旧版 FreeBSD 升级

RELEASE 版本之间（以及不同安全分支的快照版本之间）的二进制升级可使用 [freebsd-update(8)](https://man.freebsd.org/cgi/man.cgi?query=freebsd-update\&sektion=8\&format=html) 工具完成。二进制升级过程将更新未修改的用户空间工具以及官方 FreeBSD 发布版本中分发的未修改的 **GENERIC** 内核。升级主机需要有互联网连接才能使用 \[freebsd-update(8)] 工具。

基于源码的升级（通过从源码重新编译 FreeBSD 基本系统）也受到支持，具体操作请参考 **/usr/src/UPDATING** 中的说明。

从早期 FreeBSD 版本升级 powerpc64 系统 **不受支持**。由于使用了新的 ABI，用户需要重新安装系统。

> 注意事项：
>
> 升级 FreeBSD 前应备份 **所有** 数据和配置文件。

> 注意事项：UEFI ESP 分区（固件引导所使用的分区）的更新方式发生了变化。详见 [引导加载程序的变更](https://www.freebsd.org/releases/13.0R/relnotes/#boot)。

## 安全与勘误

本节列出了自 12.2-RELEASE 以来的各种安全公告和勘误通知。

### 安全公告

| 公告                                                                                                                       | 日期              | 主题                                |
| ------------------------------------------------------------------------------------------------------------------------ | --------------- | --------------------------------- |
| [FreeBSD-SA-21:03.pam\_login\_access](https://www.FreeBSD.org/security/advisories/FreeBSD-SA-21:03.pam_login_access.asc) | 2021 年 2 月 24 日 | login.access 未能应用规则               |
| [FreeBSD-SA-21:04.jail\_remove](https://www.FreeBSD.org/security/advisories/FreeBSD-SA-21:04.jail_remove.asc)            | 2021 年 2 月 24 日 | jail\_remove\[2] 未能终止所有 Jail 中的进程 |
| [FreeBSD-SA-21:05.jail\_chdir](https://www.FreeBSD.org/security/advisories/FreeBSD-SA-21:05.jail_chdir.asc)              | 2021 年 2 月 24 日 | jail\_attach\[2] 依赖调用者更改当前工作目录    |
| [FreeBSD-SA-21:06.xen](https://www.FreeBSD.org/security/advisories/FreeBSD-SA-21:06.xen.asc)                             | 2021 年 2 月 24 日 | Xen 授权映射错误处理问题                    |
| [FreeBSD-SA-21:07.openssl](https://www.FreeBSD.org/security/advisories/FreeBSD-SA-21:07.openssl.asc)                     | 2021 年 3 月 25 日 | OpenSSL 中的多个漏洞                    |
| [FreeBSD-SA-21:08.vm](https://www.FreeBSD.org/security/advisories/FreeBSD-SA-21:08.vm.asc)                               | 2021 年 4 月 6 日  | 过期虚拟内存映射导致内存泄露                    |
| [FreeBSD-SA-21:09.accept\_filter](https://www.FreeBSD.org/security/advisories/FreeBSD-SA-21:09.accept_filter.asc)        | 2021 年 4 月 6 日  | accept\_filter\[9] 套接字配置接口中的双重释放  |
| [FreeBSD-SA-21:10.jail\_mount](https://www.FreeBSD.org/security/advisories/FreeBSD-SA-21:10.jail_mount.asc)              | 2021 年 4 月 6 日  | 通过挂载到 Jail 根目录可能实现 Jail 逃逸        |

### 勘误通知

| 勘误 | 日期 | 主题 |
| -- | -- | -- |

## 用户空间

本节涉及对用户空间应用程序、第三方软件和系统工具的变更和新增内容。

### 用户空间配置变更

[rc.subr(8)](https://man.freebsd.org/cgi/man.cgi?query=rc.subr\&sektion=8\&format=html) 现在在所有 [rc(8)](https://man.freebsd.org/cgi/man.cgi?query=rc\&sektion=8\&format=html) 脚本中支持 `${name}_env`。以前，如果服务定义了一个自定义变量 `*_cmd` （例如 `start_cmd`）来控制函数 `run_rc_command` 的行为，而不是依赖于 `command` 和 `command_args` 等变量，那么用户通过 `${name}_env` 设置的环境变量将被忽略。[d15e810db9a5](https://cgit.freebsd.org/src/commit/?id=d15e810db9a5)

[init(8)](https://man.freebsd.org/cgi/man.cgi?query=init\&sektion=8\&format=html)、[service(8)](https://man.freebsd.org/cgi/man.cgi?query=service\&sektion=8\&format=html) 和 [cron(8)](https://man.freebsd.org/cgi/man.cgi?query=cron\&sektion=8\&format=html) 现在默认会采用用户/类的环境变量（不包括 `PATH`）。特别是，所有 cron 作业和 [rc(8)](https://man.freebsd.org/cgi/man.cgi?query=rc\&sektion=8\&format=html) 服务的环境变量现在可以通过 [login.conf(5)](https://man.freebsd.org/cgi/man.cgi?query=login.conf\&sektion=5\&format=html) 设置。[21c1a93c048f](https://cgit.freebsd.org/src/commit/?id=21c1a93c048f)、[736a5a6d1dbb](https://cgit.freebsd.org/src/commit/?id=736a5a6d1dbb)、[7466dbd68487](https://cgit.freebsd.org/src/commit/?id=7466dbd68487)

[newsyslog(8)](https://man.freebsd.org/cgi/man.cgi?query=newsyslog\&sektion=8\&format=html) 的默认配置现在仅包含来自目录 **/etc/newsyslog.conf.d/** 和 **/usr/local/etc/newsyslog.conf.d/** 中以 `.conf` 结尾且不以 `.` 开头的文件。这与 [syslog.conf(5)](https://man.freebsd.org/cgi/man.cgi?query=syslog.conf\&sektion=5\&format=html) 的功能一致，同时避免包含 `.sample` 或 `.pkgnew` 等文件。[9165316ff6bf](https://cgit.freebsd.org/src/commit/?id=9165316ff6bf)

内核现在支持对用户进程强制实施 `W^X` 内存映射策略。默认情况下不强制执行该策略，但可以通过将 sysctl `kern.elf32.allow_wx` 和 `kern.elf64.allow_wx` 设置为 `0` 来启用。可以通过 [elfctl(1)](https://man.freebsd.org/cgi/man.cgi?query=elfctl\&sektion=1\&format=html) 使用 `wxneeded` 功能为单个二进制文件豁免该策略。[2e1c94aa1fd5](https://cgit.freebsd.org/src/commit/?id=2e1c94aa1fd5)（由 FreeBSD 基金会赞助）

### 用户空间应用程序变更

工具 [calendar(1)](https://man.freebsd.org/cgi/man.cgi?query=calendar\&sektion=1\&format=html) 重新支持嵌套的 C 预处理器条件语句，并新增支持 C++ 注释语法，同时保留对 C 语法的支持。[19b5c307548](https://cgit.freebsd.org/src/commit/?id=19b5c307548)

工具 [calendar(1)](https://man.freebsd.org/cgi/man.cgi?query=calendar\&sektion=1\&format=html) 在输出日期时会始终遵循调用用户的区域设置，而不再依赖可能因包含文件不同而变化的区域设置。[f1560bd080a](https://cgit.freebsd.org/src/commit/?id=f1560bd080a)

当使用 `-a` 选项调用时，[calendar(1)](https://man.freebsd.org/cgi/man.cgi?query=calendar\&sektion=1\&format=html) 会正确处理包含文件的路径。[19b5c307548](https://cgit.freebsd.org/src/commit/?id=19b5c307548)

工具 [calendar(1)](https://man.freebsd.org/cgi/man.cgi?query=calendar\&sektion=1\&format=html) 不再安装除 `calendar.freebsd` 以外的数据文件。这些数据文件现在通过 Port `deskutils/calendar-data` 提供。[d20d6550187](https://cgit.freebsd.org/src/commit/?id=d20d6550187)

工具 [daemon(8)](https://man.freebsd.org/cgi/man.cgi?query=daemon\&sektion=8\&format=html) 新增 `-H` 参数，用于在接收到 SIGHUP 信号时关闭并重新打开输出文件。这允许通过 [newsyslog(8)](https://man.freebsd.org/cgi/man.cgi?query=newsyslog\&sektion=8\&format=html) 实现输出文件轮换。[4cd407ec933](https://cgit.freebsd.org/src/commit/?id=4cd407ec933)

工具 [daemon(8)](https://man.freebsd.org/cgi/man.cgi?query=daemon\&sektion=8\&format=html) 在重启延迟期间不再阻止 SIGTERM 信号。[09a3675d961](https://cgit.freebsd.org/src/commit/?id=09a3675d961)

工具 [devd(8)](https://man.freebsd.org/cgi/man.cgi?query=devd\&sektion=8\&format=html) 在系统从睡眠中恢复时，会报告一个 `kernel` 系统事件，而非 `kern` 系统事件。[f87655ec7694](https://cgit.freebsd.org/src/commit/?id=f87655ec7694)

工具 [diskinfo(8)](https://man.freebsd.org/cgi/man.cgi?query=diskinfo\&sektion=8\&format=html) 现在会报告可用时的物理设备名称 GEOM 属性。[b5961be1ab7](https://cgit.freebsd.org/src/commit/?id=b5961be1ab7)

FreeBSD/i386 a.out 可执行文件的用户空间支持已删除。[9bc6c7219a37](https://cgit.freebsd.org/src/commit/?id=9bc6c7219a37), [50a40d091170](https://cgit.freebsd.org/src/commit/?id=50a40d091170), [0713c7b88cf0](https://cgit.freebsd.org/src/commit/?id=0713c7b88cf0)（由 FreeBSD 基金会赞助）

[elf2aout(1)](https://man.freebsd.org/cgi/man.cgi?query=elf2aout\&sektion=1\&format=html) 工具已移除。[dd99ab06f360](https://cgit.freebsd.org/src/commit/?id=dd99ab06f360)

工具 [freebsd-update(8)](https://man.freebsd.org/cgi/man.cgi?query=freebsd-update\&sektion=8\&format=html) 现在可在“Fetching files...”阶段显示进度。[d6e1e31a0e6](https://cgit.freebsd.org/src/commit/?id=d6e1e31a0e6)

工具 [freebsd-update(8)](https://man.freebsd.org/cgi/man.cgi?query=freebsd-update\&sektion=8\&format=html) 新增支持 `-p` 参数，以通过 [pwd\_mkdb(8)](https://man.freebsd.org/cgi/man.cgi?query=pwd_mkdb\&sektion=8\&format=html) 确保 **/etc/passwd** 包含密码数据库的变更。[9b6591109e8](https://cgit.freebsd.org/src/commit/?id=9b6591109e8)（由 FreeBSD 基金会赞助）

工具 [freebsd-update(8)](https://man.freebsd.org/cgi/man.cgi?query=freebsd-update\&sektion=8\&format=html) 新增命令 `updatesready` 和 `showconfig` ，分别用于检查更新和检查配置。[8cfda118cbd](https://cgit.freebsd.org/src/commit/?id=8cfda118cbd)

工具 [freebsd-update(8)](https://man.freebsd.org/cgi/man.cgi?query=freebsd-update\&sektion=8\&format=html) 的手册页新增了使用环境变量 `PAGER` 以便非交互式使用的说明。[32f4592764d](https://cgit.freebsd.org/src/commit/?id=32f4592764d)

用于 [crashinfo(8)](https://man.freebsd.org/cgi/man.cgi?query=crashinfo\&sektion=8\&format=html) 的旧版 GNU 调试器已删除。详细的内核崩溃信息可通过安装现代 GDB 获得。[1c0ea326aa6d](https://cgit.freebsd.org/src/commit/?id=1c0ea326aa6d)

源代码中的旧版 Binutils 2.17 和 [gcc(1)](https://man.freebsd.org/cgi/man.cgi?query=gcc\&sektion=1\&format=html) 4.2.1 已删除。所有受支持的架构现在都使用 LLVM/Clang 工具链。[0ad202f312f6](https://cgit.freebsd.org/src/commit/?id=0ad202f312f6), [a04ec978b369](https://cgit.freebsd.org/src/commit/?id=a04ec978b369), [57f804675e65](https://cgit.freebsd.org/src/commit/?id=57f804675e65), [90b9aa475e9e](https://cgit.freebsd.org/src/commit/?id=90b9aa475e9e)（由 FreeBSD 基金会赞助）

GPL 许可版本的 [dtc(1)](https://man.freebsd.org/cgi/man.cgi?query=dtc\&sektion=1\&format=html) 已移除。BSD 许可版本现在无条件构建和安装。[134b378392a8](https://cgit.freebsd.org/src/commit/?id=134b378392a8)（由 FreeBSD 基金会赞助）

工具 [gstat(8)](https://man.freebsd.org/cgi/man.cgi?query=gstat\&sektion=8\&format=html) 的手册页新增了交互式键盘命令的说明。[cfaa2958dc4](https://cgit.freebsd.org/src/commit/?id=cfaa2958dc4)

工具 [inetd(8)](https://man.freebsd.org/cgi/man.cgi?query=inetd\&sektion=8\&format=html) 的手册页新增了如何使用 Netcat 作为 HTTP 代理的示例。[a58fc861516](https://cgit.freebsd.org/src/commit/?id=a58fc861516)

工具 [inetd(8)](https://man.freebsd.org/cgi/man.cgi?query=inetd\&sektion=8\&format=html) 的手册页对所有示例新增了注释。[26a4a61a285](https://cgit.freebsd.org/src/commit/?id=26a4a61a285)

[ctm(1)](https://man.freebsd.org/cgi/man.cgi?query=ctm\&sektion=1\&format=html) 工具已移除。它现在由 Port `misc/ctm` 提供。[385e98080cab](https://cgit.freebsd.org/src/commit/?id=385e98080cab)

现在默认安装 BSD 版 [grep(1)](https://man.freebsd.org/cgi/man.cgi?query=grep\&sektion=1\&format=html)，已移除旧版 GNU grep。[8aff76fb37b5](https://cgit.freebsd.org/src/commit/?id=8aff76fb37b5), [47d1ad2413da](https://cgit.freebsd.org/src/commit/?id=47d1ad2413da)

自动挂载守护进程 [amd(8)](https://man.freebsd.org/cgi/man.cgi?query=amd\&sektion=8\&format=html) 已移除。其功能由 [autofs(5)](https://man.freebsd.org/cgi/man.cgi?query=autofs\&sektion=5\&format=html) 提供。[13f7dbe822d5](https://cgit.freebsd.org/src/commit/?id=13f7dbe822d5)（由 FreeBSD 基金会赞助）

### 第三方软件

工具 [bc(1)](https://man.freebsd.org/cgi/man.cgi?query=bc\&sektion=1\&format=html) 和 [dc(1)](https://man.freebsd.org/cgi/man.cgi?query=dc\&sektion=1\&format=html) 已使用 Gavin D. Howard 开发的新版本替换。这些新版本不再依赖外部大数库，支持 GNU bc 扩展，比原程序更快，并修复了其 POSIX 合规性问题。它们支持 POSIX 消息目录，并提供中文、荷兰语、英语、法语、德语、日语、波兰语、葡萄牙语和俄语的本地化消息。旧实现仍然在 FreeBSD 13 中可用，可通过构建选项 `WITHOUT_GH_BC` 选择。[c41fef90a7d](https://cgit.freebsd.org/src/commit/?id=c41fef90a7d)

实用程序 clang、lld、lldb 以及 compiler-rt、llvm、libunwind 和 libc++ 库已更新至 11.0.1 版本。[39b7445e15cd](https://cgit.freebsd.org/src/commit/?id=39b7445e15cd)

### 已弃用应用程序

### 运行时库和 API

libutil 中新增的函数 [getlocalbase(3)](https://man.freebsd.org/cgi/man.cgi?query=getlocalbase\&sektion=3\&format=html) 以标准方式检索 `LOCALBASE` 路径。[30d21d27953](https://cgit.freebsd.org/src/commit/?id=30d21d27953)

函数 [cap\_random(3)](https://man.freebsd.org/cgi/man.cgi?query=cap_random\&sektion=3\&format=html) 已删除，因为它已被 [getrandom(2)](https://man.freebsd.org/cgi/man.cgi?query=getrandom\&sektion=2\&format=html) 取代。[a76f78dc3f43](https://cgit.freebsd.org/src/commit/?id=a76f78dc3f43)

新增的 Linux 兼容 [copy\_file\_range(2)](https://man.freebsd.org/cgi/man.cgi?query=copy_file_range\&sektion=2\&format=html) 系统调用支持高效的文件复制。此系统调用特别允许内核请求 NFSv4.2 服务器在服务器端本地执行复制操作。[bbbbeca3e9a3](https://cgit.freebsd.org/src/commit/?id=bbbbeca3e9a3)

函数 [regex(3)](https://man.freebsd.org/cgi/man.cgi?query=regex\&sektion=3\&format=html) 不再接受对大多数普通字符的多余转义。这将导致 [sed(1)](https://man.freebsd.org/cgi/man.cgi?query=sed\&sektion=1\&format=html) 和 [grep(1)](https://man.freebsd.org/cgi/man.cgi?query=grep\&sektion=1\&format=html) 等应用程序拒绝包含这些转义的正则表达式。[adeebf4cd47c](https://cgit.freebsd.org/src/commit/?id=adeebf4cd47c)

新增的系统调用 [aio\_readv(2)](https://man.freebsd.org/cgi/man.cgi?query=aio_readv\&sektion=2\&format=html) 和 [aio\_writev(2)](https://man.freebsd.org/cgi/man.cgi?query=aio_writev\&sektion=2\&format=html) 提供了 [aio\_read(2)](https://man.freebsd.org/cgi/man.cgi?query=aio_read\&sektion=2\&format=html) 和 [aio\_write(2)](https://man.freebsd.org/cgi/man.cgi?query=aio_write\&sektion=2\&format=html) 的矢量化版本。[022ca2fc7fe0](https://cgit.freebsd.org/src/commit/?id=022ca2fc7fe0)

powerpc64 在切换到 LLVM 的同时改用 ELFv2 ABI。这使得 FreeBSD 达到了与现代 Linux 发行版的同等水平，同时也使得旧版 FreeBSD 的二进制文件与 13.0-RELEASE 不再兼容。内核仍支持 ELFv1，因此使用旧版 FreeBSD 的 Jail 和 chroot 仍然兼容。[e4399d169acc](https://cgit.freebsd.org/src/commit/?id=e4399d169acc)

[libalias(3)](https://man.freebsd.org/cgi/man.cgi?query=libalias\&sektion=3\&format=html) 中的 CU-SeeMe 支持已移除。[65a1d63665b](https://cgit.freebsd.org/src/commit/?id=65a1d63665b)

## 内核

本节涉及内核配置、系统调优以及未归类的系统控制参数的变更。

### 内核通用变更

进程附加到 [jail(8)](https://man.freebsd.org/cgi/man.cgi?query=jail\&sektion=8\&format=html) 时，其 [cpuset(1)](https://man.freebsd.org/cgi/man.cgi?query=cpuset\&sektion=1\&format=html) 将完全重置为 Jail 的 cpuset。特别是，如果一个进程已经被分配了编号的 cpuset，则它将被分配新的编号集合，该集合为进程和 Jail 允许的 CPU 的组合。如果超级用户所属的进程与 Jail 没有共享的 CPU，则其 CPU 掩码会根据需要隐式扩展。

内核加密框架已全面改造，以更好地支持现代加密算法，并简化设备驱动程序和框架消费者的接口。[c03414326909](https://cgit.freebsd.org/src/commit/?id=c03414326909)（由 Chelsio Communications 赞助）

[geli(8)](https://man.freebsd.org/cgi/man.cgi?query=geli\&sektion=8\&format=html) 现在将加速软件加密（如 x86 CPU 上的 AES-NI）报告为“加速软件”而非“硬件”。此变更仅限于命名，不会影响性能或支持。[a3d565a1188f](https://cgit.freebsd.org/src/commit/?id=a3d565a1188f)（由 Chelsio Communications 赞助）

被 RFC 6649 和 RFC 8429 弃用的 Kerberos GSS 算法支持已移除。[dee3aa83d1b6](https://cgit.freebsd.org/src/commit/?id=dee3aa83d1b6)（由 Chelsio Communications 赞助）

[geli(8)](https://man.freebsd.org/cgi/man.cgi?query=geli\&sektion=8\&format=html) 中已弃用的算法支持已移除。[e2b9919398c3](https://cgit.freebsd.org/src/commit/?id=e2b9919398c3)（由 Chelsio Communications 赞助）

被 RFC 8221 弃用的 IPsec 算法及 Triple DES 支持已移除。[16aabb761c0a](https://cgit.freebsd.org/src/commit/?id=16aabb761c0a)（由 Chelsio Communications 赞助）

[cryptodev(4)](https://man.freebsd.org/cgi/man.cgi?query=cryptodev\&sektion=4\&format=html) 和内核加密框架中已弃用的加密算法支持已移除。 [6c80c319ef88](https://cgit.freebsd.org/src/commit/?id=6c80c319ef88)（由 Chelsio Communications 赞助）

amd64 的 DMAR 驱动程序已重构，为其他架构提供了通用的 I/O MMU 框架。作为此重构的一部分，amd64 特定的内核选项 **ACPI\_DMAR** 已重命名为 **IOMMU**。[6186bfbd1880](https://cgit.freebsd.org/src/commit/?id=6186bfbd1880)（由 DARPA, AFRL 赞助）

aarch64 架构的 ARM 系统内存管理单元（SMMU）版本 3.2 的驱动程序已添加，该驱动程序通过内核选项 **IOMMU** 启用。[4cc8701067e1](https://cgit.freebsd.org/src/commit/?id=4cc8701067e1)（由 DARPA, AFRL, Innovate UK 赞助）

默认情况下，amd64 和 i386 架构的 **GENERIC** 内核现在包含 [aesni(4)](https://man.freebsd.org/cgi/man.cgi?query=aesni\&sektion=4\&format=html)，以支持 [geli(8)](https://man.freebsd.org/cgi/man.cgi?query=geli\&sektion=8\&format=html) 的加速软件加密。[074a91f746bd](https://cgit.freebsd.org/src/commit/?id=074a91f746bd)

默认情况下，aarch64 架构的 **GENERIC** 内核现在包含 [armv8crypto(4)](https://man.freebsd.org/cgi/man.cgi?query=armv8crypto\&sektion=4\&format=html)，以支持 [geli(8)](https://man.freebsd.org/cgi/man.cgi?query=geli\&sektion=8\&format=html) 的加速软件加密。[074a91f746bd](https://cgit.freebsd.org/src/commit/?id=074a91f746bd)

安全内存回收（Safe Memory Reclamation，SMR）已添加到内核中，这是一种与 [uma(9)](https://man.freebsd.org/cgi/man.cgi?query=uma\&sektion=9\&format=html) 紧密结合的轻量化 epoch 回收变体。该功能已应用于 VM 子系统和 VFS 层，提升了高核数系统的可扩展性。[d4665eaa6638](https://cgit.freebsd.org/src/commit/?id=d4665eaa6638)

基于 procfs 的进程调试支持已移除。[59838c1a197](https://cgit.freebsd.org/src/commit/?id=59838c1a197)

[netgdb(4)](https://man.freebsd.org/cgi/man.cgi?query=netgdb\&sektion=4\&format=html) 功能已添加，允许通过网络使用 [gdb(4)](https://man.freebsd.org/cgi/man.cgi?query=gdb\&sektion=4\&format=html) 内核调试器。[dda17b3672f2](https://cgit.freebsd.org/src/commit/?id=dda17b3672f2)

[backlight(9)](https://man.freebsd.org/cgi/man.cgi?query=backlight\&sektion=9\&format=html) 子系统已添加。[675aae732d3](https://cgit.freebsd.org/src/commit/?id=675aae732d3)（由 FreeBSD 基金会赞助）

CAM-Newbus SDIO 支持模块已添加。[67ca7330cf3](https://cgit.freebsd.org/src/commit/?id=67ca7330cf3)（由 FreeBSD 基金会赞助）

## 设备与驱动

本节介绍自 FreeBSD 12.2-RELEASE 以来，对设备和驱动程序的变更和新增内容。

### 设备驱动程序

多个针对过时以太网适配器的网络驱动程序已移除：

* [bm(4)](https://man.freebsd.org/cgi/man.cgi?query=bm\&sektion=4\&format=html) BMAC [9e774e53407b](https://cgit.freebsd.org/src/commit/?id=9e774e53407b)
* [cs(4)](https://man.freebsd.org/cgi/man.cgi?query=cs\&sektion=4\&format=html) Crystal Semiconductor CS8900/CS8920 [e1edf1240b33](https://cgit.freebsd.org/src/commit/?id=e1edf1240b33)
* [de(4)](https://man.freebsd.org/cgi/man.cgi?query=de\&sektion=4\&format=html) DEC DC21x4x [08ac01a92c88](https://cgit.freebsd.org/src/commit/?id=08ac01a92c88)
* [ed(4)](https://man.freebsd.org/cgi/man.cgi?query=ed\&sektion=4\&format=html) NE-2000 和 WD-80x3 [05aa6e583be3](https://cgit.freebsd.org/src/commit/?id=05aa6e583be3)
* [ep(4)](https://man.freebsd.org/cgi/man.cgi?query=ep\&sektion=4\&format=html) 3Com Etherlink III (3c5x9) ISA [e153ee663af1](https://cgit.freebsd.org/src/commit/?id=e153ee663af1)
* [ex(4)](https://man.freebsd.org/cgi/man.cgi?query=ex\&sektion=4\&format=html) Intel EtherExpress Pro/10 和 Pro/10+ [3ee01a13855b](https://cgit.freebsd.org/src/commit/?id=3ee01a13855b)
* [fe(4)](https://man.freebsd.org/cgi/man.cgi?query=fe\&sektion=4\&format=html) Fujitsu MB86960A/MB86965A [dd262716a1e0](https://cgit.freebsd.org/src/commit/?id=dd262716a1e0)
* [hme(4)](https://man.freebsd.org/cgi/man.cgi?query=hme\&sektion=4\&format=html) Sun Microelectronics STP2002-STQ [9ee99cec1f36](https://cgit.freebsd.org/src/commit/?id=9ee99cec1f36)
* [pcn(4)](https://man.freebsd.org/cgi/man.cgi?query=pcn\&sektion=4\&format=html) AMD PCnet [607790d10fdb](https://cgit.freebsd.org/src/commit/?id=607790d10fdb)
* [sf(4)](https://man.freebsd.org/cgi/man.cgi?query=sf\&sektion=4\&format=html) Starfire [3b70dd81f56f](https://cgit.freebsd.org/src/commit/?id=3b70dd81f56f)
* [sn(4)](https://man.freebsd.org/cgi/man.cgi?query=sn\&sektion=4\&format=html) SMC 91Cxx [90089841deba](https://cgit.freebsd.org/src/commit/?id=90089841deba)
* [tl(4)](https://man.freebsd.org/cgi/man.cgi?query=tl\&sektion=4\&format=html) Texas Instruments ThunderLAN [7c897ca91fe1](https://cgit.freebsd.org/src/commit/?id=7c897ca91fe1)
* [tx(4)](https://man.freebsd.org/cgi/man.cgi?query=tx\&sektion=4\&format=html) SMC 83c17x [b1b1c2fe385c](https://cgit.freebsd.org/src/commit/?id=b1b1c2fe385c)
* [txp(4)](https://man.freebsd.org/cgi/man.cgi?query=txp\&sektion=4\&format=html) 3Com 3XP Typhoon/Sidewinder (3CR990) [be345ff023d9](https://cgit.freebsd.org/src/commit/?id=be345ff023d9)
* [vx(4)](https://man.freebsd.org/cgi/man.cgi?query=vx\&sektion=4\&format=html) 3Com EtherLink III / Fast EtherLink III (3c59x) PCI [e8504bf9e7a0](https://cgit.freebsd.org/src/commit/?id=e8504bf9e7a0)
* [wb(4)](https://man.freebsd.org/cgi/man.cgi?query=wb\&sektion=4\&format=html) Winbond W89C840F [02fae06a11b4](https://cgit.freebsd.org/src/commit/?id=02fae06a11b4)
* [xe(4)](https://man.freebsd.org/cgi/man.cgi?query=xe\&sektion=4\&format=html) Xircom PCMCIA [7a582e5374c8](https://cgit.freebsd.org/src/commit/?id=7a582e5374c8)

[qat(4)](https://man.freebsd.org/cgi/man.cgi?query=qat\&sektion=4\&format=html) 驱动程序已新增，用于支持 Intel QuickAssist (QAT) 设备的一些加密加速功能。[qat(4)](https://man.freebsd.org/cgi/man.cgi?query=qat\&sektion=4\&format=html) 驱动支持集成在 Atom C2000 和 C3000、Xeon C620 和 D-1500 平台中的 QAT 设备，以及 Intel QAT Adapter 8950。[72143e89bb43](https://cgit.freebsd.org/src/commit/?id=72143e89bb43)（由 Rubicon Communications, LLC (“Netgate”) 赞助）

针对过时 Broadcom BCM58xx 加密加速器的驱动程序 [ubsec(4)](https://man.freebsd.org/cgi/man.cgi?query=ubsec\&sektion=4\&format=html) 已移除。[97e251327f95](https://cgit.freebsd.org/src/commit/?id=97e251327f95)（由 Chelsio Communications 赞助）

用于 USB FM 调谐器的已弃用驱动程序 [ufm(4)](https://man.freebsd.org/cgi/man.cgi?query=ufm\&sektion=4\&format=html) 已移除。[209d3fb41fe](https://cgit.freebsd.org/src/commit/?id=209d3fb41fe)

已弃用的驱动程序 [ctau(4)](https://man.freebsd.org/cgi/man.cgi?query=ctau\&sektion=4\&format=html) 和 [cx(4)](https://man.freebsd.org/cgi/man.cgi?query=cx\&sektion=4\&format=html) 已移除。[2733d8c96c6f](https://cgit.freebsd.org/src/commit/?id=2733d8c96c6f)（由 FreeBSD 基金会赞助）

针对并行端口 SCSI 适配器的驱动程序 [vpo(4)](https://man.freebsd.org/cgi/man.cgi?query=vpo\&sektion=4\&format=html) 已移除。[51691e26d06](https://cgit.freebsd.org/src/commit/?id=51691e26d06)

新增的驱动程序 [safexcel(4)](https://man.freebsd.org/cgi/man.cgi?query=safexcel\&sektion=4\&format=html) 用于通过 EIP-97 数据包处理模块（例如在 ESPRESSObin 中找到的模块）处理加密请求。[b356ddf07671](https://cgit.freebsd.org/src/commit/?id=b356ddf07671)（由 Rubicon Communications, LLC 赞助）

新增的驱动程序 [usbhid(4)](https://man.freebsd.org/cgi/man.cgi?query=usbhid\&sektion=4\&format=html) 使用 [hid(4)](https://man.freebsd.org/cgi/man.cgi?query=hid\&sektion=4\&format=html) 框架中的驱动程序来支持 USB HID 设备，而不是使用 [ukbd(4)](https://man.freebsd.org/cgi/man.cgi?query=ukbd\&sektion=4\&format=html)、[ums(4)](https://man.freebsd.org/cgi/man.cgi?query=ums\&sektion=4\&format=html) 和 [uhid(4)](https://man.freebsd.org/cgi/man.cgi?query=uhid\&sektion=4\&format=html)。启用 [usbhid(4)](https://man.freebsd.org/cgi/man.cgi?query=usbhid\&sektion=4\&format=html) 需要将 `hw.usb.usbhid.enable=1` 添加到文件 **/boot/loader.conf** 中，并在文件 **/etc/rc.conf** 中的 `kld_list=""` 里添加 `usbhid`。[b62f6dfaed3d](https://cgit.freebsd.org/src/commit/?id=b62f6dfaed3d)

VirtIO 设备驱动程序现在支持 VirtIO V1 规范，这改善了 FreeBSD 作为来宾操作系统与各种虚拟机监控程序和模拟器的兼容性，包括能够在 QEMU 上的 [Q35 芯片组](https://wiki.qemu.org/images/4/4e/Q35.pdf) 上运行。

新增的驱动程序 [ossl(4)](https://man.freebsd.org/cgi/man.cgi?query=ossl\&sektion=4\&format=html) 支持在 aarch64、amd64 和 i386 上使用 OpenSSL 的汇编例程优化的软件加密。[ba610be90a7c](https://cgit.freebsd.org/src/commit/?id=ba610be90a7c)（由 Netflix 赞助）， [22bd0c9731d7](https://cgit.freebsd.org/src/commit/?id=22bd0c9731d7)（由 FreeBSD 基金会赞助）

支持 ARMv8 CPU 上软件加密的驱动程序 [armv8crypto(4)](https://man.freebsd.org/cgi/man.cgi?query=armv8crypto\&sektion=4\&format=html) 现在支持 AES-XTS，其被 [geli(8)](https://man.freebsd.org/cgi/man.cgi?query=geli\&sektion=8\&format=html) 使用。[4979620ece98](https://cgit.freebsd.org/src/commit/?id=4979620ece98)

[armv8crypto(4)](https://man.freebsd.org/cgi/man.cgi?query=armv8crypto\&sektion=4\&format=html) 驱动程序现在支持 AES-GCM，这被 IPsec 和内核 TLS 使用。[f76393a6305b](https://cgit.freebsd.org/src/commit/?id=f76393a6305b6)（由 Ampere Computing 赞助）

[ixl(4)](https://man.freebsd.org/cgi/man.cgi?query=ixl\&sektion=4\&format=html) 被移植到了 powerpc64。[c5568ba08741](https://cgit.freebsd.org/src/commit/?id=c5568ba08741)

[mrsas(4)](https://man.freebsd.org/cgi/man.cgi?query=mrsas\&sektion=4\&format=html) 被移植到了 powerpc64。[e34a057ca6eb](https://cgit.freebsd.org/src/commit/?id=e34a057ca6eb)

[aacraid(4)](https://man.freebsd.org/cgi/man.cgi?query=aacraid\&sektion=4\&format=html) 被移植到了 powerpc64。[d8c51c6f74b6](https://cgit.freebsd.org/src/commit/?id=d8c51c6f74b6)

[virtio(4)](https://man.freebsd.org/cgi/man.cgi?query=virtio\&sektion=4\&format=html) 被移植到了 powerpc64。[f272c8de6e47](https://cgit.freebsd.org/src/commit/?id=f272c8de6e47)

[hwpmc(4)](https://man.freebsd.org/cgi/man.cgi?query=hwpmc\&sektion=4\&format=html) 获得了对 POWER8 和 POWER9 的支持。[68dd71825601](https://cgit.freebsd.org/src/commit/?id=68dd71825601)

[cpld(4)](https://man.freebsd.org/cgi/man.cgi?query=cpld\&sektion=4\&format=html) 驱动程序已为 powerpc64 和 powerpcspe 编写。[2a05eb9f3c4b](https://cgit.freebsd.org/src/commit/?id=2a05eb9f3c4b)，[ccb1ebe01caa](https://cgit.freebsd.org/src/commit/?id=ccb1ebe01caa)

以太网驱动程序 [cgem(4)](https://man.freebsd.org/cgi/man.cgi?query=cgem\&sektion=4\&format=html) 现在支持 64 位物理地址。[facdd1cd2045](https://cgit.freebsd.org/src/commit/?id=facdd1cd2045)

新增的驱动程序 [axp(4)](https://man.freebsd.org/cgi/man.cgi?query=axp\&sektion=4\&format=html) 支持 AMD EPYC 处理器中的 10G 以太网控制器。[7113afc84c0](https://cgit.freebsd.org/src/commit/?id=7113afc84c0)

[cpufreq(4)](https://man.freebsd.org/cgi/man.cgi?query=cpufreq\&sektion=4\&format=html) 已添加对 Intel Speed Shift 的支持。[4577cf3744b](https://cgit.freebsd.org/src/commit/?id=4577cf3744b)

pwm-backlight 兼容设备（例如 Pinebook 和 Pinebook Pro 上的设备）的驱动程序已添加。[38d94a4bc75](https://cgit.freebsd.org/src/commit/?id=38d94a4bc75)（由 FreeBSD 基金会赞助）

## 存储

本节涉及本地和网络文件系统及其他存储子系统的变更和新增功能。

### 通用存储

针对 [iscsi(4)](https://man.freebsd.org/cgi/man.cgi?query=iscsi\&sektion=4\&format=html) 和 [ctld(8)](https://man.freebsd.org/cgi/man.cgi?query=ctld\&sektion=8\&format=html)，指定网络 QoS 的支持已添加，包括 DiffServ 代码点（DSCP）和以太网优先级代码点（PCP）。[ddf1072aac49](https://cgit.freebsd.org/src/commit/?id=ddf1072aac49)（由 NetApp 赞助）

[ctld(8)](https://man.freebsd.org/cgi/man.cgi?query=ctld\&sektion=8\&format=html) 工具现在支持 `-t` 参数，用于测试配置文件的有效性。[7fcbecd004f](https://cgit.freebsd.org/src/commit/?id=7fcbecd004f)

设备框架 [nand(4)](https://man.freebsd.org/cgi/man.cgi?query=nand\&sektion=4\&format=html) 以及 [nandfs(5)](https://man.freebsd.org/cgi/man.cgi?query=nandfs\&sektion=5\&format=html) 文件系统和相关工具已移除。[f5a95d9a0794](https://cgit.freebsd.org/src/commit/?id=f5a95d9a0794)

**GEOM\_SCHED** 类及其附带的工具 [gsched(8)](https://man.freebsd.org/cgi/man.cgi?query=gsched\&sektion=8\&format=html) 已移除。[86c06ff8864](https://cgit.freebsd.org/src/commit/?id=86c06ff8864)

[gnop(8)](https://man.freebsd.org/cgi/man.cgi?query=gnop\&sektion=8\&format=html) 现在可以为读写请求设置可配置的延迟，以模拟慢速磁盘。[4f80c85519d5](https://cgit.freebsd.org/src/commit/?id=4f80c85519d5)

对于不支持稀疏文件的文件系统，内核现在提供了 `SEEK_DATA` 和 `SEEK_HOLE` [ioctl(2)](https://man.freebsd.org/cgi/man.cgi?query=ioctl\&sektion=2\&format=html) 的默认实现。[2e1b32c0e3fc](https://cgit.freebsd.org/src/commit/?id=2e1b32c0e3fc)

NFS 客户端和服务器现在支持 NFSv4.2（RFC 7862）以及扩展属性（RFC 8276）。[c057a378180e](https://cgit.freebsd.org/src/commit/?id=c057a378180e)

默认情况下，尝试读取目录将失败并返回 `EISDIR`。使用 [grep(1)](https://man.freebsd.org/cgi/man.cgi?query=grep\&sektion=1\&format=html) 的 `-d skip` 参数可以在非递归地搜索包含目录的列表时，抑制 stderr 中的错误。[dcef4f65ae39](https://cgit.freebsd.org/src/commit/?id=dcef4f65ae39)

NFS 服务器现在能通过 [exports(5)](https://man.freebsd.org/cgi/man.cgi?query=exports\&sektion=5\&format=html) 中的 `-maproot` 或 `-mapall` 指定的凭据包含超过 16 个组。[cc5efdde94bf](https://cgit.freebsd.org/src/commit/?id=cc5efdde94bf)

NFS 客户端和服务器现在支持基于 TLS 的 NFS。相关的用户空间守护进程默认未构建，但可以通过在构建新世界时启用选项 `WITH_OPENSSL_KTLS` （包含 KTLS 支持的 OpenSSL）来启用。[6e4b6ff88fde](https://cgit.freebsd.org/src/commit/?id=6e4b6ff88fde)，[2c76eebca71b](https://cgit.freebsd.org/src/commit/?id=2c76eebca71b)，[59f6f5e23c1a](https://cgit.freebsd.org/src/commit/?id=59f6f5e23c1a)

新增的变量 `nfsv4_server_only` 可以在 **/etc/rc.conf** 中设置为 `YES`，以仅启用对 NFSv4 的支持。这避免了在 NFS 服务器上运行 [rpcbind(8)](https://man.freebsd.org/cgi/man.cgi?query=rpcbind\&sektion=8\&format=html) 的需要。[4389a5661034](https://cgit.freebsd.org/src/commit/?id=4389a5661034)

协议 [fusefs(5)](https://man.freebsd.org/cgi/man.cgi?query=fusefs\&sektion=5\&format=html) 已更新至 7.28，并增加了对 `FUSE_COPY_FILE_RANGE` 和 `FUSE_LSEEK` 的支持。[92bbfe1f0d1f](https://cgit.freebsd.org/src/commit/?id=92bbfe1f0d1f)

ZFS 的实现现由 OpenZFS 提供。[9e5787d2284e](https://cgit.freebsd.org/src/commit/?id=9e5787d2284e)（由 iXsystems 赞助）

新增的驱动 [pvscsi(4)](https://man.freebsd.org/cgi/man.cgi?query=pvscsi\&sektion=4\&format=html) 支持 VMWare 产品（如 ESXi）中的虚拟化 SCSI 控制器。[052e12a5084](https://cgit.freebsd.org/src/commit/?id=052e12a5084)（由 VMWare 和 Panzura 赞助）

## 引导加载程序变更

本节涉及引导加载程序、引导菜单及其他与引导相关的变更。

工具 [efibootmgr(8)](https://man.freebsd.org/cgi/man.cgi?query=efibootmgr\&sektion=8\&format=html) 现在支持参数 `-b`，用于指定创建或修改的特定引导条目索引。[a2581e80212](https://cgit.freebsd.org/src/commit/?id=a2581e80212)（由 Netflix 赞助）

工具 [efibootmgr(8)](https://man.freebsd.org/cgi/man.cgi?query=efibootmgr\&sektion=8\&format=html) 现在支持参数 `-E`，用于查询引导系统时使用的 EFI 系统分区。[1cdb8eb8fe1](https://cgit.freebsd.org/src/commit/?id=1cdb8eb8fe1)（由 Netflix 赞助）

工具 [efibootmgr(8)](https://man.freebsd.org/cgi/man.cgi?query=efibootmgr\&sektion=8\&format=html) 现在支持参数 `-f` 和 `-F`，用于设置或清除请求在下次引导时进入 UEFI 用户界面的选项。[83c4237258d](https://cgit.freebsd.org/src/commit/?id=83c4237258d)（由 Ampere Computing, Inc. 赞助）

此前版本中 **/boot/boot1.efifat** 包含完整的 MS-DOS 格式化文件系统。旧版 FreeBSD 会将此文件系统映像安装到原始分区中。然而，由于 ESP（EFI 系统分区）的使用日益广泛，这种不灵活的方式已不再适合用户需求。用户对分区大小的需求多种多样，多重引导设置需要更详细的访问方式。更新旧 ESP 分区的用户应停止使用工具 [gpart(8)](https://man.freebsd.org/cgi/man.cgi?query=gpart\&sektion=8\&format=html)，而是应将 ESP 分区挂载为 MS-DOS 文件系统至 **/boot/efi**，并将 **/boot/loader.efi** 复制到 **/boot/efi/efi/boot/bootx64.efi**，如果使用默认设置。如果使用 [efibootmgr(8)](https://man.freebsd.org/cgi/man.cgi?query=efibootmgr\&sektion=8\&format=html) 自定义引导环境，应将此文件复制到使用 `-l` 参数设置的位置。

## 网络

本节介绍了影响 FreeBSD 网络的变更。

### 通用网络

新增的一种（网络数据缓冲区）类型 [mbuf(9)](https://man.freebsd.org/cgi/man.cgi?query=mbuf\&sektion=9\&format=html) 可以将多个未映射的物理页面表示为单个缓冲区。这通过减少套接字缓冲区中 mbuf 链表的长度，提高了 [sendfile(2)](https://man.freebsd.org/cgi/man.cgi?query=sendfile\&sektion=2\&format=html) 的性能。[82334850ea45](https://cgit.freebsd.org/src/commit/?id=82334850ea45)，[cec06a3edc52](https://cgit.freebsd.org/src/commit/?id=cec06a3edc52)（由 Netflix 赞助）

内核现在支持在内核中对基于 TCP 套接字的传输层安全（TLS）数据进行帧处理和加密，支持 TLS 1.0 到 1.3 版本。内核加密驱动程序支持 MtE 加密套件的 AES-CBC 和 AEAD 加密套件的 AES-GCM。接收卸载支持 TLS 1.2 的 AES-GCM 加密套件。使用 KTLS 需要支持 KTLS 的用户空间 SSL 库。基本系统中包含的 OpenSSL 库默认不启用 KTLS 支持，但可以通过使用 `WITH_OPENSSL_KTLS` 选项构建启用。[b2e60773c6b0](https://cgit.freebsd.org/src/commit/?id=b2e60773c6b0)，[6554362c6640](https://cgit.freebsd.org/src/commit/?id=6554362c6640)，[f1f934754638](https://cgit.freebsd.org/src/commit/?id=f1f934754638)，[3c0e56850511](https://cgit.freebsd.org/src/commit/?id=3c0e56850511)，[c1c52cd57e88](https://cgit.freebsd.org/src/commit/?id=c1c52cd57e88)（由 Netflix 和 Chelsio Communications 赞助）

[tcp(4)](https://man.freebsd.org/cgi/man.cgi?query=tcp\&sektion=4\&format=html) 现在支持按比例速率减少（Proportional Rate Reduction，PRR，如 RFC6937 所述），以改进在突发丢包和 ACK 稀疏场景下的 SACK 丢包恢复。这一功能默认启用。新增 [sysctl(8)](https://man.freebsd.org/cgi/man.cgi?query=sysctl\&sektion=8\&format=html) 参数 `net.inet.tcp.do_prr`，可设置为 `0` 以恢复以前的行为。

PRR 通常有助于改进丢包恢复性能，并防止许多可避免的重传超时（RTO）中断。这一行为优于之前的实现，但也可以启用严格的分组保守变体。配置错误的令牌桶流量限速器即使在丢包恢复期间也可能导致持续丢包。在这种情况下，激活保守的 PRR 变体可能避免一些重传超时（RTO）及相关的会话中断（仅持续几毫秒），但在一般情况下的表现不够理想。新增 [sysctl(8)](https://man.freebsd.org/cgi/man.cgi?query=sysctl\&sektion=8\&format=html) 参数 `net.inet.tcp.do_prr_conservative`，可设置为 `1` 以启用严格的分组保守行为（每收到一个 ACK 最多发送 1 个分段），而常规变体每收到一个 ACK 最多可发送 2 个分段——这在 ACK 稀疏或突发大量丢包的情况下会有所帮助。[0e1d7c25c5ab](https://cgit.freebsd.org/src/commit/?id=0e1d7c25c5ab)（由 NetApp 赞助）

[cc\_cubic(4)](https://man.freebsd.org/cgi/man.cgi?query=cc_cubic\&sektion=4\&format=html) TCP 拥塞控制算法更接近 RFC8312 标准。[40f9078ff9d9](https://cgit.freebsd.org/src/commit/?id=40f9078ff9d9)（由 NetApp 赞助）

未解析 ARP/NDP 条目中的排队数据包数量增加到 16。[0da3f8c98d17](https://cgit.freebsd.org/src/commit/?id=0da3f8c98d17d9) 对堆叠 VLAN（802.1ad）的支持已增加。[c7cffd65c5d8](https://cgit.freebsd.org/src/commit/?id=c7cffd65c5d8)

[ping(8)](https://man.freebsd.org/cgi/man.cgi?query=ping\&sektion=8\&format=html) 工具现在支持网络 QoS 设置，包括 IP DSCP [6034024daddb](https://cgit.freebsd.org/src/commit/?id=6034024daddb) 和以太网 PCP [81a6f4c7ae69](https://cgit.freebsd.org/src/commit/?id=81a6f4c7ae69)。（由 NetApp 赞助）

[ping(8)](https://man.freebsd.org/cgi/man.cgi?query=ping\&sektion=8\&format=html) 和 [ping6(8)](https://man.freebsd.org/cgi/man.cgi?query=ping6\&sektion=8\&format=html) 工具已合并。现在 [ping(8)](https://man.freebsd.org/cgi/man.cgi?query=ping\&sektion=8\&format=html) 同时支持 IPv4 和 IPv6，同时保留了兼容性的 [ping6(8)](https://man.freebsd.org/cgi/man.cgi?query=ping6\&sektion=8\&format=html)。[3cde9171d2d5](https://cgit.freebsd.org/src/commit/?id=3cde9171d2d5)

SCTP 支持现在作为新的内核模块 **sctp.ko** 提供，不再默认编译进 **GENERIC** 内核。[e64080e79c53](https://cgit.freebsd.org/src/commit/?id=e64080e79c53)（由 FreeBSD 基金会赞助）

## 路由

FreeBSD 13 具有经过重写的路由栈。它基于新引入的下一跳（nexthops）对象，这些对象包含了将数据包传递到目标所需的所有状态信息。[a666325282ea](https://cgit.freebsd.org/src/commit/?id=a666325282ea)

多路径路由支持以更可扩展的方式重写，支持 64 路多路径路由，并具有 `O(1)` 的查找时间。[fedeb08b6a58](https://cgit.freebsd.org/src/commit/?id=fedeb08b6a58)。内核选项 **RADIX\_MPATH** 被 **ROUTE\_MPATH** 替代，且默认开启。此外，sysctl `net.route.multipath` 已新增，用于运行时控制该功能。[d1d941c5b910](https://cgit.freebsd.org/src/commit/?id=d1d941c5b910)，[d5fe384b4d41](https://cgit.freebsd.org/src/commit/?id=d5fe384b4d41)

对自定义路由查找算法的支持已添加。该框架解耦了控制平面和数据平面，从而在负载下为大型路由表提供更快的查找速度和更好的收敛时间。[f5baf8bb12f3](https://cgit.freebsd.org/src/commit/?id=f5baf8bb12f3)

基于 DPDK librte 的 IPv4/IPv6 路由查找算法已添加，对大型路由表优化了控制平面和数据平面。[537d13437314](https://cgit.freebsd.org/src/commit/?id=537d13437314)

接口 fib 现在用于代理 ARP 检查。[66bc03d41566](https://cgit.freebsd.org/src/commit/?id=66bc03d41566)

在不同 fibs 中使用相同前缀的接口的回环路由安装问题已修复。[9fdbf7eef5c0](https://cgit.freebsd.org/src/commit/?id=9fdbf7eef5c0)

可以通过控制 sysctl `net.fibs` 在运行时变更 fib 的数量。[f5247a232a33](https://cgit.freebsd.org/src/commit/?id=f5247a232a33)

sysctl `net.add_addr_allfibs` 的默认值已变更为 `0`。[2d3982419593](https://cgit.freebsd.org/src/commit/?id=2d3982419593)

同时支持 IPv4 和 IPv6 的临时路由（设置了 `-expire` 时间的路由）过期处理。[34a5582c47c7](https://cgit.freebsd.org/src/commit/?id=34a5582c47c7)

**/32** 或 **/128** 接口别名的重复路由安装问题已修复。[81728a538d24](https://cgit.freebsd.org/src/commit/?id=81728a538d24)

IPv6 接口路由现在像 IPv4 一样标记为 `RTF_PINNED`。[81728a538d24](https://cgit.freebsd.org/src/commit/?id=81728a538d24)

工具 [route(8)](https://man.freebsd.org/cgi/man.cgi?query=route\&sektion=8\&format=html) 的网络自动猜测功能已移除，通过清除类相关行为的遗留代码。[d28210b2c2aa](https://cgit.freebsd.org/src/commit/?id=d28210b2c2aa)

sysctl `net.inet6.ip6.deembed_scopeid` 已移除，它用于禁用 IPv6 scope 的解嵌。[bec053ffe01d](https://cgit.freebsd.org/src/commit/?id=bec053ffe01d)

## 硬件支持

本节涉及对物理机器、虚拟机管理程序和虚拟化环境的硬件支持，以及不属于本文档其他部分的硬件变更和更新。

### AMD64

现在 amd64 架构支持海光（Hygon）Dhyana Family 18h 处理器。[2ee49fac82fc](https://cgit.freebsd.org/src/commit/?id=2ee49fac82fc)

amd64 架构现已支持 57 位虚拟地址（LA57）功能，适用于支持该功能的 CPU。这允许用户进程使用最多 56 位的虚拟地址空间。此外，还支持 bhyve 使用的五层嵌套页表。[9ce875d9b59d](https://cgit.freebsd.org/src/commit/?id=9ce875d9b59d)（由 FreeBSD 基金会赞助）

### arm64

FreeBSD 13 将 64 位 ARM 架构（arm64 或 AArch64）提升至 Tier-1 支持级别。[公告](https://lists.freebsd.org/pipermail/freebsd-arm/2021-April/023602.html)

树莓派 4B 上 Broadcom “GENET” 以太网驱动程序的支持已添加，该驱动部分来源于 NetBSD 的版本。[2cd0c529781a](https://cgit.freebsd.org/src/commit/?id=2cd0c529781a)

arm64 的 pmap 中已添加对地址空间标识符（ASIDs）的支持，提高了某些工作负载下的 TLB 利用率。[50e3ab6bcf8c](https://cgit.freebsd.org/src/commit/?id=50e3ab6bcf8c)

[linux(4)](https://man.freebsd.org/cgi/man.cgi?query=linux\&sektion=4\&format=html) ABI 兼容层现在默认启用。[6659d8e7c26](https://cgit.freebsd.org/src/commit/?id=6659d8e7c26)（由 FreeBSD 基金会赞助）

对 [gdb(4)](https://man.freebsd.org/cgi/man.cgi?query=gdb\&sektion=4\&format=html) 内核调试器的支持已添加。[bbfa199cbc16](https://cgit.freebsd.org/src/commit/?id=bbfa199cbc16)（由 FreeBSD 基金会赞助）

构建 ISO 安装镜像的支持已添加。[6dadc5d1cdec](https://cgit.freebsd.org/src/commit/?id=6dadc5d1cdec)（由 FreeBSD 基金会赞助）

Rock64 和 RockPro64 的 SD 卡配置文件已添加。[b407a449ac4c](https://cgit.freebsd.org/src/commit/?id=b407a449ac4c)，[0edb2e1d0caa](https://cgit.freebsd.org/src/commit/?id=0edb2e1d0caa)

### ARMv5

对 32 位 ARM 架构版本 5 的支持已移除。构建 `TARGET=arm` 现在默认为 `TARGET_ARCH=armv7`。[eb4977bd0fb2](https://cgit.freebsd.org/src/commit/?id=eb4977bd0fb2)

### Allwinner

驱动 `aw_gpio` 现在支持 GPIO 中断。[0fe5379c6a9](https://cgit.freebsd.org/src/commit/?id=0fe5379c6a9)

新增驱动 `aw_pwm`，支持 Allwinner 板上的脉冲宽度调制（PWM）硬件。可通过 [pwm(8)](https://man.freebsd.org/cgi/man.cgi?query=pwm\&sektion=8\&format=html) 配置 PWM 通道。[277a038d0da](https://cgit.freebsd.org/src/commit/?id=277a038d0da)

驱动 AXP803/AXP813 现在可报告电池传感器信息。[66bddb4c701](https://cgit.freebsd.org/src/commit/?id=66bddb4c701)

H3/H5 SoC 上的音频功能已启用。[bfcf888a87a](https://cgit.freebsd.org/src/commit/?id=bfcf888a87a)

H3 SoC 上的红外接收器功能现已启用。[012fba460ac](https://cgit.freebsd.org/src/commit/?id=012fba460ac)

现已启用多个 Allwinner SoC 上的 USB DRD 功能，这意味着某些 USB 端口可以作为外设使用。[aea49d9fed9](https://cgit.freebsd.org/src/commit/?id=aea49d9fed9)

### RockChip

新增驱动 `rk_pwm`，支持 RK3399 上的 PWM 硬件。可通过 [pwm(8)](https://man.freebsd.org/cgi/man.cgi?query=pwm\&sektion=8\&format=html) 配置 PWM 通道。[bcd380e88b2](https://cgit.freebsd.org/src/commit/?id=bcd380e88b2)

RK3399 SoC 现在支持外部 PCI-Express 适配器。[dfd1d0fcabe](https://cgit.freebsd.org/src/commit/?id=dfd1d0fcabe)

RK3328 和 RK3399 上的 USB3 功能现已支持。[7d888a5b2be](https://cgit.freebsd.org/src/commit/?id=7d888a5b2be)

`if_dwc` 现在支持流量控制。[2b4a66ed171](https://cgit.freebsd.org/src/commit/?id=2b4a66ed171)

`if_dwc` 现在支持校验和卸载。[98ea5a7b9a1](https://cgit.freebsd.org/src/commit/?id=98ea5a7b9a1)

### POWER

所有 powerpc 架构现已切换至 LLVM，工具链与 amd64 基本相似。[678da4a27447](https://cgit.freebsd.org/src/commit/?id=678da4a27447)

32 位 powerpc 架构切换至 Secure-PLT。[e861dab45186](https://cgit.freebsd.org/src/commit/?id=e861dab45186)

新增 powerpc64le（64 位小端端口），面向 POWER8 及更新的处理器。[b75abea4d087](https://cgit.freebsd.org/src/commit/?id=b75abea4d087)

powerpc64 和 powerpc64le 的 Radix MMU 支持已引入（实验性功能，默认禁用）。[65bbba25d214](https://cgit.freebsd.org/src/commit/?id=65bbba25d214)

powerpc64 和 powerpc64le 的超级页支持已引入（实验性功能，默认禁用）。[e2d6c417e303](https://cgit.freebsd.org/src/commit/?id=e2d6c417e303)

LinuxKPI 已获支持。[937a05ba81c3](https://cgit.freebsd.org/src/commit/?id=937a05ba81c3)

无需大页的 QEMU/KVM pseries 已获支持。[b934fc74683b](https://cgit.freebsd.org/src/commit/?id=b934fc74683b)

内核 minidump 处理已获支持。[d3c34fc0f473](https://cgit.freebsd.org/src/commit/?id=d3c34fc0f473)

`memcpy`、`memmove`、`bcopy`、`strncpy` 和 `strcpy` 已优化。[e16c18650cdc](https://cgit.freebsd.org/src/commit/?id=e16c18650cdc)，[181e35008cfb](https://cgit.freebsd.org/src/commit/?id=181e35008cfb)，[075fb85f0904](https://cgit.freebsd.org/src/commit/?id=075fb85f0904)

POWER9 的 XIVE 中断控制器驱动已引入，性能提升约 10%。[d49fc192c141](https://cgit.freebsd.org/src/commit/?id=d49fc192c141)

通过将 pmap 驱动转换为 ifunc，性能提升约 20%。[45b69dd63](https://cgit.freebsd.org/src/commit/?id=45b69dd63)

大量稳定性修复已完成，解决了许多内核崩溃问题。

其他大量性能改进——在批量构建所有包时，性能至少提升 60%。

### Sparc

对 `sparc64` 架构（SPARC 9）的支持已移除。[58aa35d42975](https://cgit.freebsd.org/src/commit/?id=58aa35d42975)

### 虚拟化支持

实用工具 [bhyve(8)](https://man.freebsd.org/cgi/man.cgi?query=bhyve\&sektion=8\&format=html) 现支持额外的串口 COM3 和 COM4。[eed1cc6cdfa](https://cgit.freebsd.org/src/commit/?id=eed1cc6cdfa)

已弃用的设备模型 bvmconsole 和 bvmdebug 及其相关的 FreeBSD 客户端内核设备驱动已从 [bhyve(8)](https://man.freebsd.org/cgi/man.cgi?query=bhyve\&sektion=8\&format=html) 中移除。[c4df8cbfde5](https://cgit.freebsd.org/src/commit/?id=c4df8cbfde5)

实用工具 [bhyve(8)](https://man.freebsd.org/cgi/man.cgi?query=bhyve\&sektion=8\&format=html) 现在可以可靠地与更多 VNC 客户端配合使用，包括 macOS 的“屏幕共享”应用程序。[2bb4be0f865](https://cgit.freebsd.org/src/commit/?id=2bb4be0f865)

实用工具 [bhyve(8)](https://man.freebsd.org/cgi/man.cgi?query=bhyve\&sektion=8\&format=html) 现在支持 VirtIO-9p（即 VirtFS）文件系统共享。[100353cfbf8](https://cgit.freebsd.org/src/commit/?id=100353cfbf8)（由 Conclusive Engineering 提供开发支持，vStack.com 赞助）

实用工具 [bhyve(8)](https://man.freebsd.org/cgi/man.cgi?query=bhyve\&sektion=8\&format=html) 现已支持虚拟机快照功能。此功能仍在开发中，尚未默认启用。[483d953a86a](https://cgit.freebsd.org/src/commit/?id=483d953a86a)（由布加勒斯特理工大学、Matthew Grooms（学生奖学金）和 iXsystems 赞助）

实用工具 [bhyve(8)](https://man.freebsd.org/cgi/man.cgi?query=bhyve\&sektion=8\&format=html) 现在支持虚拟机生成计数器 ACPI 设备。[9cb339cc7b8](https://cgit.freebsd.org/src/commit/?id=9cb339cc7b8)

实用工具 [bhyve(8)](https://man.freebsd.org/cgi/man.cgi?query=bhyve\&sektion=8\&format=html) 现在支持 PCI HDAudio 设备。[7e3c7420615](https://cgit.freebsd.org/src/commit/?id=7e3c7420615)

## Ports 和软件包基础设施

本节涉及 FreeBSD Ports、软件包基础设施以及软件包维护和安装工具的变更。

### 软件包变更

## 关于后续 FreeBSD 版本的一般说明

### 默认 `CPUTYPE` 变更

i386 架构的默认 `CPUTYPE` 现已改为 `686`（此前为 `486`）。

这意味着生成的二进制文件默认需要 686 类 CPU 支持，包括但不限于由 FreeBSD 发布工程团队提供的二进制文件。FreeBSD 13.0 代码库仍然支持较旧的 CPU。如果用户需要在 486 或 586 类 CPU 上运行，必须自行构建相应的发行版本。

由于嵌入式市场是基于 i486 和 i586 的核心的主要用户，预计此变更对终端用户的影响将非常小。大多数嵌入式系统通常已经使用了定制构建。尽管可能需要进行一些小的调整，但其工作量与从一个主要版本迁移到另一个主要版本所需的努力相当。基于这些 CPU 类型的服务器和桌面机器通常已有超过 20 年的历史。大多数已被淘汰，或者由于资源匮乏，FreeBSD 13.0 对其来说并不是一个具有吸引力的升级方案。

做出这一变更的几个关键因素包括：大多数应用程序需要 64 位原子操作以正常运行。尽管这些操作可以在 i486 的内核中进行模拟，但在用户空间中无法模拟。更新默认值后，编译器生成的代码可以在这些情况下选择正确的原子操作，从而实现更好的优化，并在必要时生成更好的错误消息。旧的库和/或包含文件方法在生成代码和诊断方面的效果要差得多。当前的编译器技术能够为 i686 生成更好、更快或更小的二进制文件。编译器对 i486 代码生成支持中的一些问题表明其在更广泛生态系统中的使用较少。在更广泛的生态系统中，i686 已经作为默认值存在多年，因此得到了更多的测试和优化。最后，自其诞生以来，32 位 amd64 库一直基于 i686。这些因素表明，i686 默认设置将显著改善用户体验，从而弥补少数旧技术用户所需的轻微调整。

由于大多数 32 位测试是开发者在带有内核选项 **COMPAT\_FREEBSD32** 的 64 位硬件上通过 lib32 库进行的，此变更确保了更好的覆盖范围和用户体验。这也符合多数 Linux® 发行版的做法。

预计这是 i386 默认 `CPUTYPE` 的最后一次提升。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/release/13.0.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
