|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v5 04/11] xen/arm: introduce allocate_domheap_memory and guest_physmap_memory
Hi Michal, On 11/12/2023 08:31, Michal Orzel wrote: On 08/12/2023 16:09, Julien Grall wrote:Hi, On 07/12/2023 09:38, Michal Orzel wrote:Hi Penny, On 06/12/2023 10:06, Penny Zheng wrote:We split the code of allocate_bank_memory into two parts, allocate_domheap_memory and guest_physmap_memory. One is about allocating guest RAM from heap, which could be re-used later for allocating static shared memory from heap when host address is not provided. The other is building up guest P2M mapping. We also define a set of MACRO helpers to access common fields in data structure of "meminfo" type, e.g. "struct meminfo" is one of them, and later new "struct shm_meminfo" is also one of them. This kind of structures must have the following characteristics: - an array of "struct membank" - a member called "nr_banks" indicating current array size - a field indicating the maximum array size When introducing a new data structure, according callbacks with function type "retrieve_fn" shall be defined for using MACRO helpers. This commit defines callback "retrieve_meminfo" for data structure "struct meminfo".This patch introduces quite a bit of complexity with all these helpers, so adding a rationale is crucial. AFAIU, all of this is because we don't want to reuse struct meminfo where NR_MEM_BANKS is defined as 256, which is a lot more than we need for shmem. Am I right?+1.I would like others to share the opinion here as well. Possibly yes. But it is not clear what's the problem here. Are you concerned about the churn? Or is it just a long name? At least in the case of meminfo. We could possibly replace all the use with a pointer to "struct membank common". This would reduce the amount of churn and the expression length. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |