Skip to content
Snippets Groups Projects
Commit 8972ab31 authored by Chuck Silvers's avatar Chuck Silvers
Browse files

sysutils/cpu-microcode*: support early loading of AMD ucode

Install the AMD ucode in /boot/firmware for early loading just like
is done for intel.  Update the instructions for early loading to
reflect that AMD is now supported too.

Sponsored By:	Netflix
Reviewed by:	jrm
Differential Revision:	https://reviews.freebsd.org/D44025
parent 54e4e7da
No related branches found
No related tags found
No related merge requests found
PORTNAME= microcode
PORTVERSION= 20231019
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/amd-ucode/
PKGNAMEPREFIX= cpu-
......@@ -24,6 +25,8 @@ ONLY_FOR_ARCHS= amd64 i386
RUN_DEPENDS= ${LOCALBASE}/etc/rc.d/microcode_update:sysutils/cpu-microcode-rc
DATADIR= ${PREFIX}/share/cpucontrol
FWDIR= /boot/firmware
EXTRACT_CMD= ${CP}
EXTRACT_BEFORE_ARGS= # empty
EXTRACT_AFTER_ARGS= .
......@@ -31,12 +34,18 @@ NO_ARCH= yes
NO_BUILD= yes
NO_WRKSUBDIR= yes
PLIST_FILES= ${DISTFILES:S/^/${DATADIR}\//g:C/\?.*//}
PLIST_FILES= ${DISTFILES:S/^/${DATADIR}\//g:C/\?.*//} \
${FWDIR}/amd-ucode.bin
_REV= 06afd7f939c5b245b2af9e0fee13026f2aaf77fa
post-extract:
${CAT} ${WRKSRC}/microcode_amd* > ${WRKSRC}/amd-ucode.bin
do-install:
${MKDIR} ${STAGEDIR}${DATADIR}/
${MKDIR} ${STAGEDIR}${FWDIR}
${INSTALL_DATA} ${WRKSRC}/amd-ucode.bin ${STAGEDIR}${FWDIR}/
.for f in ${DISTFILES}
${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DATADIR}/${f:C/\?.*//}
.endfor
......
......@@ -4,23 +4,28 @@
This port includes an RC script, which is one of two methods to update
the CPU microcode on a FreeBSD system.
1. The first method does not require the RC script included here and is
only supported with Intel processors. It is the preferred method,
because it ensures that any CPU features introduced by a microcode
update are visible to the kernel by applying the update before the
kernel performs CPU feature detection.
1. Early loading.
This method does not use the RC script included here.
This is the preferred method, because it ensures that any CPU features
added or removed by a microcode update are visible to the kernel by
applying the update before the kernel performs CPU feature detection.
To enable updates using the first method, add the following lines to
To enable updates using early loading, add the following lines to
/boot/loader.conf:
cpu_microcode_load="YES"
and the appropriate one of these lines:
cpu_microcode_name="/boot/firmware/intel-ucode.bin"
cpu_microcode_name="/boot/firmware/amd-ucode.bin"
The microcode update will be loaded when the system is rebooted.
2. The second method, which uses the RC script included here, can be
enabled by adding the following line to /etc/rc.conf:
2. Late loading.
This method, which does use the RC script included here, is enabled by
adding the following line to /etc/rc.conf:
microcode_update_enable="YES"
......
PORTNAME= microcode
PORTVERSION= 1.0
PORTREVISION= 1
CATEGORIES= sysutils
PKGNAMEPREFIX= cpu-
......@@ -8,7 +9,7 @@ COMMENT= Meta-package for CPU microcode updates
ONLY_FOR_ARCHS= amd64 i386
RUN_DEPENDS= ${LOCALBASE}/share/cpucontrol/microcode_amd.bin:sysutils/cpu-microcode-amd \
RUN_DEPENDS= /boot/firmware/amd-ucode.bin:sysutils/cpu-microcode-amd \
/boot/firmware/intel-ucode.bin:sysutils/cpu-microcode-intel
USES= metaport
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment