[LEDE-DEV] [PATCH v2 5/6] x86: add intel microcode entries to grub config
Stijn Segers
foss at volatilesystems.org
Thu Apr 19 15:16:46 PDT 2018
Op do, 19 apr 2018 om 11:47 , schreef Tomasz Maciej Nowak
<tomek_n at o2.pl>:
> W dniu 18.04.2018 o 00:51, Philip Prindeville pisze:
> > Is there a downside to forcing AMD to also do early firmware
> updates?
>
> AFAIK there shouldn't be any for either methods regarding AMD. I made
> also a prototype for AMD, but as there are no downsides for current
> method and I don't have any hardware to test it, it's being left out.
Hi Tomasz,
I have an AMD system I can test on, so if you can provide a 'generic'
patch, I'd be happy to try it.
Cheers
Stijn
>
> >
> >
> >
> >> On Apr 17, 2018, at 12:50 PM, Tomasz Maciej Nowak <tomek_n at o2.pl>
> wrote:
> >>
> >> Create initrd enries for x86 images, that'll load intel microcode
> as
> >> early as possible. Also restrict the late load of microcode to AMD
> >> processors.
> >>
> >> Signed-off-by: Tomasz Maciej Nowak <tomek_n at o2.pl>
> >> ---
> >> target/linux/x86/base-files/lib/preinit/02_load_x86_ucode | 6
> ++++--
> >> target/linux/x86/image/Makefile | 4 ++--
> >> target/linux/x86/image/grub-iso.cfg | 3 +++
> >> target/linux/x86/image/grub.cfg | 3 +++
> >> 4 files changed, 12 insertions(+), 4 deletions(-)
> >>
> >> diff --git
> a/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode
> b/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode
> >> index fb309c75c1..d3a23e24b2 100644
> >> --- a/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode
> >> +++ b/target/linux/x86/base-files/lib/preinit/02_load_x86_ucode
> >> @@ -2,8 +2,10 @@
> >> # Copyright (C) 2018 OpenWrt.org
> >>
> >> do_load_x86_ucode() {
> >> - if [ -e "/sys/devices/system/cpu/microcode/reload" ]; then
> >> - echo 1 > /sys/devices/system/cpu/microcode/reload
> >> + if grep -q AuthenticAMD /proc/cpuinfo; then
> >> + if [ -e "/sys/devices/system/cpu/microcode/reload" ]; then
> >> + echo 1 > /sys/devices/system/cpu/microcode/reload
> >> + fi
> >> fi
> >> }
> >>
> >> diff --git a/target/linux/x86/image/Makefile
> b/target/linux/x86/image/Makefile
> >> index cf1e1a9edf..523c07eb75 100644
> >> --- a/target/linux/x86/image/Makefile
> >> +++ b/target/linux/x86/image/Makefile
> >> @@ -9,8 +9,8 @@ include $(INCLUDE_DIR)/image.mk
> >>
> >> export PATH=$(TARGET_PATH):/sbin
> >>
> >> -GRUB2_MODULES = biosdisk boot chain configfile ext2 linux ls
> part_msdos reboot serial vga
> >> -GRUB2_MODULES_ISO = biosdisk boot chain configfile iso9660 linux
> ls part_msdos reboot serial vga
> >> +GRUB2_MODULES = biosdisk boot chain configfile ext2 linux ls
> part_msdos reboot serial test vga
> >> +GRUB2_MODULES_ISO = biosdisk boot chain configfile iso9660 linux
> ls part_msdos reboot serial test vga
> >> GRUB_TERMINALS =
> >> GRUB_SERIAL_CONFIG =
> >> GRUB_TERMINAL_CONFIG =
> >> diff --git a/target/linux/x86/image/grub-iso.cfg
> b/target/linux/x86/image/grub-iso.cfg
> >> index 3d47a95a4b..30b587bd1c 100644
> >> --- a/target/linux/x86/image/grub-iso.cfg
> >> +++ b/target/linux/x86/image/grub-iso.cfg
> >> @@ -7,4 +7,7 @@ set root='(cd)'
> >>
> >> menuentry "OpenWrt" {
> >> linux /boot/vmlinuz @CMDLINE@ noinitrd
> >> + if [ -e /boot/intel-ucode.img ]; then
> >> + initrd /boot/intel-ucode.img
> >> + fi
> >> }
> >> diff --git a/target/linux/x86/image/grub.cfg
> b/target/linux/x86/image/grub.cfg
> >> index 9ec6b2d39c..dde24b95ce 100644
> >> --- a/target/linux/x86/image/grub.cfg
> >> +++ b/target/linux/x86/image/grub.cfg
> >> @@ -7,6 +7,9 @@ set root='(@ROOT@)'
> >>
> >> menuentry "OpenWrt" {
> >> linux /boot/vmlinuz @CMDLINE@ noinitrd
> >> + if [ -e /boot/intel-ucode.img ]; then
> >> + initrd /boot/intel-ucode.img
> >> + fi
> >> }
> >> menuentry "OpenWrt (failsafe)" {
> >> linux /boot/vmlinuz failsafe=true @CMDLINE@ noinitrd
> >> --
> >> 2.17.0
> >>
> >
> >
> > _______________________________________________
> > Lede-dev mailing list
> > Lede-dev at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/lede-dev
> >
>
> --
> TMN
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
More information about the Lede-dev
mailing list