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

Re: [PATCH 05/10] x86/ucode: Fold microcode_grab_module() into its single caller


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Tue, 5 Nov 2024 18:40:09 -0500
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730850016; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=YQdMQ7PJtxZ+nEb2TBPI5ITRfGSKvRQZ/r0uTZkytDw=; b=l6MMpVsVw5J02JvH2v+hTOrUDWRNlnpeBlIHZNYTm+ngSEk092YUSIUpxpB0NoFnmBaMMEguvoBWC0E/zZXkif16L3Mmw5JtDWwoz70NdCbskaA3fM1kEnOEcXuZ2ecqcP8TUfT7//vig0v0IFeGd0WnRd/ePH/sc/6QBf1Oyi8=
  • Arc-seal: i=1; a=rsa-sha256; t=1730850016; cv=none; d=zohomail.com; s=zohoarc; b=CNinTLXaLMC9xmeAjBNLD+CcDOqeZ7x4Xyn8BxbT4RY1d9OCkNqNk7uKkEBOXGp7O3VOHz8WhbP2q0lbhF3IHGZVuw7S+fMNJGKXbWJnmkeuL3Fh30vVOAwZebQRJQ21GvV9R7tu+xhRu7V9y6iUeR6J2TX08W0btmijsMvVAeI=
  • Cc: Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 05 Nov 2024 23:40:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 <dpsmith@xxxxxxxxxxxxxxxxxxxx>



 


Rackspace

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