[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] arm/domain_build: Make find_unallocated_memory() more generic
Hi Julien, On 11/12/2024 18:39, Julien Grall wrote: > > > Hi Michal, > > On 10/12/2024 10:10, Michal Orzel wrote: >> At the moment, find_unallocated_memory() is only used to retrieve free >> memory ranges for direct mapped domains in order to find extended >> regions. It is not generic as it makes assumptions as for the place at >> which it's being called (domain memory already allocated, gnttab region >> already found) and hardcodes the memory banks to be excluded. >> >> Make the function more generic, so that it can be used for other >> purposes whenever there is a need to find free host memory regions (e.g. >> upcoming LLC coloring series). Allow passing array with memory banks as a >> parameter together with a callback to populate free regions structure, >> as the logic may differ depending on the needs. >> >> Add find_host_extended_regions() to be called from make_hypervisor_node() >> to contain the logic to find extended regions for domains using host >> memory layout that are not permitted to use IOMMU. >> >> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx> > > With one remark below: > > Acked-by: Julien Grall <jgrall@xxxxxxxxxx> > >> --- >> This is a prerequisite patch for LLC coloring series patch 3. >> For dom0 LLC coloring, we just need to pass resmem and gnttab in mem_banks. >> --- >> xen/arch/arm/domain_build.c | 97 +++++++++++++++++++++---------------- >> 1 file changed, 55 insertions(+), 42 deletions(-) >> >> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c >> index 2c30792de88b..500005079b88 100644 >> --- a/xen/arch/arm/domain_build.c >> +++ b/xen/arch/arm/domain_build.c >> @@ -901,31 +901,26 @@ int __init add_ext_regions(unsigned long s_gfn, >> unsigned long e_gfn, >> } >> >> /* >> - * Find unused regions of Host address space which can be exposed to Dom0 >> - * as extended regions for the special memory mappings. In order to >> calculate >> - * regions we exclude every region assigned to Dom0 from the Host RAM: >> - * - domain RAM >> - * - reserved-memory >> - * - static shared memory >> - * - grant table space >> + * Find unused regions of Host address space which can be exposed to domain >> + * using the host memory layout (i.e. direct mapped or hardware domain). In > > NIT: I would use "e.g." rather than "i.e." because in the future we may > want to expose the host layout to a guest without necessarily having IPA > == PA. You could also drop the part in () because one could find the > definition on top of domain_use_host_layout(). I removed () on commit. Thanks. ~Michal
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |