@@ -237,19 +237,6 @@ static struct patch_with_flags nmi_patch =
.patch = ZERO_BLOCK_PTR,
};
-/*
- * Return a patch that covers current CPU. If there are multiple patches,
- * return the one with the highest revision number. Return error If no
- * patch is found and an error occurs during the parsing process. Otherwise
- * return NULL.
- */
-static struct microcode_patch *parse_blob(const char *buf, size_t len)
-{
- alternative_vcall(ucode_ops.collect_cpu_info);
-
- return alternative_call(ucode_ops.cpu_request_microcode, buf, len, true);
-}
-
static void microcode_free_patch(const struct microcode_patch *patch)
{
xfree((struct microcode_patch *)patch);
@@ -616,7 +603,10 @@ static long cf_check ucode_update_hcall_cont(void *data)
goto put;
}
- patch_with_flags.patch = parse_blob(buffer->buffer, buffer->len);
+ alternative_vcall(ucode_ops.collect_cpu_info);
+ patch_with_flags.patch = alternative_call(ucode_ops.cpu_request_microcode,
+ (const void *)buffer->buffer,
+ buffer->len, true);
patch_with_flags.flags = buffer->flags;
xfree(buffer);
if ( IS_ERR(patch_with_flags.patch) )
@@ -797,7 +787,8 @@ static int __init early_update_cache(const void *data, size_t len)
if ( !data )
return -ENOMEM;
- patch = parse_blob(data, len);
+ alternative_vcall(ucode_ops.collect_cpu_info);
+ patch = alternative_call(ucode_ops.cpu_request_microcode, data, len, true);
if ( IS_ERR(patch) )
{
printk(XENLOG_WARNING "Parsing microcode blob error %ld\n",
This separates the collect_cpu_info() and cpu_request_microcode() calls for later cleanup, and frees up the name to be reused a little differently. No functional change. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> --- CC: Jan Beulich <JBeulich@suse.com> CC: Roger Pau Monné <roger.pau@citrix.com> --- xen/arch/x86/cpu/microcode/core.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-)