On 11.01.2024 11:10, Carlo Nonato wrote:
> On Mon, Jan 8, 2024 at 5:53 PM Jan Beulich <[email protected]> wrote:
>> On 02.01.2024 10:51, Carlo Nonato wrote:
>>> --- a/xen/include/xen/sched.h
>>> +++ b/xen/include/xen/sched.h
>>> @@ -626,6 +626,11 @@ struct domain
>>>
>>> /* Holding CDF_* constant. Internal flags for domain creation. */
>>> unsigned int cdf;
>>> +
>>> +#ifdef CONFIG_LLC_COLORING
>>> + unsigned int *llc_colors;
>>
>> Can the color values change over the lifetime of a domain? If not,
>> it may be prudent to have this be pointer-to-const.
>
> Can I free a pointer-to-const array?
Well, you certainly can by using a cast. Avoiding the need for such call-
site casts is why I've been advocating to make xfree() / vfree() match e.g.
vunmap() / _vfree() in this regard. Yet other opinions are that the const
there ought to be dropped (without me really following the reasoning) ...
There's also the option of circumventing the need for a cast by doing
xfree(__va(__pa(ptr)));
Jan