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

Re: [PATCH] x86/ucode: Support discrete modules being CPIO archives


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 27 Jan 2026 16:08:09 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AIFjJ0+wSlEkcmh3lwvhi0bhBMLVdMgxBU+zPBmoIFo=; b=STjvprOuJMQTkCeKzcO5bUVxJrP+CdsQscjYXRtH+088B6G5VTufLlLgedH/ohORThBnhhkAjIqTyvX8EUQr2x6MHmjggx1eLIuc2GbOIyA6Qio9Gknvy3bwOuA7hYV26CsJ/miIlp3pgGjWlH0aGB0eblg7f8GnzVI5qTQkxA+ApJg+3RIcp/o35S4swksy4agfn3vWk+nWdHO4K5L67IH1Il9WRHG3WVFI4IjZ0Gs+2V3+idMD3SjifD8loiUGa4GWrqS9LNeWbUOiozPqbBj0rmAUC0TtzvIRX85DWr5jMSNi19PXM024Z/02mVXUtr7gmZER6cgdIOWfxTJP8Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ph3wXWf/Km5JyW4B9l2zB5nCk9yMMAA7kHh9VlTZZO3xLT0wa0AM/JrF+qI3aGW3t36w8ldPAR738w5Hk9N1eF6xvViNQy2JazJs+xEMPLzDgpR7coqWvmbrRvwX3dauBkV5L+vxO7zINLb/Ssb2dpqxkvim76LHS/e55FDX29xHLBJDSKPrxsc64BcHDtSgRgGbEnLeNIqhJTabZfa9tDJWwbn+11kkkjAPqvqhE/SxeVSOZTu6fQz5ZrXSm5tLVIhsIkPfTFllEc5P66lCJrrGgpBcFJ++GkdSUqlFQ+hgnI+z7auLdyifs9U/+s3UkyUOfugMba8bpdldnIhSag==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 27 Jan 2026 16:08:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27/01/2026 4:00 pm, Jan Beulich wrote:
> On 27.01.2026 15:34, Andrew Cooper wrote:
>> --- a/xen/arch/x86/cpu/microcode/core.c
>> +++ b/xen/arch/x86/cpu/microcode/core.c
>> @@ -760,6 +760,7 @@ static int __init early_microcode_load(struct boot_info 
>> *bi)
>>      void *data = NULL;
>>      size_t size;
>>      struct microcode_patch *patch;
>> +    struct cpio_data cd;
>>      int idx = opt_mod_idx;
>>      int rc;
>>  
>> @@ -776,7 +777,6 @@ static int __init early_microcode_load(struct boot_info 
>> *bi)
>>          for ( idx = 0; idx < bi->nr_modules; ++idx )
>>          {
>>              const struct boot_module *bm = &bi->mods[idx];
>> -            struct cpio_data cd;
>>  
>>              /* Search anything unclaimed or likely to be a CPIO archive. */
>>              if ( bm->kind != BOOTMOD_UNKNOWN && bm->kind != BOOTMOD_RAMDISK 
>> )
>> @@ -844,6 +844,18 @@ static int __init early_microcode_load(struct boot_info 
>> *bi)
>>                     idx, size);
>>              return -ENODEV;
>>          }
>> +
>> +        /*
>> +         * If this blob appears to be a CPIO archive, try interpreting it as
>> +         * one.  Otherwise treat it as a raw vendor blob.
>> +         */
>> +        cd = find_cpio_data(ucode_ops.cpio_path, data, size);
>> +        if ( cd.data )
>> +        {
>> +            data = cd.data;
>> +            size = cd.size;
>> +        }
>> +
>>          goto found;
>>      }
> Doesn't microcode_init_cache() then need similar adjustment?

Hmm, yes, but we can actually do that by setting opt_scan=1 here and no
other change.

microcode_init_cache() already has the explicit index to look at, so
opt_scan really becomes an "is cpio" flag.

~Andrew



 


Rackspace

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