From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: Re: [PATCH v3 39/62] arm/acpi: Read acpi memory info from uefi Date: Thu, 26 Nov 2015 16:18:51 +0000 Message-ID: References: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> <1447753261-7552-40-git-send-email-shannon.zhao@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1447753261-7552-40-git-send-email-shannon.zhao@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: shannon.zhao@linaro.org Cc: mark.rutland@arm.com, hangaohuai@huawei.com, keir@xen.org, ian.campbell@citrix.com, ard.biesheuvel@linaro.org, andrew.cooper3@citrix.com, peter.huangpeng@huawei.com, xen-devel@lists.xen.org, julien.grall@citrix.com, stefano.stabellini@citrix.com, linux-arm-kernel@lists.infradead.org, jbeulich@suse.com, zhaoshenglong@huawei.com, roger.pau@citrix.com, christoffer.dall@linaro.org, david.vrabel@citrix.com List-Id: xen-devel@lists.xenproject.org On Tue, 17 Nov 2015, shannon.zhao@linaro.org wrote: > From: Parth Dixit > > ACPI memory is seperate from conventional memory and should be marked > as reserved while passing to DOM0. Create a new meminfo structure to > store all the acpi tables listed in uefi. > > Signed-off-by: Parth Dixit > Signed-off-by: Shannon Zhao Acked-by: Stefano Stabellini > xen/arch/arm/efi/efi-boot.h | 23 +++++++++++++++++++++++ > 1 file changed, 23 insertions(+) > > diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h > index e427e5f..c58caca 100644 > --- a/xen/arch/arm/efi/efi-boot.h > +++ b/xen/arch/arm/efi/efi-boot.h > @@ -17,6 +17,9 @@ void __flush_dcache_area(const void *vaddr, unsigned long size); > static struct file __initdata dtbfile; > static void __initdata *fdt; > static void __initdata *memmap; > +#ifdef CONFIG_ACPI > +static struct meminfo __initdata acpi_mem; > +#endif > > static int __init setup_chosen_node(void *fdt, int *addr_cells, int *size_cells) > { > @@ -129,6 +132,9 @@ static EFI_STATUS __init efi_process_memory_map_bootinfo(EFI_MEMORY_DESCRIPTOR * > { > int Index; > int i = 0; > +#ifdef CONFIG_ACPI > + int j = 0; > +#endif > EFI_MEMORY_DESCRIPTOR *desc_ptr = map; > > for ( Index = 0; Index < (mmap_size / desc_size); Index++ ) > @@ -148,10 +154,27 @@ static EFI_STATUS __init efi_process_memory_map_bootinfo(EFI_MEMORY_DESCRIPTOR * > bootinfo.mem.bank[i].size = desc_ptr->NumberOfPages * EFI_PAGE_SIZE; > ++i; > } > +#ifdef CONFIG_ACPI > + else if ( desc_ptr->Type == EfiACPIReclaimMemory ) > + { > + if ( j >= NR_MEM_BANKS ) > + { > + PrintStr(L"Error: All " __stringify(NR_MEM_BANKS) > + " acpi meminfo mem banks exhausted.\r\n"); > + return EFI_LOAD_ERROR; > + } > + acpi_mem.bank[j].start = desc_ptr->PhysicalStart; > + acpi_mem.bank[j].size = desc_ptr->NumberOfPages * EFI_PAGE_SIZE; > + ++j; > + } > +#endif > desc_ptr = NextMemoryDescriptor(desc_ptr, desc_size); > } > > bootinfo.mem.nr_banks = i; > +#ifdef CONFIG_ACPI > + acpi_mem.nr_banks = j; > +#endif > return EFI_SUCCESS; > } > > -- > 2.1.0 >