[RFC,configs/releng] Make and use amd_ucode.bin for initrd.
diff mbox

Message ID 20180819022929.24175-1-vmlinuz386@gmail.com
State New
Headers show

Commit Message

Ian Li via arch-releng Aug. 19, 2018, 2:29 a.m. UTC
Requested at FS#59694
---
 configs/releng/build.sh                            | 14 ++++++++++++++
 .../efiboot/loader/entries/archiso-x86_64-cd.conf  |  1 +
 .../efiboot/loader/entries/archiso-x86_64-usb.conf |  1 +
 configs/releng/syslinux/archiso_pxe.cfg            |  6 +++---
 configs/releng/syslinux/archiso_sys.cfg            |  2 +-
 5 files changed, 20 insertions(+), 4 deletions(-)

Comments

Christian Hesse Aug. 22, 2018, 9:24 a.m. UTC | #1
Gerardo Exequiel Pozzi via arch-releng <arch-releng@archlinux.org> on Sat,
2018/08/18 23:29:
> +# Prepare amd_ucode
> +make_amd_ucode_img() {
> +    mkdir -p ${work_dir}/amd-ucode/kernel/x86/microcode
> +    cat
> ${work_dir}/x86_64/airootfs/lib/firmware/amd-ucode/microcode_amd*.bin >
> ${work_dir}/amd-ucode/kernel/x86/microcode/AuthenticAMD.bin
> +    pushd ${work_dir}/amd-ucode > /dev/null
> +    echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R 0:0
> > amd-ucode.img
> +    popd > /dev/null
> +    cp ${work_dir}/amd-ucode/amd-ucode.img
> ${work_dir}/x86_64/airootfs/boot/amd-ucode.img +}

Wondering if we should put this into a package... Could be a split package of
linux-firmware. Any opinion on this?
Ian Li via arch-releng Aug. 22, 2018, 2:32 p.m. UTC | #2
El 22/08/18 a las 06:24, Christian Hesse escribió:
> Gerardo Exequiel Pozzi via arch-releng <arch-releng@archlinux.org> on Sat,
> 2018/08/18 23:29:
>> +# Prepare amd_ucode
>> +make_amd_ucode_img() {
>> +    mkdir -p ${work_dir}/amd-ucode/kernel/x86/microcode
>> +    cat
>> ${work_dir}/x86_64/airootfs/lib/firmware/amd-ucode/microcode_amd*.bin >
>> ${work_dir}/amd-ucode/kernel/x86/microcode/AuthenticAMD.bin
>> +    pushd ${work_dir}/amd-ucode > /dev/null
>> +    echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R 0:0
>>> amd-ucode.img
>> +    popd > /dev/null
>> +    cp ${work_dir}/amd-ucode/amd-ucode.img
>> ${work_dir}/x86_64/airootfs/boot/amd-ucode.img +}
> 
> Wondering if we should put this into a package... Could be a split package of
> linux-firmware. Any opinion on this?
> 

Yes, split package from linux-firmware should be the best way.
Ian Li via arch-releng Aug. 22, 2018, 2:59 p.m. UTC | #3
On 8/22/18 5:24 AM, Christian Hesse wrote:
> Gerardo Exequiel Pozzi via arch-releng <arch-releng@archlinux.org> on Sat,
> 2018/08/18 23:29:
>> +# Prepare amd_ucode
>> +make_amd_ucode_img() {
>> +    mkdir -p ${work_dir}/amd-ucode/kernel/x86/microcode
>> +    cat
>> ${work_dir}/x86_64/airootfs/lib/firmware/amd-ucode/microcode_amd*.bin >
>> ${work_dir}/amd-ucode/kernel/x86/microcode/AuthenticAMD.bin
>> +    pushd ${work_dir}/amd-ucode > /dev/null
>> +    echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R 0:0
>>> amd-ucode.img
>> +    popd > /dev/null
>> +    cp ${work_dir}/amd-ucode/amd-ucode.img
>> ${work_dir}/x86_64/airootfs/boot/amd-ucode.img +}
> 
> Wondering if we should put this into a package... Could be a split package of
> linux-firmware. Any opinion on this?

