Signed-off-by: Andrew Cooper <[email protected]>
---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Teddy Astie <[email protected]>
RFC. The docs update are rather nasy, and will take longer than I have right
now.
---
xen/arch/x86/cpu/microcode/core.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/cpu/microcode/core.c
b/xen/arch/x86/cpu/microcode/core.c
index 55baf7386400..1dbc3749e531 100644
--- 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;
}
base-commit: 18e255253a5a326deff0ade386e36d7965164533
--
2.39.5