[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 5/5] xen/arm: do not give memory back to static heap


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Mon, 18 Nov 2024 11:25:45 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=X18TRJjfZG5ogE2E6zEhVsufJfPN/PtToNLWcwY45wE=; b=Y0hOnTG2TOFApIcuDptIC+F8WElGYYCK2/SLgu3l5RA+ccfm+/4Z3IAl3sofCFIA+yOfIHFtjdfJwteY5s1ji53rQ5NVMFwKicJ2dt4OBDiXtINJ0lBD+1dpAvRz1TiGyMv5dpsJCcW2WWqPLv9R49rvZQWCYECGkRjTrIB1IPhuYj0EEKz5GKkaUP2xHuGduYAGPIgk9sKyTmYMXIOgFCBl4rvew8y9FlhgKxWQcUuLYa58RUsurbQwOPUb+7v1U8n9jxLz25kBB4YLFlmtG6P8VCT2p0gNTuGSIL69BZCyv1jSxrBdadMtVtGYzhMKeanGUh7VMF1Ai69nFiN3EQ==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=X18TRJjfZG5ogE2E6zEhVsufJfPN/PtToNLWcwY45wE=; b=LSApPBWvbCqCiZk3nKsS69hjkSLZpSt4oXFgdVfQv6DP50lXudVM+e9Dloq7nHxIci1Gvm1U43KTyKnZU0DryboNHU3lxRmb8bHCJ07xXVLlVTHX/8JAOdS7eW0cskDcybPo7On7otMP0XaxrpNKuAqwKezLxi6rzdWEWeGIXS4AXvknVXSZO83uRbd8JCgfdanTy7ugEKv2P9gJAYAO0RS/ipnQN1WGnOsEu88WNiZV4ZgMRUhcI5NofQtcg/8BOGlTgMKv93WA3xGSl1Cor05TfO5OeGfsVZUZC0lsBs5PPyjj7FVjou8v4Cw4lX00B/wX7slcHm5Tx6/yhNf6XQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=f+BwnxcQdtCl4lKapihpNdXwvx4drIqaQ+tIa3QQ++JJ21cklM9g26ec2xK1OsApPazEHcdY/TTbDmEqJ4hKO1QxODCb39NGpNl9R2CBTjiKiGTsDoGEWq35dPQy3N6KpHg1wSJAUz2kvlUEW1HbIgZNYo+VTMasyfJCsU+cRjDAaswSYcSg4Sr2LFPeSaW6ibb66Jg5bkRtiFXQrixrv0QjMNk3KyNaCaRVmXi1kvJZYZspPomheAE26wmapmIo6TOiyc8SkbP3o+USLsH95oMnf2A8baRG3s0dllALIBqhMBsTtNhh4Su6aaD0kf9Nwq/a2yyE0yr4QLqoe5WGzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ox8KailIkuevCr0joyh7I4vZZXlo7YC6hiO+s/hD7jNu3THL4M1pkh0g4zLv3OGuu3SCrJPDcv7FyvolLzp8ONjT++jsxtJpAQzw+wJGIRMal/f9adUSqp5ob0VQszYS/r7rOeWP/gmSQcZh5YY6+4OCzOsVak+DPT+OnWpwmWL9outsGxglg0bCJq8qyYMPzkqXW6NF917fvwys/msP7yxW93p9GcJfDSOzk+ya2nRVOkw706HBFdTM8MHr30IbiL3aLirAC54AIZ0ORRLwR9HR9I5H11N9efwlmeA6OWploZUXeQAzTFAPuA+lqhd+DeDlY4QmxgCDzWgdFrLe2w==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 18 Nov 2024 11:26:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHbN0xIcV74X7F5t0unnpAIyChkWLK7ylSAgAEgJgA=
  • Thread-topic: [PATCH 5/5] xen/arm: do not give memory back to static heap

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.