Hi Julien,

> On Oct 14, 2023, at 01:40, Julien Grall <[email protected]> wrote:
> 
> Hi Henry,
> 
> On 09/10/2023 02:03, Henry Wang wrote:
>> setup_mm() is used for Xen to setup memory management subsystem,
>> such as boot allocator, direct-mapping, xenheap initialization,
>> frametable and static memory pages, at boot time.
>> We could inherit some components seamlessly for MPU support, such
>> as the setup of boot allocator, whilst we need to implement some
>> components differently for MPU, such as xenheap, etc. Also, there
>> are some components that is specific to MMU only, for example the
>> direct-mapping.
>> Therefore in this commit, we split the MMU-specific setup_mm() and
>> related code out. Since arm32 and arm64 have completely different
>> setup_mm() implementation, take the opportunity to split the
>> arch-specific setup_mm() to arch-specific files, so that we can
>> avoid #ifdef. Also, make init_pdx(), init_staticmem_pages(),
>> setup_mm(), and populate_boot_allocator() public for future MPU
>> implementation.
> 
> I am a bit confused with the last sentence. AFAICT, even without the MPU 
> work, I think you already need to export init_pdx() & co because it is called 
> from two different units.

Yeah you are correct, I will reword the sentence to:
"Also, make init_pdx(), init_staticmem_pages(), and populate_boot_allocator() 
public
as these functions are now called from two different units, make setup_mm() 
public
for future MPU implementation."

> 
>> With above code movement, mark setup_directmap_mappings() as static
>> because the only caller of this function is now in the same file
>> with it. Drop the original setup_directmap_mappings() declaration
>> and move the in-code comment on top of the declaration on top of
>> the function implementation.
>> Signed-off-by: Henry Wang <[email protected]>
>> Signed-off-by: Penny Zheng <[email protected]>
>> Signed-off-by: Wei Chen <[email protected]>
> 
> With the above comment clarified:
> 
> Acked-by: Julien Grall <[email protected]>

Thanks!

Kind regards,
Henry

> 
> Cheers,
> 
> -- 
> Julien Grall


Reply via email to