[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v5 19/44] x86/boot: use consumed boot module flag for microcode
On 2024-10-06 17:49, Daniel P. Smith wrote: To track if the microcode boot module was loaded, a copy of the boot module is kept. The size element of this copy is set to zero as the indicator that the microcode was loaded. A side effect is that the modules have to be rescanned to find the boot module post-relocation, so the cache copy can be created. Use the consumed boot module flag to track the loading of the microcode boot module. This removes the need to manipulate the boot module size element, no longer requiring the copy, thus allowing it to be replaced by a reference. As a result it is no longer necessary to rescan the boot modules after relocation has occurred. Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx> --- xen/arch/x86/cpu/microcode/core.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c index 7bcc17e0ab2f..5b42aad2fdd0 100644 --- a/xen/arch/x86/cpu/microcode/core.c +++ b/xen/arch/x86/cpu/microcode/core.c @@ -826,14 +826,14 @@ int __init microcode_init_cache( if ( !ucode_ops.apply_microcode ) return -ENODEV;- if ( ucode_scan )- /* Need to rescan the modules because they might have been relocated */ + /* Scan if microcode was not detected earlier */ + if ( !ucode_mod ) ucode_scan is a user-controlled variable (ucode=scan=$bool), so I think it still needs to be respected. microcode_scan_module(module_map, bi);- if ( ucode_mod.size )- rc = early_update_cache(bootstrap_map_bm(&ucode_mod), - ucode_mod.size); - else if ( ucode_blob.size ) + if ( ucode_mod && !(ucode_mod->flags & BOOTMOD_FLAG_X86_CONSUMED) ) + rc = early_update_cache(bootstrap_map_bm(ucode_mod), + ucode_mod->size); + else if ( ucode_mod && ucode_blob.size ) ucode_blob seems independent of ucode_mod, so I don't see why this didn't stay `else if ( ucode_blob.size )` rc = early_update_cache(ucode_blob.data, ucode_blob.size);return rc;@@ -851,10 +851,10 @@ static int __init early_microcode_update_cpu(void) Regards, Jason
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |