On 28.10.2024 10:18, Andrew Cooper wrote:
> @@ -789,23 +734,47 @@ static int __init early_update_cache(const void *data,
> size_t len)
> return rc;
> }
>
> +/*
> + * Set by early_microcode_load() to indicate where it found microcode, so
> + * microcode_init_cache() can find it again and initalise the cache.
> opt_scan
> + * tells us whether we're looking for a raw container or CPIO archive.
> + */
> +static int __initdata early_mod_idx = -1;
> +
> static int __init cf_check microcode_init_cache(void)
> {
> struct boot_info *bi = &xen_boot_info;
> + void *data;
Afaics the sole reason this isn't const void * and ...
> @@ -819,7 +788,7 @@ presmp_initcall(microcode_init_cache);
> */
> static int __init early_microcode_load(struct boot_info *bi)
> {
> - const void *data = NULL;
> + void *data = NULL;
... you're actively dropping const here (which I consider bad) is
find_cpio_data() wrongly taking void * as 2nd parameter. Internally it
copies the parameter to a const char * variable, so the non-const param
is bogus. With the const here retained and const added further up (on
top of a trivial prereq patch adjusting find_cpio_data(), which I've
just sent out):
Acked-by: Jan Beulich <[email protected]>
Jan