We have an AUR package already for it, seemingly:
https://aur.archlinux.org/packages/amd-ucode-early/

Looks like there are definitely people who want it.
Christian Hesse Aug. 23, 2018, 9:20 a.m. UTC | #4
Christian Hesse <list@eworm.de> on Wed, 2018/08/22 11:24:
> Gerardo Exequiel Pozzi via arch-releng <arch-releng@archlinux.org> on Sat,
> 2018/08/18 23:29:
> > +# Prepare amd_ucode
> > +make_amd_ucode_img() {
> > +    mkdir -p ${work_dir}/amd-ucode/kernel/x86/microcode
> > +    cat
> > ${work_dir}/x86_64/airootfs/lib/firmware/amd-ucode/microcode_amd*.bin >
> > ${work_dir}/amd-ucode/kernel/x86/microcode/AuthenticAMD.bin
> > +    pushd ${work_dir}/amd-ucode > /dev/null
> > +    echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R
> > 0:0  
> > > amd-ucode.img  
> > +    popd > /dev/null
> > +    cp ${work_dir}/amd-ucode/amd-ucode.img
> > ${work_dir}/x86_64/airootfs/boot/amd-ucode.img +}  
> 
> Wondering if we should put this into a package... Could be a split package
> of linux-firmware. Any opinion on this?

[ Added Laurent to CC as he maintains the linux-firmware package. ]

I've attached a proposal patch to add a split package amd-ucode-early to
linux-firmware. Any objections? Is the name ok or do we prefer just
'amd-ucode'?

And another note... Did anybody test if microcode is updated properly if both,
intel-ucode.img and amd-ucode, are loaded?
Christian Hesse Aug. 23, 2018, 9:22 a.m. UTC | #5
Christian Hesse <list@eworm.de> on Thu, 2018/08/23 11:20:
> Christian Hesse <list@eworm.de> on Wed, 2018/08/22 11:24:
> > Gerardo Exequiel Pozzi via arch-releng <arch-releng@archlinux.org> on Sat,
> > 2018/08/18 23:29:  
> > > +# Prepare amd_ucode
> > > +make_amd_ucode_img() {
> > > +    mkdir -p ${work_dir}/amd-ucode/kernel/x86/microcode
> > > +    cat
> > > ${work_dir}/x86_64/airootfs/lib/firmware/amd-ucode/microcode_amd*.bin >
> > > ${work_dir}/amd-ucode/kernel/x86/microcode/AuthenticAMD.bin
> > > +    pushd ${work_dir}/amd-ucode > /dev/null
> > > +    echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R
> > > 0:0    
> > > > amd-ucode.img    
> > > +    popd > /dev/null
> > > +    cp ${work_dir}/amd-ucode/amd-ucode.img
> > > ${work_dir}/x86_64/airootfs/boot/amd-ucode.img +}    
> > 
> > Wondering if we should put this into a package... Could be a split package
> > of linux-firmware. Any opinion on this?  
> 
> [ Added Laurent to CC as he maintains the linux-firmware package. ]
> 
> I've attached a proposal patch to add a split package amd-ucode-early to
> linux-firmware. Any objections? Is the name ok or do we prefer just
> 'amd-ucode'?
> 
> And another note... Did anybody test if microcode is updated properly if
> both, intel-ucode.img and amd-ucode, are loaded?

Oh, attachments are stripped, so adding inline...

Index: PKGBUILD
===================================================================
--- PKGBUILD	(revision 332849)
+++ PKGBUILD	(working copy)
@@ -1,40 +1,16 @@
 # $Id$
 # Maintainer: Thomas Bächler <thomas@archlinux.org>
 
-pkgname=linux-firmware
+pkgbase=linux-firmware
+pkgname=(linux-firmware amd-ucode-early)
 _commit=f1b95fe5a51830bb8c1712082de4279a042376b6 # master
 pkgver=20180815.f1b95fe
-pkgrel=1
+pkgrel=2
 pkgdesc="Firmware files for Linux"
 makedepends=('git')
 arch=('any')
 url="http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=summary"
 license=('GPL2' 'GPL3' 'custom')
