On 28/10/2024 4:04 pm, Jan Beulich wrote:
> 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.

No; it's only one of 2 reasons.

>  Internally it
> copies the parameter to a const char * variable, so the non-const param
> is bogus.

... and then back into a non-const variable, hence why such a change
doesn't work.

>  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]>

Only after this series has make const-ness consistent through this
logic, can you go about changing CPIO.

~Andrew

Reply via email to