From patchwork Fri Feb 3 19:18:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 93310 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp738157qgi; Fri, 3 Feb 2017 11:21:08 -0800 (PST) X-Received: by 10.107.47.195 with SMTP id v64mr11100212iov.85.1486149668797; Fri, 03 Feb 2017 11:21:08 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 19si4147180ioj.58.2017.02.03.11.21.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 11:21:08 -0800 (PST) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZjOI-0004Tu-4f; Fri, 03 Feb 2017 19:19:26 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZjOH-0004Rs-CI for xen-devel@lists.xen.org; Fri, 03 Feb 2017 19:19:25 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 45/C6-22326-CB7D4985; Fri, 03 Feb 2017 19:19:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTXfP9Sk RBgcbeCyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oxPzz+xFKxWrHi29i5jA2OLVBcjF4eQwCZG iWnTbjBBOKcZJa7ue8TSxcjJwSagKXHn8ycmEFtEQFri2ufLjCA2s0CUxJ2LO8FqhAWcJTrOr GUDsVkEVCWebPkDZHNw8Aq4SlyarA4SlhCQkzh5bDIriM0JFP5+bh3YSCEBF4nF7R0sExi5Fz AyrGLUKE4tKkst0jU21EsqykzPKMlNzMzRNTQw08tNLS5OTE/NSUwq1kvOz93ECPQvAxDsYGx aFHiIUZKDSUmUt+jalAghvqT8lMqMxOKM+KLSnNTiQ4wyHBxKErz6IDnBotT01Iq0zBxgoMGk JTh4lER49UDSvMUFibnFmekQqVOMilLivMYgCQGQREZpHlwbLLgvMcpKCfMyAh0ixFOQWpSbW YIq/4pRnINRSZjXHmQKT2ZeCdz0V0CLmYAW/3w8CWRxSSJCSqqB0d99jd4i0xNr+K8tOLRl7p XT/gVT7863iL2RPTcw9YL4kac5e8569xy5tp9vRpZPSPPyRec19zzN37LTYZLu5xUFFosS/Xh Pf/h/ZOuN7aFnL+kznzwv5tQyVXPu5/zwyPaNJhl8T9o3VHCuEqq8vmlCQtWsuwv+adv475zh NJPr109mQVWZlKtKLMUZiYZazEXFiQAIyvXlaQIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-8.tower-21.messagelabs.com!1486149563!55910134!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22120 invoked from network); 3 Feb 2017 19:19:23 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-8.tower-21.messagelabs.com with SMTP; 3 Feb 2017 19:19:23 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5031AAD7; Fri, 3 Feb 2017 11:19:23 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.218.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 923CE3F242; Fri, 3 Feb 2017 11:19:22 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 3 Feb 2017 19:18:58 +0000 Message-Id: <1486149538-20432-15-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486149538-20432-1-git-send-email-julien.grall@arm.com> References: <1486149538-20432-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, shankerd@codeaurora.org Subject: [Xen-devel] [PATCH 8/8] xen/arm: acpi: Move the ACPI banks in bootinfo 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" Currently the acpi banks are stored in a separate variable and have an header just for them. This variable can be moved in the structure bootinfo removing an header and a global variable. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/efi/efi-boot.h | 3 +-- xen/arch/arm/efi/efi-dom0.c | 12 +++++------- xen/arch/arm/efi/efi-dom0.h | 8 -------- xen/include/asm-arm/setup.h | 3 +++ 4 files changed, 9 insertions(+), 17 deletions(-) delete mode 100644 xen/arch/arm/efi/efi-dom0.h diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h index 757d9c6..2e3e169 100644 --- a/xen/arch/arm/efi/efi-boot.h +++ b/xen/arch/arm/efi/efi-boot.h @@ -7,7 +7,6 @@ #include #include #include -#include "efi-dom0.h" void noreturn efi_xen_start(void *fdt_ptr, uint32_t fdt_size); void __flush_dcache_area(const void *vaddr, unsigned long size); @@ -164,7 +163,7 @@ static EFI_STATUS __init efi_process_memory_map_bootinfo(EFI_MEMORY_DESCRIPTOR * #ifdef CONFIG_ACPI else if ( desc_ptr->Type == EfiACPIReclaimMemory ) { - if ( !meminfo_add_bank(&acpi_mem, desc_ptr) ) + if ( !meminfo_add_bank(&bootinfo.acpi, desc_ptr) ) { PrintStr(L"Error: All " __stringify(NR_MEM_BANKS) " acpi meminfo mem banks exhausted.\r\n"); diff --git a/xen/arch/arm/efi/efi-dom0.c b/xen/arch/arm/efi/efi-dom0.c index f0ceaa6..1c35654 100644 --- a/xen/arch/arm/efi/efi-dom0.c +++ b/xen/arch/arm/efi/efi-dom0.c @@ -22,7 +22,6 @@ */ #include "efi.h" -#include "efi-dom0.h" #include #include #include @@ -32,7 +31,6 @@ #define XZ_EXTERN STATIC #include "../../../common/xz/crc32.c" -struct meminfo __initdata acpi_mem; /* Constant to indicate "Xen" in unicode u16 format */ static const CHAR16 xen_efi_fw_vendor[] = {0x0058, 0x0065, 0x006E, 0x0000}; @@ -46,7 +44,7 @@ size_t __init estimate_efi_size(int mem_nr_banks) int acpi_mem_nr_banks = 0; if ( !acpi_disabled ) - acpi_mem_nr_banks = acpi_mem.nr_banks; + acpi_mem_nr_banks = bootinfo.acpi.nr_banks; size = ROUNDUP(est_size + ect_size + fw_vendor_size, 8); /* plus 1 for new created tables */ @@ -124,10 +122,10 @@ void __init acpi_create_efi_mmap_table(struct domain *d, fill_efi_memory_descriptor(desc, EfiConventionalMemory, mem->bank[i].start, mem->bank[i].size); - for ( i = 0; i < acpi_mem.nr_banks; i++, desc++ ) + for ( i = 0; i < bootinfo.acpi.nr_banks; i++, desc++ ) fill_efi_memory_descriptor(desc, EfiACPIReclaimMemory, - acpi_mem.bank[i].start, - acpi_mem.bank[i].size); + bootinfo.acpi.bank[i].start, + bootinfo.acpi.bank[i].size); fill_efi_memory_descriptor(desc, EfiACPIReclaimMemory, d->arch.efi_acpi_gpa, d->arch.efi_acpi_len); @@ -135,7 +133,7 @@ void __init acpi_create_efi_mmap_table(struct domain *d, tbl_add[TBL_MMAP].start = d->arch.efi_acpi_gpa + acpi_get_table_offset(tbl_add, TBL_MMAP); tbl_add[TBL_MMAP].size = sizeof(EFI_MEMORY_DESCRIPTOR) - * (mem->nr_banks + acpi_mem.nr_banks + 1); + * (mem->nr_banks + bootinfo.acpi.nr_banks + 1); } /* Create /hypervisor/uefi node for efi properties. */ diff --git a/xen/arch/arm/efi/efi-dom0.h b/xen/arch/arm/efi/efi-dom0.h deleted file mode 100644 index 3cd4caa..0000000 --- a/xen/arch/arm/efi/efi-dom0.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __ARM_EFI_DOM0_H__ -#define __ARM_EFI_DOM0_H__ - -#include - -extern struct meminfo acpi_mem; - -#endif diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h index 3da7a49..7c76185 100644 --- a/xen/include/asm-arm/setup.h +++ b/xen/include/asm-arm/setup.h @@ -43,6 +43,9 @@ struct bootmodules { struct bootinfo { struct meminfo mem; struct bootmodules modules; +#ifdef CONFIG_ACPI + struct meminfo acpi; +#endif }; extern struct bootinfo bootinfo;