Hi Julien,

>> -    fw_unreserved_regions(addr, addr + size, init_domheap_pages, 0);
>> +    if ( !xen_is_using_staticheap() )
> 
> The comment on top needs to be updated.

I’ll update, is this ok:

/*
 * In case Xen is not using the static heap feature, free the original
 * kernel, update the pointers to the decompressed kernel
 */

>> 
>> diff --git a/xen/common/device-tree/device-tree.c 
>> b/xen/common/device-tree/device-tree.c
>> index d0528c582565..22b69c49171b 100644
>> --- a/xen/common/device-tree/device-tree.c
>> +++ b/xen/common/device-tree/device-tree.c
>> @@ -25,6 +25,9 @@
>>  #include <asm/setup.h>
>>  #include <xen/err.h>
>>  +/* Flag saved when Xen is using the static heap feature (xen,static-heap) 
>> */
>> +bool __read_mostly static_heap;
> 
> Strictly speaking, static_heap could be used with ACPI (even though there is 
> not binding today). So I think it should not belong to device-tree.c. I think 
> page_alloc.c may be more suitable. Also, I think static_heap will not be 
> touched after init. So this likely wants to be __ro_after_init.

Sure, I’ll do the modifications and I’ll move to common/page_alloc.c

> 
> Lastly, shouldn't this be protected by #ifdef? Otherwise...

Could you clarify if I understood correctly?

If I protect static_heap with CONFIG_STATIC_MEMORY, then I have to protect also 
the code in 
https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/common/device-tree/bootfdt.c;h=927f59c64b0d64842e2a0fd09562ac919c204e6e;hb=refs/heads/staging#l393,
is this what you are expecting?

And in that case, should it be only to protect the access to the variable or 
the all block? For example now if CONFIG_STATIC_MEMORY is not set, I think we 
parse anyway the xen,static-mem, so this tends me to think I should protect 
only the variable.

Cheers,
Luca

Reply via email to