From patchwork Sun Feb 28 11:18:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8445941 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 79DA8C0553 for ; Sun, 28 Feb 2016 11:27:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ADED7202E9 for ; Sun, 28 Feb 2016 11:27:47 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2CB6202E6 for ; Sun, 28 Feb 2016 11:27:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aZzUe-0007Be-H2; Sun, 28 Feb 2016 11:26:32 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aZzUd-0007Ai-Dc for xen-devel@lists.xen.org; Sun, 28 Feb 2016 11:26:31 +0000 Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id 08/50-02987-669D2D65; Sun, 28 Feb 2016 11:26:30 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-10.tower-206.messagelabs.com!1456658786!25466875!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7335 invoked from network); 28 Feb 2016 11:26:29 -0000 Received: from szxga02-in.huawei.com (HELO szxga02-in.huawei.com) (119.145.14.65) by server-10.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 28 Feb 2016 11:26:29 -0000 Received: from 172.24.1.51 (EHLO szxeml432-hub.china.huawei.com) ([172.24.1.51]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DCB96490; Sun, 28 Feb 2016 19:20:22 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml432-hub.china.huawei.com (10.82.67.209) with Microsoft SMTP Server id 14.3.235.1; Sun, 28 Feb 2016 19:20:16 +0800 From: Shannon Zhao To: Date: Sun, 28 Feb 2016 19:18:59 +0800 Message-ID: <1456658360-16080-4-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1456658360-16080-1-git-send-email-zhaoshenglong@huawei.com> References: <1456658360-16080-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090205.56D2D7F7.0020, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 1bd41bda0394c23467c4b7596a2834c3 Cc: peter.huangpeng@huawei.com, zhaoshenglong@huawei.com, stefano.stabellini@citrix.com, ian.campbell@citrix.com, shannon.zhao@linaro.org Subject: [Xen-devel] [PATCH v4 03/24] arm/acpi: Read acpi memory info from uefi X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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..a6c3b69 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; +#if defined (CONFIG_ACPI) && defined (CONFIG_ARM) +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; } +#if defined (CONFIG_ACPI) && defined (CONFIG_ARM) + 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; +#if defined (CONFIG_ACPI) && defined (CONFIG_ARM) + acpi_mem.nr_banks = j; +#endif return EFI_SUCCESS; }