On 11/5/24 18:07, Andrew Cooper wrote:
On 02/11/2024 4:33 pm, Daniel P. Smith wrote:
On 10/28/24 05:18, Andrew Cooper wrote:
@@ -831,7 +818,15 @@ static int __init early_microcode_load(struct
boot_info *bi)
size_t size;
struct microcode_patch *patch;
- microcode_grab_module(bi);
+ if ( ucode_mod_idx < 0 )
+ ucode_mod_idx += bi->nr_modules;
+ if ( ucode_mod_idx <= 0 || ucode_mod_idx >= bi->nr_modules ||
+ !__test_and_clear_bit(ucode_mod_idx, bi->module_map) )
+ goto scan;
+ ucode_mod = *bi->mods[ucode_mod_idx].mod;
+ scan:
+ if ( ucode_scan )
+ microcode_scan_module(bi);
if ( !ucode_mod.mod_end && !ucode_blob.size )
return 0;
Just a suggestion, but would it be useful to add a comment to explain
the three conditions of ucode_mod_idx that are being handled before
scanning is attempted?
The already did that, but it's in the next patch, which also rearranges
this block massively.
I realized that and meant to come back to adjust my response. As such,
Reviewed-by: Daniel P. Smith <[email protected]>