x86/ucode: Support discrete modules being CPIO archives

Multiple downstream distros have tried passing discrete CPIO archives and
tripped over this not working.  It turns out to be easy to support, so do so.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Teddy Astie <teddy.astie@vates.tech>
[jb: doc change dropped as inapplicable to the older form]
master commit: 878a9cfa45
master date: 2026-03-03 15:15:53 +0000
This commit is contained in:
Andrew Cooper authored and Jan Beulich committed 2026-03-10 14:37:00 +01:00
1 parent 805e2b8ada
commit 8f3b637591
2 files changed
+25 -1

No files matched your search

+6
View File
@@ -4,6 +4,12 @@ Notable changes to Xen will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [4.21.1](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.21.1)
### Added
- On x86:
- Support for CPIO microcode in discrete multiboot modules.
## [4.21.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.21.0) - 2025-11-19 ## [4.21.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.21.0) - 2025-11-19
### Changed ### Changed
+19 -1
View File
@@ -749,6 +749,7 @@ static int __init early_microcode_load(struct boot_info *bi)
void *data = NULL; void *data = NULL;
size_t size; size_t size;
struct microcode_patch *patch; struct microcode_patch *patch;
struct cpio_data cd;
int idx = opt_mod_idx; int idx = opt_mod_idx;
int rc; int rc;
@@ -765,7 +766,6 @@ static int __init early_microcode_load(struct boot_info *bi)
for ( idx = 0; idx < bi->nr_modules; ++idx ) for ( idx = 0; idx < bi->nr_modules; ++idx )
{ {
const struct boot_module *bm = &bi->mods[idx]; const struct boot_module *bm = &bi->mods[idx];
struct cpio_data cd;
/* Search anything unclaimed or likely to be a CPIO archive. */ /* Search anything unclaimed or likely to be a CPIO archive. */
if ( bm->kind != BOOTMOD_UNKNOWN && bm->kind != BOOTMOD_RAMDISK ) if ( bm->kind != BOOTMOD_UNKNOWN && bm->kind != BOOTMOD_RAMDISK )
@@ -833,6 +833,24 @@ static int __init early_microcode_load(struct boot_info *bi)
idx, size); idx, size);
return -ENODEV; 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;
/*
* (Ab)use opt_scan to inform microcode_init_cache() that
* early_mod_idx refers to a CPIO archive.
*/
opt_scan = true;
}
goto found; goto found;
} }
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.