From nobody Fri Feb 23 17:29:17 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ThH7K6HhSz5B8Wl; Fri, 23 Feb 2024 17:29:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ThH7K5ghgz4gXJ; Fri, 23 Feb 2024 17:29:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708709357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2i6PGcAU9rsbVzVdyr8ReVrFzUMRxtGC0CSymPeP+TU=; b=lmCrLhHyoJsA/tTgWn3AWX9hDecRT3K+y5HKnWIlahV9vgfaharzXoJkN0NjNBvGub+KKO a/qhn2vj0PeLYrJrRI9YonRDGbb+p/qSepMEwVosKVz+p6CqNUwx+7WxcCpkhA0Ur5P/gv 8D69mh0uaEXWXWTDi6XJ8YkE9IU9JvF3jTJ7mmpl6MTndPDv8x6nw/P6FqliPLgVggue1s Jsg2bJnzP5l3Pkv0NIKFHeZHpYN+EbJlPOuqf2c3juWz0mrAGsYkxX0imR+B5GSBK7e1Rq lZkDZ+U0NNUxSVnuTp5KSlcSITDB6iPyp144UoZWcuhEX8j/japni5TqpC/WXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708709357; a=rsa-sha256; cv=none; b=w+8xM/kWBbM99NFBZ6dT2TfNDgBP7RhEdbTQhTU6tDKcrZ5CFXrjApV1H9KdDXMjQU6R3J O4V1vwAoyyn/+3MCCsvz5tGsq/xwO/3XihQqydOrcYOUPPcuO0i4nassEuaJDmXtYdHc+Y g0VhjI+ETM66c5K+TGzUSVQu4toclL/2DjqKZs5rvijYCO3CC9bjEsNPXwx/eTUibsk1Ya Fjkp79EQ95KyaH8aaHgpYv+AnjTJ+5uAh6j7JLIKzZHEqaOw1tMOH9Pqj6XoRrCafASuzk Q0w8BnZRQM+6LjrhzVaf+/x2f5s2jHXg1FFHQIvb7ZGnnjigST5bc6BHVpvPHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708709357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2i6PGcAU9rsbVzVdyr8ReVrFzUMRxtGC0CSymPeP+TU=; b=ihNH7BeDgw1eNAuH6FfnlcTeRW7MT2MBiUGBXRkzJb9iYzPDiLS5MpJMvH5WmPEiLUb1mX 7v12mL5kQhxF/JvpftWYBLCF8iLy9aFu9pDkJNGRFRy7yeZ+1G2Bzj/q/yGx7pYHr0SpyQ Z8l16TkAHVrcxo1UiBQxGRuvmMd6+0uw1Bm4KPLBFgpbAwE1L74ctwu422IXvqS61NYG7h +aPnwKaqRCUtDnztzeuticqYvBdU/pqXRLX28Y7ApT8eF5aOiVWXcCiw5HeswDGAKwEJWO 7wmZKkwot5ZlGAxa2KUJVB3EK906Ti4cezCLrZrJXdFIjvKZ8wxeUSEUyO+Ptg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4ThH7K4lh3zQ73; Fri, 23 Feb 2024 17:29:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41NHTH4E066916; Fri, 23 Feb 2024 17:29:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41NHTHHA066913; Fri, 23 Feb 2024 17:29:17 GMT (envelope-from git) Date: Fri, 23 Feb 2024 17:29:17 GMT Message-Id: <202402231729.41NHTHHA066913@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Chuck Silvers Subject: git: 8972ab311c75 - main - sysutils/cpu-microcode*: support early loading of AMD ucode List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: chs X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8972ab311c750984f6936ea93e80642beb7f792a Auto-Submitted: auto-generated The branch main has been updated by chs: URL: https://cgit.FreeBSD.org/ports/commit/?id=8972ab311c750984f6936ea93e80642beb7f792a commit 8972ab311c750984f6936ea93e80642beb7f792a Author: Chuck Silvers AuthorDate: 2024-02-23 17:14:47 +0000 Commit: Chuck Silvers CommitDate: 2024-02-23 17:29:13 +0000 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 --- sysutils/cpu-microcode-amd/Makefile | 11 ++++++++++- sysutils/cpu-microcode-rc/files/pkg-message.in | 21 +++++++++++++-------- sysutils/cpu-microcode/Makefile | 3 ++- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/sysutils/cpu-microcode-amd/Makefile b/sysutils/cpu-microcode-amd/Makefile index 27c726759236..838e5ade7302 100644 --- a/sysutils/cpu-microcode-amd/Makefile +++ b/sysutils/cpu-microcode-amd/Makefile @@ -1,5 +1,6 @@ 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 diff --git a/sysutils/cpu-microcode-rc/files/pkg-message.in b/sysutils/cpu-microcode-rc/files/pkg-message.in index 8984694e5476..10c1816da5f7 100644 --- a/sysutils/cpu-microcode-rc/files/pkg-message.in +++ b/sysutils/cpu-microcode-rc/files/pkg-message.in @@ -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" diff --git a/sysutils/cpu-microcode/Makefile b/sysutils/cpu-microcode/Makefile index 1661c015fd2b..a6075a1cc5b8 100644 --- a/sysutils/cpu-microcode/Makefile +++ b/sysutils/cpu-microcode/Makefile @@ -1,5 +1,6 @@ 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