-conflicts=('linux-firmware-git'
-           'kernel26-firmware'
-           'ar9170-fw'
-           'iwlwifi-1000-ucode'
-           'iwlwifi-3945-ucode'
-           'iwlwifi-4965-ucode'
-           'iwlwifi-5000-ucode'
-           'iwlwifi-5150-ucode'
-           'iwlwifi-6000-ucode'
-           'rt2870usb-fw'
-           'rt2x00-rt61-fw'
-           'rt2x00-rt71w-fw'
-           'amd-ucode')
-replaces=('kernel26-firmware'
-          'ar9170-fw'
-          'iwlwifi-1000-ucode'
-          'iwlwifi-3945-ucode'
-          'iwlwifi-4965-ucode'
-          'iwlwifi-5000-ucode'
-          'iwlwifi-5150-ucode'
-          'iwlwifi-6000-ucode'
-          'rt2870usb-fw'
-          'rt2x00-rt61-fw'
-          'rt2x00-rt71w-fw'
-          'amd-ucode')
 options=(!strip)
 source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git#commit=${_commit}")
 md5sums=('SKIP')
@@ -50,7 +26,39 @@
   echo $(TZ=UTC git show -s --pretty=%cd --date=format-local:%Y%m%d HEAD).$(git rev-parse --short HEAD)
 }
 
