On Mon, Oct 04, 2021 at 02:43:52PM -0700, Zixuan Wang wrote: > On Mon, Oct 4, 2021 at 6:08 AM Andrew Jones <drjones@xxxxxxxxxx> wrote: > > > > On Fri, Aug 27, 2021 at 03:12:12AM +0000, Zixuan Wang wrote: > > > KVM-Unit-Tests library implements a memory allocator which requires > > > two arguments to set up (See `lib/alloc_phys.c:phys_alloc_init()` for > > > more details): > > > > > > #endif /* TARGET_EFI */ > > > -- > > > 2.33.0.259.gc128427fd7-goog > > > > > > > How about just getting the memory map (efi_boot_memmap) and then exiting > > boot services in arch-neutral code and then have arch-specific code decide > > what to do with the memory map? > > > > Thanks, > > drew > > > > I see, I will try to refactor the code in the next version: > > 1. Defines an arch-neutral data structure to store the memory map > 2. Calls an arch-neutral function to get the memory map So, in my first PoC, I was using the AArch64 mem_region structure, but in hindsight, an arch-neutral structure already exists that I should have used from the AArch64 code. That arch-neutral structure is simply the EFI structure (efi_boot_memmap). > 3. Exits UEFI boot services > 4. Calls an arch-specific function to process the memory map Sounds good. Thanks, drew