[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] x86/boot: Load microcode much earlier on boot



commit 365f408339d33c394ce669fe9d64f7af1599d916
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Tue Nov 19 21:40:58 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Nov 21 20:12:47 2024 +0000

    x86/boot: Load microcode much earlier on boot
    
    Following commit cd7cc5320bb2 ("x86/boot: add start and size fields to 
struct
    boot_module"), bootstrap_map*() works as soon as boot_info is populated.
    
    Resolve the TODO, and move microcode loading to be the eariest action after
    establishing a console.
    
    A sample boot now looks like:
    
      (XEN) Xen version 4.20-unstable (andrew@xxxxxxxxxxxxxxx) (gcc (Debian 
12.2.0-14) 12.2.0) debug=y Tue Nov 19 21:44:46 GMT 2024
      (XEN) Latest ChangeSet: Wed Dec 6 21:54:55 2023 git:1ab612848a23
      (XEN) build-id: 52fe616d1b3a2a2cb44775815507d02cca73315d
      (XEN) CPU Vendor: AMD, Family 25 (0x19), Model 1 (0x1), Stepping 1 (raw 
00a00f11)
      (XEN) BSP microcode revision: 0x0a001137
      (XEN) microcode: CPU0 updated from revision 0xa001137 to 0xa0011d5, date 
= 2024-02-23
      (XEN) Bootloader: GRUB 2.06
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/setup.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 1239e91b83..d8661d7ca6 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1160,6 +1160,13 @@ void asmlinkage __init noreturn __start_xen(void)
     xhci_dbc_uart_init();
     console_init_preirq();
 
+    /*
+     * Try to load microcode as early as possible, although wait until after
+     * configuring the console(s).
+     */
+    early_cpu_init(true);
+    early_microcode_init(bi);
+
     if ( pvh_boot )
         pvh_print_info();
 
@@ -1312,9 +1319,6 @@ void asmlinkage __init noreturn __start_xen(void)
     else
         panic("Bootloader provided no memory information\n");
 
-    /* This must come before e820 code because it sets paddr_bits. */
-    early_cpu_init(true);
-
     /* Choose shadow stack early, to set infrastructure up appropriately. */
     if ( !boot_cpu_has(X86_FEATURE_CET_SS) )
         opt_xen_shstk = 0;
@@ -1416,12 +1420,6 @@ void asmlinkage __init noreturn __start_xen(void)
         if ( bi->mods[i].start & (PAGE_SIZE - 1) )
             panic("Bootloader didn't honor module alignment request\n");
 
-    /*
-     * TODO: load ucode earlier once multiboot modules become accessible
-     * at an earlier stage.
-     */
-    early_microcode_init(bi);
-
     if ( xen_phys_start )
     {
         struct boot_module *xen = &bi->mods[bi->nr_modules];
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.