-package() {
+build() {
+  mkdir -p kernel/x86/microcode
+  cat ${pkgbase}/amd-ucode/microcode_amd*.bin > kernel/x86/microcode/AuthenticAMD.bin
+  echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R 0:0 > amd-ucode.img
+}
+
+package_linux-firmware() {
+  conflicts=('linux-firmware-git'
+             'kernel26-firmware'
+             'ar9170-fw'
+             'iwlwifi-1000-ucode'
+             'iwlwifi-3945-ucode'
+             'iwlwifi-4965-ucode'
+             'iwlwifi-5000-ucode'
+             'iwlwifi-5150-ucode'
+             'iwlwifi-6000-ucode'
+             'rt2870usb-fw'
+             'rt2x00-rt61-fw'
+             'rt2x00-rt71w-fw'
+             'amd-ucode')
+  replaces=('kernel26-firmware'
+            'ar9170-fw'
+            'iwlwifi-1000-ucode'
+            'iwlwifi-3945-ucode'
+            'iwlwifi-4965-ucode'
+            'iwlwifi-5000-ucode'
+            'iwlwifi-5150-ucode'
+            'iwlwifi-6000-ucode'
+            'rt2870usb-fw'
+            'rt2x00-rt61-fw'
+            'rt2x00-rt71w-fw'
+            'amd-ucode')
+
   cd "${srcdir}/${pkgname}"
 
   make DESTDIR="${pkgdir}" FIRMWAREDIR=/usr/lib/firmware install
@@ -64,4 +72,11 @@
   echo 'w /sys/devices/system/cpu/microcode/reload - - - - 1' \
     >"${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
 }
+
+package_amd-ucode-early() {
+  description='Early microcode update files for AMD CPUs'
+
+  install -D -m0644 amd-ucode.img "${pkgdir}"/boot/amd-ucode.img  
+}
+
 # vim:set ts=2 sw=2 et:
Ian Li via arch-releng Aug. 24, 2018, 8:34 p.m. UTC | #6
El 23/08/18 a las 06:20, Christian Hesse escribió:
> Christian Hesse <list@eworm.de> on Wed, 2018/08/22 11:24:
>> Gerardo Exequiel Pozzi via arch-releng <arch-releng@archlinux.org> on Sat,
>> 2018/08/18 23:29:
>>> +# Prepare amd_ucode
>>> +make_amd_ucode_img() {
>>> +    mkdir -p ${work_dir}/amd-ucode/kernel/x86/microcode
>>> +    cat
>>> ${work_dir}/x86_64/airootfs/lib/firmware/amd-ucode/microcode_amd*.bin >
>>> ${work_dir}/amd-ucode/kernel/x86/microcode/AuthenticAMD.bin
>>> +    pushd ${work_dir}/amd-ucode > /dev/null
>>> +    echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R
>>> 0:0  
>>>> amd-ucode.img  
>>> +    popd > /dev/null
>>> +    cp ${work_dir}/amd-ucode/amd-ucode.img
>>> ${work_dir}/x86_64/airootfs/boot/amd-ucode.img +}  
>>
>> Wondering if we should put this into a package... Could be a split package
>> of linux-firmware. Any opinion on this?
> 
> [ Added Laurent to CC as he maintains the linux-firmware package. ]
> 
> I've attached a proposal patch to add a split package amd-ucode-early to
> linux-firmware. Any objections? Is the name ok or do we prefer just
> 'amd-ucode'?

amd-ucode is right (like intel-ucode)
missing LICENSE file [#1]

> 
> And another note... Did anybody test if microcode is updated properly if both,
> intel-ucode.img and amd-ucode, are loaded?
> 

At least one feedback from intel user [#2], fw is loaded fine.

Thanks.


[#1] https://bugs.archlinux.org/task/59796
[#2] https://bugs.archlinux.org/task/59694#comment172278
Christian Hesse Aug. 24, 2018, 9:10 p.m. UTC | #7
Gerardo Exequiel Pozzi via arch-releng <arch-releng@archlinux.org> on Fri,
2018/08/24 17:34:
> > And another note... Did anybody test if microcode is updated properly if
> > both, intel-ucode.img and amd-ucode, are loaded?
> >   
> 
> At least one feedback from intel user [#2], fw is loaded fine.

Well, intel ucode is loaded first, so that result is kind of expected.
Feedback from an amd user would be welcome.
Bryan L. Gay Aug. 25, 2018, 2:13 a.m. UTC | #8
I'd like to think I could do some verification since I'm on AMD... I'm new
here, so help me along if there's something I've missed.

I enabled the [testing] repo and installed:
pacman -S testing/linux testing/amd-ucode testing/linux-firmware

pacman -Q linux linux-firmware amd-ucode
linux 4.18.5.arch1-1
linux-firmware 20180821.1d17c18-2
amd-ucode 20180821.1d17c18-2

I did a mkinitcpio -p linux just in case, then rebooted.

output of `dmesg | grep -ie code -ie amd` (with obvious fluff removed):

[    0.000000]   AMD AuthenticAMD
[    0.000000] random: get_random_u32 called from bsp_init_amd+0x1f9/0x290
with crng_init=0
[    0.000000] ACPI: SSDT 0x00000000BFDDFB10 001714 (v01 AMD    POWERNOW
00000001 AMD  00000001)
[    0.000000] ACPI: IVRS 0x00000000BFDE12A0 0000E8 (v01 AMD    RD890S
 00202031 AMD  00000000)
[    0.025991] Spectre V2 : Mitigation: Full AMD retpoline
[    0.036666] smpboot: CPU0: AMD FX(tm)-8120 Eight-Core Processor (family:
0x15, model: 0x1, stepping: 0x2)
[    0.053345] Performance Events: Fam15h core perfctr, AMD PMU driver.
[    1.950177] amd_uncore: AMD NB counters detected
[    1.950462] perf: AMD IBS detected (0x000000ff)
[    2.018364] microcode: CPU0: patch_level=0x0600063d
[    2.018371] microcode: CPU1: patch_level=0x0600063d
[    2.018379] microcode: CPU2: patch_level=0x0600063d
[    2.018388] microcode: CPU3: patch_level=0x0600063d
[    2.018396] microcode: CPU4: patch_level=0x0600063d
[    2.018403] microcode: CPU5: patch_level=0x0600063d
[    2.018410] microcode: CPU6: patch_level=0x0600063d
[    2.018418] microcode: CPU7: patch_level=0x0600063d
[    2.018457] microcode: Microcode Update Driver: v2.2.
[    2.375803] QUIRK: Enable AMD PLL fix
[    2.375865] ehci-pci 0000:00:12.2: applying AMD SB700/SB800/Hudson-2/3
EHCI dummy qh workaround
[    2.391345] ehci-pci 0000:00:13.2: applying AMD SB700/SB800/Hudson-2/3
EHCI dummy qh workaround
[    2.404862] ehci-pci 0000:00:16.2: applying AMD SB700/SB800/Hudson-2/3
EHCI dummy qh workaround
[    5.980964] microcode: CPU1: new patch_level=0x0600063e
[    5.992588] microcode: CPU4: new patch_level=0x0600063e
[    6.013367] microcode: CPU2: new patch_level=0x0600063e
[    6.034148] microcode: CPU6: new patch_level=0x0600063e
[    6.034221] x86/CPU: CPU features have changed after loading microcode,
but might not take effect.

Those microcode: lines at the end total 4, while I have an 8-core AMD
FX-8120 - and the CPU numbers are usually different at each boot.

Is there anything else I can do to assist?

On Fri, Aug 24, 2018 at 5:10 PM Christian Hesse <list@eworm.de> wrote:

> Gerardo Exequiel Pozzi via arch-releng <arch-releng@archlinux.org> on Fri,
> 2018/08/24 17:34:
> > > And another note... Did anybody test if microcode is updated properly
> if
> > > both, intel-ucode.img and amd-ucode, are loaded?
> > >
> >
> > At least one feedback from intel user [#2], fw is loaded fine.
>
> Well, intel ucode is loaded first, so that result is kind of expected.
> Feedback from an amd user would be welcome.
> --
> main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
> "CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
> putchar(b-1/(/*    Chris            cc -ox -xc - && ./x
> */b/42*2-3)*42);}
>
Bryan L. Gay Aug. 25, 2018, 2:24 a.m. UTC | #9
Well, fudge.

I see now that I needed to update GRUB so that it would put the microcode
in the kernel boot config:

grub-mkconfig -o /boot/grub/grub.cfg

To now see:
initrd  /intel-ucode.img /amd-ucode.img /initramfs-linux.img

in the grub.cfg

Without this manual step, simply installing the amd-ucode doesn't take
effect. Duh.

Interesting part of dmesg output is now:

[    2.055382] microcode: microcode updated early to new
patch_level=0x0600063e
[    2.055412] microcode: CPU0: patch_level=0x0600063e
[    2.055420] microcode: CPU1: patch_level=0x0600063e
[    2.055428] microcode: CPU2: patch_level=0x0600063e
[    2.055435] microcode: CPU3: patch_level=0x0600063e
[    2.055443] microcode: CPU4: patch_level=0x0600063e
[    2.055451] microcode: CPU5: patch_level=0x0600063e
[    2.055456] microcode: CPU6: patch_level=0x0600063e
[    2.055462] microcode: CPU7: patch_level=0x0600063e
[    2.055503] microcode: Microcode Update Driver: v2.2.
[    2.422079] QUIRK: Enable AMD PLL fix

So, I guess that answers the question sought after.


On Fri, Aug 24, 2018 at 10:13 PM Bryan L. Gay <archlinux@bryangay.com>
wrote:

> I'd like to think I could do some verification since I'm on AMD... I'm new
> here, so help me along if there's something I've missed.
>
> I enabled the [testing] repo and installed:
> pacman -S testing/linux testing/amd-ucode testing/linux-firmware
>
> pacman -Q linux linux-firmware amd-ucode
> linux 4.18.5.arch1-1
> linux-firmware 20180821.1d17c18-2
> amd-ucode 20180821.1d17c18-2
>
> I did a mkinitcpio -p linux just in case, then rebooted.
>
> output of `dmesg | grep -ie code -ie amd` (with obvious fluff removed):
>
> [    0.000000]   AMD AuthenticAMD
> [    0.000000] random: get_random_u32 called from bsp_init_amd+0x1f9/0x290
> with crng_init=0
> [    0.000000] ACPI: SSDT 0x00000000BFDDFB10 001714 (v01 AMD    POWERNOW
> 00000001 AMD  00000001)
> [    0.000000] ACPI: IVRS 0x00000000BFDE12A0 0000E8 (v01 AMD    RD890S
>  00202031 AMD  00000000)
> [    0.025991] Spectre V2 : Mitigation: Full AMD retpoline
> [    0.036666] smpboot: CPU0: AMD FX(tm)-8120 Eight-Core Processor
> (family: 0x15, model: 0x1, stepping: 0x2)
> [    0.053345] Performance Events: Fam15h core perfctr, AMD PMU driver.
> [    1.950177] amd_uncore: AMD NB counters detected
> [    1.950462] perf: AMD IBS detected (0x000000ff)
> [    2.018364] microcode: CPU0: patch_level=0x0600063d
> [    2.018371] microcode: CPU1: patch_level=0x0600063d
> [    2.018379] microcode: CPU2: patch_level=0x0600063d
> [    2.018388] microcode: CPU3: patch_level=0x0600063d
> [    2.018396] microcode: CPU4: patch_level=0x0600063d
> [    2.018403] microcode: CPU5: patch_level=0x0600063d
> [    2.018410] microcode: CPU6: patch_level=0x0600063d
> [    2.018418] microcode: CPU7: patch_level=0x0600063d
> [    2.018457] microcode: Microcode Update Driver: v2.2.
> [    2.375803] QUIRK: Enable AMD PLL fix
> [    2.375865] ehci-pci 0000:00:12.2: applying AMD SB700/SB800/Hudson-2/3
> EHCI dummy qh workaround
> [    2.391345] ehci-pci 0000:00:13.2: applying AMD SB700/SB800/Hudson-2/3
> EHCI dummy qh workaround
> [    2.404862] ehci-pci 0000:00:16.2: applying AMD SB700/SB800/Hudson-2/3
> EHCI dummy qh workaround
> [    5.980964] microcode: CPU1: new patch_level=0x0600063e
> [    5.992588] microcode: CPU4: new patch_level=0x0600063e
> [    6.013367] microcode: CPU2: new patch_level=0x0600063e
> [    6.034148] microcode: CPU6: new patch_level=0x0600063e
> [    6.034221] x86/CPU: CPU features have changed after loading microcode,
> but might not take effect.
>
> Those microcode: lines at the end total 4, while I have an 8-core AMD
> FX-8120 - and the CPU numbers are usually different at each boot.
>
> Is there anything else I can do to assist?
>
> On Fri, Aug 24, 2018 at 5:10 PM Christian Hesse <list@eworm.de> wrote:
>
>> Gerardo Exequiel Pozzi via arch-releng <arch-releng@archlinux.org> on
>> Fri,
>> 2018/08/24 17:34:
>> > > And another note... Did anybody test if microcode is updated properly
>> if
>> > > both, intel-ucode.img and amd-ucode, are loaded?
>> > >
>> >
>> > At least one feedback from intel user [#2], fw is loaded fine.
>>
>> Well, intel ucode is loaded first, so that result is kind of expected.
>> Feedback from an amd user would be welcome.
>> --
>> main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
>> "CX:;",b;for(a/*    Best regards             my address:
>> */=0;b=c[a++];)
>> putchar(b-1/(/*    Chris            cc -ox -xc - && ./x
>> */b/42*2-3)*42);}
>>
>
Christian Hesse Aug. 25, 2018, 8:42 a.m. UTC | #10
"Bryan L. Gay" <archlinux@bryangay.com> on Fri, 2018/08/24 22:24:
> Well, fudge.
> 
> I see now that I needed to update GRUB so that it would put the microcode
> in the kernel boot config:
> 
> grub-mkconfig -o /boot/grub/grub.cfg
> 
> To now see:
> initrd  /intel-ucode.img /amd-ucode.img /initramfs-linux.img
> 
> in the grub.cfg
> 
> Without this manual step, simply installing the amd-ucode doesn't take
> effect. Duh.
> 
> Interesting part of dmesg output is now:
> 
> [    2.055382] microcode: microcode updated early to new
> patch_level=0x0600063e
> [    2.055412] microcode: CPU0: patch_level=0x0600063e
> [    2.055420] microcode: CPU1: patch_level=0x0600063e
> [    2.055428] microcode: CPU2: patch_level=0x0600063e
> [    2.055435] microcode: CPU3: patch_level=0x0600063e
> [    2.055443] microcode: CPU4: patch_level=0x0600063e
> [    2.055451] microcode: CPU5: patch_level=0x0600063e
> [    2.055456] microcode: CPU6: patch_level=0x0600063e
> [    2.055462] microcode: CPU7: patch_level=0x0600063e
> [    2.055503] microcode: Microcode Update Driver: v2.2.
> [    2.422079] QUIRK: Enable AMD PLL fix
> 
> So, I guess that answers the question sought after.

That looks good. Thanks a lot for testing!

Patch
diff mbox

diff --git a/configs/releng/build.sh b/configs/releng/build.sh
index f5524e8..3272cd8 100755
--- a/configs/releng/build.sh
+++ b/configs/releng/build.sh
@@ -107,6 +107,16 @@  make_customize_airootfs() {
     rm ${work_dir}/x86_64/airootfs/root/customize_airootfs.sh
 }
 
+# Prepare amd_ucode
+make_amd_ucode_img() {
+    mkdir -p ${work_dir}/amd-ucode/kernel/x86/microcode
+    cat ${work_dir}/x86_64/airootfs/lib/firmware/amd-ucode/microcode_amd*.bin > ${work_dir}/amd-ucode/kernel/x86/microcode/AuthenticAMD.bin
+    pushd ${work_dir}/amd-ucode > /dev/null
+    echo kernel/x86/microcode/AuthenticAMD.bin | bsdcpio -o -H newc -R 0:0 > amd-ucode.img
+    popd > /dev/null
+    cp ${work_dir}/amd-ucode/amd-ucode.img ${work_dir}/x86_64/airootfs/boot/amd-ucode.img
+}
+
 # Prepare kernel/initramfs ${install_dir}/boot/
 make_boot() {
     mkdir -p ${work_dir}/iso/${install_dir}/boot/x86_64
@@ -120,6 +130,8 @@  make_boot_extra() {
     cp ${work_dir}/x86_64/airootfs/usr/share/licenses/common/GPL2/license.txt ${work_dir}/iso/${install_dir}/boot/memtest.COPYING
     cp ${work_dir}/x86_64/airootfs/boot/intel-ucode.img ${work_dir}/iso/${install_dir}/boot/intel_ucode.img
     cp ${work_dir}/x86_64/airootfs/usr/share/licenses/intel-ucode/LICENSE ${work_dir}/iso/${install_dir}/boot/intel_ucode.LICENSE
+    cp ${work_dir}/x86_64/airootfs/boot/amd-ucode.img ${work_dir}/iso/${install_dir}/boot/amd_ucode.img
+    cp ${work_dir}/x86_64/airootfs/usr/share/licenses/linux-firmware/LICENSE.amd-ucode ${work_dir}/iso/${install_dir}/boot/amd_ucode.LICENSE
 }
 
 # Prepare /${install_dir}/boot/syslinux
@@ -185,6 +197,7 @@  make_efiboot() {
     cp ${work_dir}/iso/${install_dir}/boot/x86_64/archiso.img ${work_dir}/efiboot/EFI/archiso/archiso.img
 
     cp ${work_dir}/iso/${install_dir}/boot/intel_ucode.img ${work_dir}/efiboot/EFI/archiso/intel_ucode.img
+    cp ${work_dir}/iso/${install_dir}/boot/amd_ucode.img ${work_dir}/efiboot/EFI/archiso/amd_ucode.img
 
     mkdir -p ${work_dir}/efiboot/EFI/boot
     cp ${work_dir}/x86_64/airootfs/usr/share/efitools/efi/PreLoader.efi ${work_dir}/efiboot/EFI/boot/bootx64.efi
@@ -253,6 +266,7 @@  run_once make_basefs
 run_once make_packages
 run_once make_setup_mkinitcpio
 run_once make_customize_airootfs
+run_once make_amd_ucode_img
 run_once make_boot
 run_once make_boot_extra
 run_once make_syslinux
diff --git a/configs/releng/efiboot/loader/entries/archiso-x86_64-cd.conf b/configs/releng/efiboot/loader/entries/archiso-x86_64-cd.conf
index d503f11..b77ed98 100644
--- a/configs/releng/efiboot/loader/entries/archiso-x86_64-cd.conf
+++ b/configs/releng/efiboot/loader/entries/archiso-x86_64-cd.conf
@@ -1,5 +1,6 @@ 
 title   Arch Linux archiso x86_64 UEFI CD
 linux   /EFI/archiso/vmlinuz.efi
 initrd  /EFI/archiso/intel_ucode.img
+initrd  /EFI/archiso/amd_ucode.img
 initrd  /EFI/archiso/archiso.img
 options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL%
diff --git a/configs/releng/efiboot/loader/entries/archiso-x86_64-usb.conf b/configs/releng/efiboot/loader/entries/archiso-x86_64-usb.conf
index 14f3d02..09adca4 100644
--- a/configs/releng/efiboot/loader/entries/archiso-x86_64-usb.conf
+++ b/configs/releng/efiboot/loader/entries/archiso-x86_64-usb.conf
@@ -1,5 +1,6 @@ 
 title   Arch Linux archiso x86_64 UEFI USB
 linux   /%INSTALL_DIR%/boot/x86_64/vmlinuz
 initrd  /%INSTALL_DIR%/boot/intel_ucode.img
+initrd  /%INSTALL_DIR%/boot/amd_ucode.img
 initrd  /%INSTALL_DIR%/boot/x86_64/archiso.img
 options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL%
diff --git a/configs/releng/syslinux/archiso_pxe.cfg b/configs/releng/syslinux/archiso_pxe.cfg
index 481371a..92af749 100644
--- a/configs/releng/syslinux/archiso_pxe.cfg
+++ b/configs/releng/syslinux/archiso_pxe.cfg
@@ -7,7 +7,7 @@  It allows you to install Arch Linux or perform system maintenance.
 ENDTEXT
 MENU LABEL Boot Arch Linux (x86_64) (NBD)
 LINUX boot/x86_64/vmlinuz
-INITRD boot/intel_ucode.img,boot/x86_64/archiso.img
+INITRD boot/intel_ucode.img,boot/amd_ucode.img,boot/x86_64/archiso.img
 APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% archiso_nbd_srv=${pxeserver}
 SYSAPPEND 3
 
@@ -18,7 +18,7 @@  It allows you to install Arch Linux or perform system maintenance.
 ENDTEXT
 MENU LABEL Boot Arch Linux (x86_64) (NFS)
 LINUX boot/x86_64/vmlinuz
-INITRD boot/intel_ucode.img,boot/x86_64/archiso.img
+INITRD boot/intel_ucode.img,boot/amd_ucode.img,boot/x86_64/archiso.img
 APPEND archisobasedir=%INSTALL_DIR% archiso_nfs_srv=${pxeserver}:/run/archiso/bootmnt
 SYSAPPEND 3
 
@@ -29,7 +29,7 @@  It allows you to install Arch Linux or perform system maintenance.
 ENDTEXT
 MENU LABEL Boot Arch Linux (x86_64) (HTTP)
 LINUX boot/x86_64/vmlinuz
-INITRD boot/intel_ucode.img,boot/x86_64/archiso.img
+INITRD boot/intel_ucode.img,boot/amd_ucode.img,boot/x86_64/archiso.img
 APPEND archisobasedir=%INSTALL_DIR% archiso_http_srv=http://${pxeserver}/
 SYSAPPEND 3
 
diff --git a/configs/releng/syslinux/archiso_sys.cfg b/configs/releng/syslinux/archiso_sys.cfg
index 0c82573..a35a1ea 100644
--- a/configs/releng/syslinux/archiso_sys.cfg
+++ b/configs/releng/syslinux/archiso_sys.cfg
@@ -7,7 +7,7 @@  It allows you to install Arch Linux or perform system maintenance.
 ENDTEXT
 MENU LABEL Boot Arch Linux (x86_64)
 LINUX boot/x86_64/vmlinuz
-INITRD boot/intel_ucode.img,boot/x86_64/archiso.img
+INITRD boot/intel_ucode.img,boot/amd_ucode.img,boot/x86_64/archiso.img
 APPEND archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL%
 
 INCLUDE boot/syslinux/archiso_tail.cfg